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

XML data coming as blank in service on IS via HTTPS post

  • 1.  XML data coming as blank in service on IS via HTTPS post

    Posted Tue October 09, 2012 05:42 PM

    Hi All,
    My vendor is trying to post a XML request string to my service on IS 6.5. We have exchanged the certificates and everything is fine. They come in and I see a hit on my IS, the input in the pipeline is string called as requestXML, nothing comes in it and it goes to catch block saying that xmldata cannot be null.

    com.wm.app.b2b.server.ServiceException: [ISS.0086.9091] Parameters xmldata, $filestream and $filedata are all missing. One of these must not be null.

    They say that they have set Content_type to text/xml and below is the snippet from thier client program:

    post.addRequestHeader(“Authentication”, “XYZ:ABC”);
    post.setRequestHeader(“Content-type”, “text/xml”);
    HttpClient httpclient = new HttpClient();

    There is an Execute ACL on my service and they have added the login credential for XYZ user in Authentication as above.
    They get Access Denied error, so I have removed the Execute ACL and changed it to Anonymous.

    Thats a different issue. First I have to crack why thier request is coming in as NULL or BLANK in my service.

    Could anyone please help?


    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: XML data coming as blank in service on IS via HTTPS post

    Posted Tue October 09, 2012 05:59 PM

    What is the service input set to in your receiving service end?

    Normally it should be node (object) for handling XML via HTTP requests.

    Test it out and xmlNodeToDocument should work fine:

    HTH,
    RMG


    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: XML data coming as blank in service on IS via HTTPS post

    Posted Tue October 09, 2012 06:29 PM

    The service input is not a node, but a simple string called as requestXML. Again, its not a node but a string.
    My first step in service is XMLStringToXMLNode.
    So I am expecting a string and not a node.

    There is another vendor that is using this same service and it works for them. I expect the XML string to come in requestXML string.


    #webMethods
    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB


  • 4.  RE: XML data coming as blank in service on IS via HTTPS post

    Posted Tue October 09, 2012 07:24 PM

    I know what the issue, this service was initially designed for one vendor, who posted a XML as string to the service. So the first step I have in my service is XMLStringToNode.
    But this new vendor now post the XML as node to the service. I tested by disbaling the XMLStringToNode and having the XMLNodeToDocument as first step and its working fine.

    Now how should the new client post, such that I get input as XML string and not as a node.
    The old client is already in production and i dont want to touch the code. I have to ask the new client to change the way it send the XML.

    Any thoughts?


    #webmethods-Protocol-and-Transport
    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: XML data coming as blank in service on IS via HTTPS post

    Posted Tue October 09, 2012 09:17 PM

    If you still want to use the one gateway service Yes you should request TP to send it similar to other TP sends it…Other option is create a separate service to handle the new TP and so forth:

    But in your initial setup did you ask TP’s to send requestXML string in the http request as argument?..thats why you are not seeing node object by default:

    HTH,
    RMG


    #webMethods
    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB


  • 6.  RE: XML data coming as blank in service on IS via HTTPS post

    Posted Tue October 09, 2012 10:03 PM

    Hi RMG,
    Thanks for the reply. TP1(from whom i am getting XML in string"requestXML") is already in production.
    TP2 is in test, so my preferable option is not to ask TP1 to chnage and ask TP2 to send the request as TP1(i.e in string “requestXML”, rather than in node).
    Other wise I have to go for code change. i was looking for more option where TP2 would just post the XML and i would come in pipeline in “requestXML” string rather than “node” object.

    I confirmed with TP2 and they said that they are posting XML as string and Content-Type as “text/xml”

    What if they change the Content-Type to “text/plain”? Will the data posted to my service come in “requestXML” string?

    What do i have to do?


    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB
    #webMethods


  • 7.  RE: XML data coming as blank in service on IS via HTTPS post

    Posted Tue October 09, 2012 10:10 PM

    What if they change the Content-Type to “text/plain”? Will the data posted to my service come in “requestXML” string?

    Nope

    First from TP1 did you check how they are sending as string “requestXML” named?

    What ever TP2 is sending in right fashion and appropriate at receiving end:

    If possible can TP2 send requestXML string as an argument if that works for you?

    HTH,
    RMG


    #webMethods
    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB


  • 8.  RE: XML data coming as blank in service on IS via HTTPS post

    Posted Tue October 09, 2012 10:22 PM

    I didnt check with TP1. Let me check how are they posting the XML and get back to this thread.


    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB
    #webMethods


  • 9.  RE: XML data coming as blank in service on IS via HTTPS post

    Posted Tue October 09, 2012 10:35 PM


  • 10.  RE: XML data coming as blank in service on IS via HTTPS post

    Posted Tue October 09, 2012 11:19 PM

    I have checked with TP1 and they said that this is how they are posting the XML

    HTTPRequest::https://XX.XX.XX.XX/invoke/Sample.Services:SampleService::GET::requestXML:<?xml version="1.0" encoding="UTF-8"?>

    .
    .
    .

    .
    .
    ::


    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB
    #webMethods


  • 11.  RE: XML data coming as blank in service on IS via HTTPS post

    Posted Wed October 10, 2012 02:51 PM

    YES they are sending as argument with ? after

    Pl check with your TP2 also and make sure they are OK with sending request same way:

    HTH,
    RMG


    #webMethods
    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport


  • 12.  RE: XML data coming as blank in service on IS via HTTPS post

    Posted Wed October 10, 2012 06:39 PM

    CAn some one please send a smaple JAVA code on how to send POST XML to HTTP URL using arguments(name-value pair)

    So like in my case requestXML should be assigned the below XML:

    requestXML:<?xml version="1.0" encoding="UTF-8"?>


    .
    .
    .

    .
    .
    .

    ::
    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport
    #webMethods


  • 13.  RE: XML data coming as blank in service on IS via HTTPS post

    Posted Wed October 10, 2012 07:53 PM

    BTW,You can test this via client:http service itself right? or you want to share JS with your TP and request the same?

    There is no need to reinvent the wheel when out of box provided:

    Pl do a google search for java code you might get help:


    #Integration-Server-and-ESB
    #webMethods
    #webmethods-Protocol-and-Transport


  • 14.  RE: XML data coming as blank in service on IS via HTTPS post

    Posted Fri October 12, 2012 02:07 AM

    Name/value pair wouldn’t be via POST. It is a GET.

    What is the insistence on getting the variable name “requestXML” to your service? The IS content handler does the XMLStringtoNode conversion for you automatically when the POSTed content type is text/xml or application/xml. What’s driving you to want the string?


    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB
    #webMethods


  • 15.  RE: XML data coming as blank in service on IS via HTTPS post

    Posted Fri October 12, 2012 02:50 PM

    He is getting node object from TP2 while content-type is text/xml and which is expected but sounds their request to TP1 to send requestXML per their initial design may be they support only GET who knows:)


    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport
    #webMethods


  • 16.  RE: XML data coming as blank in service on IS via HTTPS post

    Posted Mon October 15, 2012 09:31 AM

    you can check if “node” object is present in the service pipeline; if present then skip pub.xml:xmlStringToXMLNode service invoke step.


    #Integration-Server-and-ESB
    #webMethods
    #webmethods-Protocol-and-Transport


  • 17.  RE: XML data coming as blank in service on IS via HTTPS post

    Posted Mon October 15, 2012 02:42 PM

    The issue is he is expecting requestXML string in the pipeline:) which is not the standard handling they are using:


    #webMethods
    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport


  • 18.  RE: XML data coming as blank in service on IS via HTTPS post

    Posted Mon October 15, 2012 04:12 PM

    got that. but to get XML String in pipeline, the partner must send the name-value pair with Content-Type text/plain (text/xml will get converted to “node” by IS contenthandler).
    i’m just thinking to skip the XMLStringToNode step if the node is already available in pipeline, which will be the case for http post with content-type text/xml.


    #webMethods
    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB


  • 19.  RE: XML data coming as blank in service on IS via HTTPS post

    Posted Mon October 15, 2012 04:51 PM

    YES they are sending as an argument via GET from TP1 but TP2 via POST:


    #webmethods-Protocol-and-Transport
    #webMethods
    #Integration-Server-and-ESB


  • 20.  RE: XML data coming as blank in service on IS via HTTPS post

    Posted Fri January 04, 2013 04:02 AM

    This would mean a change to the service already in Production, a quick n dirty solution is to whip up a 2 second wrapper service that merly converts from the xml node to xml string then invokes the Production service which is expecting the string.


    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport
    #webMethods


  • 21.  RE: XML data coming as blank in service on IS via HTTPS post

    Posted Fri January 04, 2013 03:25 PM

    What ever dirty solution as long as it works for you that is fine :slight_smile:


    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB
    #webMethods