LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Web Service SOAP returned XML data is unreadable

Solved!
Go to solution

Hello,

 

I'm hoping someone with some SOAP experience could help me find a solution as to why the XML data coming back from a Web Service (SAP manufacturing) is unreadable.

 

In the file attached is the response from the Web Service, and as you can see in the header the request is OK. (request was to move a serialized PCB from a "queue" to "work"). Request is successful (I verify this manually by logging into SAP web service directly and verifying), but in addition data on that PCB is to be returned (board stock code, etc..).

 

My request and response with returned XML data works fine in SoapUI.

 

Any help would be appreciated.

Download All
0 Kudos
Message 1 of 8
(8,113 Views)

For one thing, the .docx document you attached is not XML!  XML is a "text document", readable by humans.  Try opening your document in Notepad -- if it were XML, you'd be able to read it.

0 Kudos
Message 2 of 8
(8,098 Views)

Well, I took a chance and opened the docx file. You placed a screen shot of the text output (WebService Response)

 

The first thing I see is that the HTTP header shows that the content encoding is gzip.

 

You will have to uncompress the data, or request the data in a way that returns uncompressed XML.

 

I've added the picture below for others... 

 

WebService Response.PNG

 

You could extract the content portion and use this to deflate the contents...

 

https://decibel.ni.com/content/docs/DOC-7200


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

0 Kudos
Message 3 of 8
(8,090 Views)

Thanks for the reply, but maybe I didn't describe or show the issue correctly.

 

Attached is XML request and response using Soap UI and the response using Labview2013. Just a bunch of garbage characters in the labview response which I cannot show in a text editor such as notepad so I had to take a snapshot of my front panel string indicator to show the garbage characters from the web service.

 

I could also send RAW header request and response if it will help.

0 Kudos
Message 4 of 8
(8,078 Views)

I agree with Phillip (except that you want to "inflate" the payload).  You can simply post a VI with the complete response set as the default value in a string control/indicator and I wager we could get it sorted out.

0 Kudos
Message 5 of 8
(8,065 Views)

Thanks for the reply and the code. I will need to parse header and send remaining XML compressed string to your converter code. One thing though, when I opened the .vi it gave me an error due to version of .Net on my system (4.0.0.0). Your code use .Net 2.0.0.0. Will this be an issue? 

 

Also, I have used the "deflate" after the gzip during the request, but it gave me same results. I will post update after I parse.

 

Thanks,

 

 

0 Kudos
Message 6 of 8
(8,063 Views)
Solution
Accepted by topic author JohnnyR

@Darin.K wrote:

I agree with Phillip (except that you want to "inflate" the payload).  You can simply post a VI with the complete response set as the default value in a string control/indicator and I wager we could get it sorted out.


Thanks Darin, I was thinking uncompress and after reading a googled article re: SAP NetWeaver that used the terms inflate and deflate, I confused my prefixes. I also regularly swap digits when transcribing long numbers; dyslexic I am.

 

JonnyR - Please use the uncompress function that I included on the same link earlier. You will need to remove the HTML header portion of the string. If you don't, the uncompress will interpret the header as compressed data and you will get jumbled data as an output.


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Message 7 of 8
(8,032 Views)

Thanks Phillip. Your solution worked great. After I parsed the header, and ran the compressed data through the .dotNet Decompress.vi, the data was now readable.

0 Kudos
Message 8 of 8
(7,984 Views)