Implementing Restful service using WM Integration Server.

I’m trying to expose a simple Restful service using WM Integration server, but I couldn’t find any samples or document apart from Restful service developer guide. Appreciate your guidance.

As per the document, I have created a folder ‘Program’ and trying to expose it’s resources through the Restful methods. Attaching the screen shot for your ref. What should do next? how do I expose these services for client? do I need to use web-service descriptors ? how to integrate the authentication?

Please advise.

Dinesh – http://satyampulkam.blogspot.com/2013/04/rest-services-in-webmethod.html url has good explanation. You can go through it.

Thanks,

Thanks. But, I’m sorry!, I 'm not even able to follow the first step.
“convert the xml node to document”

  • Which XML?

Per developer guide, the Restful api is passing only the resourceId.

Appreciate your guidance.

That link seems to imply that the consumer is posting an XML document to the service, which as Dinesh has already discovered, is not always the case.

One of the better ways for you to get familiar with how it works is to run some data through it. My favorite option is to use something like soapUI in conjunction with services like savePipeline/restorePipeline.

You can create a REST project in soapUI and provide it your endpoint URL, which in this case, it will be something like: http://localhost:5555/rest/DigitalRestServices.Program

Please note a couple of important things:

  1. The use of the REST directive instead of INVOKE
  2. The exclusion of the service name from the URL

From soapUI, play around with changing the HTTP method from GET to POST to whatever and notice different services being called. Also, play around with passing data to the service and changing the content-type around, such as text/xml, application/json, etc, etc.

Percio

I agree percio with your comments :lol:

Dinesh, try the options and let us know if you come across any issues.

Thanks,

Percy Castro,
Thanks. I’m able to validate the _get method using your guidance.
However, the response is in HTML format and expectation is to get it in JSON format. Please advise if I need to do any specific configuration while creating the _get service.

Thanks in advance.
Dinesh


In soapUI, add a header with name “Accept” and value “application/json”

Percio,
It helped. Thanks.