PDA

View Full Version : xml post to wm returns unwanted <values>


toddwaldorf
04-12-2006, 19:04
I have create a service that is expecting an xml post. The client is setting the content-type to text/xml and the service is correctly receiving the xml post as a node object I then convert the node to document etc... the service seems to work fine and returns one string title xmlResponse, which is, as one might expect, and xml string formated as such
i.e.
<?xml version="1.0" encoding="UTF-8"?><response>...</response>

On the settings tab of the service I have set the Service Output Template Type = xml and put one %value xmlResponse% in the template

when I test the service using the $xmldata in querystring method
i.e.

http://webMethods:5595/invoke/.../service?$xmldata=<?xml version="1.0" encoding="UTF-8"?><request>...</request>

I get back a properly formatted xml document as I expect, but when the service is invoked via a POST with the content-type = text/xml webMethods returns the following (looks to me like the pipeline as values) and ignores the template

<?xml version="1.0" encoding="UTF-8"?>
<Values version="2.0">
<value name="xmlResponse">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;response&gt;...&lt;/response&gt;

what is going on? is this a bug? any ideas on how to fix?

mcarlson
04-12-2006, 23:09
It's always good practice to drop unneeded values from the pipeline as soon as you are finished with them. By the end of your service you should only have the values you have declared in your output tab remaining in the pipeline.

You can also use the pub.flow:setResponse built-in service to return a specific XML (or HTML) document to the caller.

Mark