[SOLVED] pub.xml:XmlStringToXmlNode produces weird output

Hi everybody

I’m trying to make a soap object and for the body (pub.soap.utils:addBodyEntry) I’m currently using a static XML for testing purposes.

This is my XML-string input:

<UpdateListItems>
         <listName>{D3205B25-5EC2-42A7-9F3B-2299A002E213}<listName>
         <updates>
           <Batch OnError="Continue" ListVersion="1">
			<Method ID="1" Cmd="New">
				<Field Name="Title">SAG BPMS DEV</Field>
				<Field Name="Description">Book</Field>
				<Field Name="Email">test@test.be</Field>
				<Field Name="Storage_x0020_Location">Locker 1</Field>
				<Field Name="Position_x0020_in_x0020_Storage">Shelf 1</Field>
				<Field Name="Course_x0020_Date">2014-03-22T00:00:00+0:00</Field>
				<Field Name="Person">-1;#Test Person</Field>
			</Method>
		</Batch>
         </updates>
      </UpdateListItems>

When I change the produced node back to a string (xmlNodeToDocument → xmlDocumentToString), following XML is produced.

<?xml version="1.0"?>
<UPDATELISTITEMS></UPDATELISTITEMS>
<LISTNAME></LISTNAME>
<UPDATES></UPDATES>
<BATCH ONERROR="Continue" LISTVERSION="1"/>
<METHOD ID="1" CMD="New"/>
<FIELD NAME="Title"/>
<FIELD NAME="Description"/>
<FIELD NAME="Email"/>
<FIELD NAME="Storage_x0020_Location"/>
<FIELD NAME="Position_x0020_in_x0020_Storage"/>
<FIELD NAME="Course_x0020_Date"/>
<FIELD NAME="Person"/>

Does anyone know why this happens and how I can solve this?

I hope you have enough information with this, if not, please don’t hesitate to ask because I know my question may be stupid but I’m just learning to use the software through an internship.

With kind regards
Kevin

In both the steps are you setting param called “documentTypeName” (this willl be fully qualified XML document type name that you are mapping/parsing)…Can you try give that option also and see if the outputs correctly with values and tags.

HTH,
RMG

when you call pub.xml:xmlStringToXMLNode, make sure set isXML = true.
it should fix your problem

I don’t think that’s the issue, when I don’t perform the last two steps and just run xmlStringToXmlNode → addBodyEntry → soapDataToString, following output is generated:

<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"></SOAP-ENV:Header><SOAP-ENV:Body>
<UPDATELISTITEMS></UPDATELISTITEMS>

         <LISTNAME></LISTNAME>{D3205B25-5EC2-42A7-9F3B-2299A002E213}

         <UPDATES></UPDATES>

           <BATCH ONERROR="Continue" LISTVERSION="1"></BATCH>

			<METHOD ID="1" CMD="New"></METHOD>

				<FIELD NAME="Title"></FIELD>SAG BPMS DEV

				<FIELD NAME="Description"></FIELD>Book

				<FIELD NAME="Email"></FIELD>emans@test.be

				<FIELD NAME="Storage_x0020_Location"></FIELD>Kast 1

				<FIELD NAME="Position_x0020_in_x0020_Storage"></FIELD>Schap 1

				<FIELD NAME="Course_x0020_Date"></FIELD>2014-03-22T00:00:00+0:00

				<FIELD NAME="Person"></FIELD>-1;#Emans Kevin

			

		

         

      </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Note: addEmptyHeader is set to ‘true’ and soapProtocol to ‘Soap 1.1’ int the createSoapData step.

That fixed the problem allright! :slight_smile:

Thanks a lot!

OK make sense…as I did not focus on the xmlstringtonode step:

No prob, thnx for replying anyway :slight_smile:

Kind regards
Kevin

you bet: :smiley: