Skip to Content
0
Former Member
Sep 29, 2005 at 03:14 PM

Problems with IWDCachedWebResource

21 Views

I'd like to use the CachedWebResource to display a pdf in an IFrame/external window/etc, but am having issues...

1) The pdf never shows up in the IFrame or external window... Only a blank screen. I can change the resource type to XML and use an xml file, and it works fine. What am I missing?

public void onPlugIn(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
 //@@begin onPlugIn(ServerEvent)
 IWDCachedWebResource cachedResource = null;
 String pdfUrl = null;
 byte[] pdf = <i><get the file></i>;
 if (pdf != null) {
   cachedResource = WDWebResource.getWebResource(pdf, WDWebResourceType.PDF);
   try {
     pdfUrl = cachedResource.getURL();
     wdContext.currentContextElement().setUrl(pdfUrl);
   }
   catch (WDURLException e) {
     IWDMessageManager mgr = wdComponentAPI.getMessageManager();
     mgr.reportException(e.getLocalizedMessage(), true);
   }
 }
 //@@end
}

2) When I switch the resource type to xml, and use an xml file that is very, very large (but still valid), I get the following error trying to display the CachedWebResource in the IFrame.

<b>XML document must have a top level element. Error processing resource 'http://<i><server></i>:50000/webdynpro/dispatcher/local/Rep...</b>

Are there size limitations with the CachedWebResource? Any ideas?

Thanks,

-Dave