cancel
Showing results for 
Search instead for 
Did you mean: 

Saving Adobe Interactive Form into a Server Path in Webdynpro.

Former Member
0 Kudos

Hi Forum,

I have an Adobe Interactive Form as UI element in my webdynpro View. This form is available in the context attribute in Binary Format. I can read the form from this attribute as Byte Array only. I want to save this file in to a folder located in the Portal Server (ex : path :
usr\jc00\j2ee\........\temp\myfolder).

I am trying with the following code :

IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute(IPrivateTestCompView.IContextElement.PDF_SOURCE);

IWDModifiableBinaryType binaryType =(IWDModifiableBinaryType) attributeInfo.getModifiableSimpleType();

IPrivateTestCompView.IContextElement element = wdContext.currentContextElement();

binaryType.setMimeType(WDWebResourceType.PDF);

//if a file in the 'FileResource' attribute exists

if (element.getPDFSource() != null) {

try {

String ext=binaryType.getMimeType().getFileExtension();

String fileName="PriceUpdateForm1";

byte[] b = wdContext.currentContextElement().getPDFSource();

File files = new File("C:
usr
sap
EP7
JC00
j2ee
temp
HTI
"fileName"."+ext);

try {

FileOutputStream out = new FileOutputStream(files);

out.write(b);

out.close();

} catch (FileNotFoundException e) {

//TODO Auto-generated catch block

e.printStackTrace();

wdComponentAPI.getMessageManager().reportSuccess(e.getMessage());

} catch (IOException e) {

//TODO Auto-generated catch block

e.printStackTrace();

wdComponentAPI.getMessageManager().reportSuccess(e.getMessage());

}

element.setPDFSource(null);

} catch (Exception e) {

throw new WDRuntimeException(e);

}

}

-


it is giving me the error :-

java.lang.Exception: Incorrect content-type found 'text/html'

at com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.ClientMimeMessage.initDeserializationMode(ClientMimeMessage.java:120)

at com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.MimeHttpBinding.handleResponseMessage(MimeHttpBinding.java:951)

at com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.MimeHttpBinding.call(MimeHttpBinding.java:1430)

at com.sap.tc.webdynpro.adsproxy.ConfigBindingStub.rpData(ConfigBindingStub.java:82)

at com.sap.tc.webdynpro.adsproxy.ConfigBindingStub.rpData(ConfigBindingStub.java:99

-


Can any one tell me what went wrong and how to convert the ByteArray into PDF and save it on to network path.

Any help will be highly awarded........

Thanks

Ramesh.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos