Trying to output XML

I assume that you invoking the pub.xml:documentToXMLString
service to convert the document into XML. If so, then you need
to set the encode parameter of pub.xml:documentToXMLString to

I saw pub.xml:documentToXMLString mentioned in another thread and I looked but I don’t have pub.xml in my installation.

I created a vastly simplified service that outputs a tiny record in XML format using recordToDocument, and when I call that service in my browser it outputs fine, but when I call it as I usually do (HTTP Post via MSXML2.ServerXMLHTTP) I get all the <values> junk. So I guess WM is handling the output based on the agent used to call the service (think I read about that somewhere)…do I need to trick it into thinking that my server component is a browser?

If you don’t like the default XML produced by documentToXMLString you can add a “template” to your service. When there is a template whenever the service is invoked via HTTP, the result pipeline will be passed to the same engine that is used to process DSPs. These means that you can use all the DSP tags to process the service output keys and values.



Actually the (pub.xml:documentToXMLString)is a IS6.0 service,so this won’t apply to webMethods (Business Connector 4.7).

documentToRecord(3.0 to 4.6) == pub.xml:NodeToDocument(6.0 and above)
recordToDocument(3.0 to 4.6) == pub.xml:documentToXMLString(6.0 and above)

when you do a HTTP Post of XML document with Content-Type=“text/xml”
to webMethods,then receiving flowService should receive a node(object)check this in the that
“documentToRecord” will parse and in the “recordToDocument” service (set input param “encode=true”).

Finally you will see the output as expected:



Also, one other possibility is to design and register your own unique content handler. So when you post the content to IS, the content handler you specify in ContentType will trigger your custom handler.

Igor Androsov wrote an excellent article here on wmusers that illustrates just how write and implement a content handler. (Thanks Igor).

I recommend against unregistering a supported content handler and replacing it with your own (I have worked at companies who have done this and you run the risk of negating support for your implementation.) For example, replacing the built-in xml parser. The documentation in 6.x does cover this facet of the product.

I recommend that you create your own and register it separately and that should be supported.



Hi Ray,

Please give a link to the article by Igor.


Here is that link,


Thanks to all for your comments so far. With your help I’ve been able to narrow this down a bit.

Using the same WM Service to test against, I changed my ASP page to use HTTP GET instead of POST to communicate with WM, and got the results I was looking for. That led me to believe that the content-type is somehow different when doing a POST, so I wrote a small test but it is in fact sending the data to WM as “text/xml” so I guess that’s not the problem.

I’ve mucked around with all the parameters for documentToRecord and recordToDocument (encode seemed to be the only one that looked promising), but it’s still ignoring my XML output template and using its own one.

Here’s how I’m calling/sending xml to WM:

Set oXMLH = Server.CreateObject(“MSXML2.ServerXMLHTTP”)
oXMLH.setRequestHeader “Content-Type”, “text/xml” “POST”, sFunctionURL, false, C_SAPBCUSERNAME, C_SAPBCPASSWORD
oXMLH.send oRequest
Response.Write oXMLH.responseXML.xml

As I mentioned, if I change the method to GET on line 3, I receive the desired results (but I can’t send data, so a bit useless).




Is your problem got resolved?

If not let us know at which point in the flow you got stuck.

Use the search functionality in this site and c if anyone is success of http posting xml to WM from ASP webpage.


I’m still interested in resolving this but I’m a bit busy right now, and I have a workaround (I have a function that converts the mess that BC sends me into the XML I want). Once I get a little time I’ll do some more researching.

Thanks for your ideas