IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
Expand all | Collapse all

Simple custom SOAP Processor Example - Echo a soap request message

  • 1.  Simple custom SOAP Processor Example - Echo a soap request message

    Posted Fri March 17, 2006 12:28 AM

    In early testing efforts it is sometimes useful to provide a simple URL that will always echo the soap request message back to the sender.

    This very small java service can be registered as a soap processor to do just that:

    [highlight=java]

    //Note: Add com.wm.app.b2b.server.SOAPMessage to the “Imports” list on your java service’s “Shared” tab

    IDataCursor idc = pipeline.getCursor();

    //create two new com.wm.app.b2b.server.SOAPMessage objects to hold the soapRequestData and soapResponseData
    SOAPMessage request = new SOAPMessage();
    SOAPMessage response = new SOAPMessage();

    //get the soapRequestData object from the pipeline and throw exception if not present
    if (idc.first(“soapRequestData”)) {
    request = (SOAPMessage)idc.getValue();
    } else {
    throw new ServiceException(“Error: Missing SOAP Request!”);
    }

    response = request;
    idc.insertAfter(“soapResponseData”, response);
    idc.destroy();

    [/highlight]

    Save this java service and then register the service using the pub.soap.processor:registerProcessors built-in service. Specify “echo” for the “directive” parameter and specify the fully qualified name of the java service as the “svcName” parameter.

    You can confirm that your custom soap processor is registered using the pub.soap.processor:list built-in service.

    Once this echoing SOAP processor is registered any SOAP request posted to http://hostname:port/soap/echo will be returned as the soap response.

    Note: This example makes use of internal, non-documented classes that may change in subsequent releases.


    #webMethods
    #API-Management
    #soa


  • 2.  RE: Simple custom SOAP Processor Example - Echo a soap request message

    Posted Wed December 27, 2006 05:09 AM

    Hey Mark,

    Thanks a bunch for that Java based custom soap processor! I m now getting new ideas!!
    First, I will try the exact same impl on the local IS server and then let my ideas rule!

    Thanks a bunch again!

    Cheers
    G


    #webMethods
    #API-Management
    #soa


  • 3.  RE: Simple custom SOAP Processor Example - Echo a soap request message

    Posted Wed December 27, 2006 03:43 PM

    Mark,

    Out of curiosity… from just looking at this Java service, it appears to me that the same may be done with a Flow service. Is there a reason why a Flow service could not be used here?

    Thanks,
    Percio


    #webMethods
    #soa
    #API-Management


  • 4.  RE: Simple custom SOAP Processor Example - Echo a soap request message

    Posted Wed December 27, 2006 04:05 PM

    When I posted this example, I was exploring converting my custom soap processor implementation to java using some of the private classes for WM soap messages.

    The purpose of sharing it was just to show that a soap processor could be built in java and to show one of the private classes that could be used.

    Yes, it could be built in Flow as well.

    Mark


    #webMethods
    #soa
    #API-Management


  • 5.  RE: Simple custom SOAP Processor Example - Echo a soap request message

    Posted Wed December 27, 2006 04:13 PM


  • 6.  RE: Simple custom SOAP Processor Example - Echo a soap request message

    Posted Wed December 27, 2006 06:32 PM

    Mark,

    Thanks for your sticky at [url]wmusers.com

    Has WM implemented this out of the box yet? In some other posts I read Q1-Q2 of 2007.

    I do have more questions evaluating IS as an ESB. Would this be the appropriate forum to post them.

    Regards,
    Radu.


    #soa
    #API-Management
    #webMethods


  • 7.  RE: Simple custom SOAP Processor Example - Echo a soap request message

    Posted Wed December 27, 2006 06:45 PM

    IS 7.1 will have a new component called a web services desriptor that will include much of the functionality of my custom soap processor design. We’ll all have to wait until Summer 2007 to find out more.

    Sure, you can post your IS as ESB questions here.

    Mark


    #webMethods
    #API-Management
    #soa