Wednesday, October 26, 2011

External ID is missing the system ID

com.wm.lang.wsdl.WSDException: com.wm.lang.flow.WattEvaluationException: com.wm.lang.xml.WMDocumentException: [ISC.0042.9322] External ID is missing the system ID

I got this error when trying to import a WSDL from an outside company.  Searched the net, wmusers, no help.

Then I tried saving the WSDL to a file from the URL, then importing the file directly.  That worked!  Whew!

Wednesday, October 12, 2011

Restful Service in webMethods

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.

  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.

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.