This is another of those things that should be easy right? Well, it is once you know what to do.
++++ Added note ++++
After I figured out how to do this indirectly, I found the actual Webmethods REST users guide. It is a more complete way to implement RESTful services. This only works in version 8.2 however.
See http://documentation.softwareag.com/webmethods/wmsuites/wmsuite8-2_ga/Integration_Server/8-2-SP1_REST_Developers_Guide.pdf
++++++++++++
I had a rest service call coming into the Integration Server with an HTTP Post request to
http://<server>:5555/invoke/TestForKev.esla.pub/event with a type of
application/xml in UTF-8.
- So I wrote a flow service in TestForKev/esla/pub called event.
- I created an input parameter of contentStream with an object type.
- I called pub.io:streamToString to convert the contentStream to a string
- I called pub.xml:xmlStringToXMLNode to create the XML node.
- Then I called pub.xml:xmlNodeToDocument to finally convert to a webmethods document.
It should look something like this.
Now you have a webmethods document from your rest service interface.
URL Parameters
If you need to take a rest service input that uses URL parameters, you can still get to them. Say you have a url like
http://<server>:5555/invoke/TestForKev.esla.pub/event_change/98765 where 98765 is the event_id.
Just write the service as above, but add in a call to pub.flow:getTransportInfo. The requestURL returned will contain the service name and the parameters at the end of the url, so you can parse them out.
<value name="requestUrl">/invoke/TestForKev.esla.pub/event_change/98765</value>
Response Values
Found out how to send the http status and message back to the caller. Use pub.flow:setResponseCode to explicitly set the response values. Otherwise defaults are chosen for you.