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.

 View Only
Expand all | Collapse all

Multiple clients with different encoding/contenttype

  • 1.  Multiple clients with different encoding/contenttype

    Posted Wed January 26, 2011 01:21 PM

    One of the flow services is having the below steps:

    1. pub:xml:documentToXmlString → Set encode = true
    2. pub:flow:setResponse → content_type “text.xml”

    Returns the string that is prepared in step 2.

    From the client perspective, this works if HTTPClient is used.
    But some of our services are using java API to call this flowservice. when this flow service is called from Java, I am receiving Null.
    If I change encode = false and not set content_type, then from java I am able to receive. But I can’t change the code since some consumers are using
    HTTPClient. So what is the best approach to this scenario. I don’t want to duplicate the code and change these params just for another client.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Multiple clients with different encoding/contenttype

    Posted Wed January 26, 2011 06:04 PM

    encode=true has nothing to do with the issue. You should leave that as true.

    For content-type, the correct value is text/xml, not text.xml. But perhaps that was a typo in your post?

    For clients using the IS Java API the service will need to return the XML string as an output parameter of the service.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: Multiple clients with different encoding/contenttype

    Posted Tue February 01, 2011 02:26 PM

    Thanks for the response. yes, that’s typo. I do return xml string as reponse.

    I use below steps to prepare my output response:

    1. pub:xml:documentToXmlString → Set encode = true
    2. pub:flow:setResponse → content_type “text.xml”

    Result of step 1 is used to set the “response” variable in Step 2. But java call is not able to see the output where as HTTPClient can…


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: Multiple clients with different encoding/contenttype

    Posted Tue February 01, 2011 10:08 PM

    Yes, you’re returning it as a response to an HTTP client, not to a Java API client. The setResponse is for HTTP/FTP clients only.

    Declare an output variable on your service. Make sure it is populated on exit. The Java API caller will see it.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods