[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ftpapi] Soap response has unwanted http headers



Keith:

Are you sure this isn't a multipart document?  Something like the following:

--RandomBoundaryString
header
header
<blank line>
body of document
--RandomBoundaryString
header of 2nd part
more headers
<blank line>
body of document
--RandomBoundaryString--

This is a format that is used when a document has multiple parts, such as when there's both a SOAP message and another document to download at the same time (an "attachment" they are sometimes called).

Unfortuntely, HTTPAPI has nothing built-in to decode multipart documents.  (It does have something for encoding them -- just not decoding.)  So you'd need to write your own code.  You'd do this by searching for the boundary string, then reading until the blank line to skip the headers.  That would be the start of the document -- and then read until the next boundary to find the end of the document.  Whatever you find therein would be the actual doc.

On the other hand, if you're really (as you seem to be implying) getting normal HTTP headers mixed in with your data, and this isn't a multipart document -- then something is seriously wrong.  Probably a bug on the server, since HTTPAPI seems to work perfectly at extracting just data (and omitting the headers) for all cases I've seen.

-SK


On 10/11/17 6:18 AM, Keith McCully wrote:
Hi 

I am using http_post_stmf api to send a soap request file to a Web service and receive the soap response in an IFS folder. Version V6R1. 

The request soap is valid and the http transfer works well.

However the soap response file contains additional data items outside of the soap envelope that trigger a parser error - which makes sense as not pure xml. 

The extra items are a UUID at the start and end of the document plus 3 content related http headers at the top

Like this 

-- UUID: 
Content - 
Content-
Content-

<soap response here>
-- UUID 

If I remove the extra items from the file, the soap response parses fine. 

So is there any way to prevent these extra items being included in the soap response file or at least have the parser ignore them and just process the soap Response?

If I run the request from soapUI I see the same extra items when I  view as 'raw data'.

Also where would the control to remove these items be located: from the httpapi call, from within the request soap or by config on the server?

Thanks 

Keith 
sent from Android



-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi