cancel
Showing results for 
Search instead for 
Did you mean: 

WDWebResource.getWebResource of WAS 7.0

Former Member
0 Kudos

Hi,

During migration of web dynpro programs from 6.4 to 7.0, the Netweaver Developer Studio warns that <b>WDWebResource.getWebResource()</b> has been deprecated. Although the deprecated still works, what should be its replacement?

Tony Kwan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Tony,

Yes it is true that the method has been deprecated but only two of its implementations, not all.

Propbably you are using the getWebResource(byte[] , WDWebResourceType , boolean ) type, while in the current version of the webdynpro API, the boolean field is not required.

For more information of on the WDWebResource class refer to the following API link,

http://media.sdn.sap.com/html/submitted_docs/60_sp2_javadocs/webdynpro/com/sap/tc/webdynpro/services...

Regards,

Guru.

PS: Reward points for usefull tips.

Former Member
0 Kudos

Hi Gurvinder,

Thanks for your information & URL. I am now using <b>getWebResource(byte[] webResource, WDWebResourceType resourceType)</b>, which is also deprecated at WAS 7.0 .

Only 2 methods of <b>WDWebResource</b> are not yet deprecated, which both require <b>WDDeployableObjectPart</b>. How the WDDeployableObjectPart can be created from a byte array, so that programmatically created data can be downloaded as a file?

Thanks!

Tony

Former Member
0 Kudos

I found the proper way of file download (forgot where I found it) (long time ago, well...) for NW2004s and post it here for the information of the interested developers.

<u>Step 1</u>

create a value attribute of type Resource

<u>Step 2</u>

wdContext.currentContextElement().setXXX(
    WDResourceFactory.createCachedResource(data,filename,objecttype));

<a href="https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/progmodel/api/WDResourceFactory.html">WDResourceFactory.createCachedResource()</a>

<u>Step 3</u>

bind the FileDownload->resource to the above value attribute but leave FileDownload->data empty

<u>Step 4</u>

throw away stuff about WDWebResource & IWDModifiableBinaryType so that no deprecation warning anymore

Tony

Answers (0)