开发者

SOAP: Reading SOAP response's embedded file

开发者 https://www.devze.com 2023-02-10 06:03 出处:网络
In SOAP Client application. I am using javax.xml.soap api. I am getting the soap response. A part of it, shown below.

In SOAP Client application. I am using javax.xml.soap api. I am getting the soap response. A part of it, shown below.

<ns5:XXX type="Full" format="HTML">
<ns5:EmbeddedFile   MIMEType="text/html" 
                    fileExtension="html" 
                    fileName="ZZZ.html">
<ns5:Document>...</ns5:Document>
</ns5:EmbeddedFile>
</ns5:XXX>

The value between the Document tag is in the Base64 format.

I need to know two things, as in the above code you will see that, the fileName is zzz.html. where this zzz.html file will stored or exits. I search for in my local machine i do not find.

Another thing i would like to know that the between the Document tags it show long text messages in the Base64 format. Is this is the document that exists in the zzz.html. If it is so 开发者_如何学编程how to read that document.

Thanks


This appears to be a custom way of embedding file content to a SOAP message being used by the service you are calling - a standard way of doing this would have been using Soap Attachments.

In this specific case, it does look like the file content is being embedded as Base64 data between the Document tags, and the meta information of the file is the attributes of EmbeddedFile tag. You will basically have to decode the Base64 encoded content - see here and here on how to, move the contents to a file with the name in the meta information tag.

0

精彩评论

暂无评论...
验证码 换一张
取 消