OK so I am working on a project where I need to connect to an external system with a web request and send some SOAP and I get a SOAP response. That all works great. Now I am attempting to parse the SOAP response into several collections. I have a Query XML action where I specify a query like /SOAP-ENV:Envelope/SOAP-ENV:Body/defaultNS:getRecordsResponse/defaultNS:getRecordsResult/defaultNS:number. I am storing the text of this result into a collection. Then I repeat this action a bunch more times for other elements in the SOAP return. Finally I want to loop through the results and add them to a list.
In my Query XML action if I use Run Now I get all the results I am expecting. Output one shows all the numbers, output 2 shows all the states with no xml or markup being displayed. After this I do a collection Action to get a count of the elements in the collection. I manually count about 15 items. Then I do a For Each Action where I specify the collection, the Store result in text field and the index variable. Within my loop I write to the log the values of each item. I will eventually write these to a list.
The problem is when I get to printing out the results, the count operation only counts 1 item and then when it shows me the value of that one item it is the entire xml, not the value I parsed out in my query. I can't figure out why. Here are some of the actions.
Any help here would be greatly appreciated.
Solved! Go to Solution.
The xml is something like this. I changed some stuff so I wasn't posing company data. Also this xml has only one entry instead of the 15 or 20 that I get back.
<SOAP-ENV:Envelope xmlnsOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<description>Email trail is located on the work notes.
From: Doe, Jane
Sent: Thursday, November 01, 2012 8:08 AM
To: Doe, Jim; Dough, Bob
Subject: RE: Subject line - urgent - production issue
Bob talking about each orders, Building should be able to release the order one by one without effort, and a whole lot more of an email message that I am blanking out with this inane writing so as to have an example to post without incriminating anybody.
<short_description>Bobs Shipping Issues</short_description>
Well I've run it through a test workflow and it works ok for me:
It's probably worth double checking the XML that is being passed in via the WSIncidentsResult variable as it may not be in the format you're expecting.
Please let me know if you need any further help?
You are right, I am getting a partial xml result. No idea why, but not all the xml is returning. I tried storing the xml in a single line of text and in a multiline, but got the same result. Is there anything on the nintex side that would limit the size of that text I can store? I am not doing any xslt transforms, but I did also just add capture errors and there were none. Thanks for the help. We don't have an answer but at least now there is a road to look down. so new question, what would cause the response to be truncated?
I know from doing the run now action on that step that the service is returning a full response at least in that case. Any ideas here?
You could try setting the Force top level XML node in the Web Service action, this can help if the xml returned is a fragment. But you could also do an XSL transform which would let you manipulate the results before they are stored in the variable, you could filter out any information you didn't need to use.