[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:

           <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>

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

<?xml version="1.0"?>
<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

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.


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>



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

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


				<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





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

you bet: :smiley: