Restful Service in webMethods
Dec 17, 2020 11:58 0 Comments Other components NAIDU

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.


I had a rest service call coming into the Integration Server with an HTTP Post request to http://:5555/invoke/TestForKev.esla.pub/event with a type of application/xml in UTF-8.
 

  1. So I wrote a flow service in TestForKev/esla/pub called event.  
  2. I created an input parameter of contentStream with an object type.
  3. I called pub.io:streamToString to convert the contentStream to a string
  4. I called pub.xml:xmlStringToXMLNode to create the XML node.
  5. Then I called pub.xml:xmlNodeToDocument to finally convert to a webmethods document.
  6. 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://: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.   

     


     
Prev Next
About the Author
Topic Replies (0)
Leave a Reply
Guest User

You might also like

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.


Let`s Connect