documentToXMLString skips outer element

Hi!

I have made a simple service that takes a specific document type (describing an xml document) as a parameter and uses the documentToXMLString function to convert the document to a string.

The document may look like this:

<?xml version="1.0" encoding="ISO-8859-1" ?> X

For some reason the documentToXMLString skips the outer tag.

Does anyone know how why or how I can fix it?

Regards
Mikael

Hi Mikael

According to ur description what i understand is may be you have named the document as Services

Give a different name to the IS document and inside that
create the other documents(tags) like
Services
Request

It should work, I dont see any other reason for it to not to work

HTH
Nandan

Using Developer’s pipeline editor, create a child document named “Services” under the “document” input parameter of the pub.xml:documentToXMLString service. Map your “Services” document to that new child.

If you want your xml string to use a namespace prefix. Name the child document to prefix:Services and populate the nsdecls parameter to associate that prefix with a namespace value.

Mark

Hi

Thanks for the reply!

The document type is called “getPrivateCustomerDocumentType”, but the name should not have anything to do with this behaviour.

The service just takes this docType as a parameter and converts it to a string using documentToXMLString.

I solved it temporary by adding an outer dummy tag, “apa” (which is swedish for ‘monkey’ btw) as seen in the attached image.

But I still can´t figure out why the outer tag (apa in this case) is not included in the xml string.