webMethods

webMethods

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

Adding Header in SOAP Request

  • 1.  Adding Header in SOAP Request

    Posted Fri April 22, 2016 05:30 PM

    Hi All,

    I am working on wM 9.9 and facing an issue with setting the header in soap request.
    Client has shared their wsdl and we have created the connector in our server.

    When posting the data, we need to set the header element as well which is not coming in the input document.

    e.g.
    <soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:com=“http://www.xyz.com” >
    soapenv:Header
    ABC11
    </soapenv:Header>

    soapenv:Body
    <com:SalesOrderRequest >

    The structure I am getting is SalesOrderRequest present in body only.
    I am not sure how to set the header highlighted in RED above.

    Please guide.

    Thanks,
    Amit


    #webMethods
    #soa
    #API-Management


  • 2.  RE: Adding Header in SOAP Request

    Posted Sat April 23, 2016 01:12 AM


  • 3.  RE: Adding Header in SOAP Request

    Posted Mon April 25, 2016 07:18 PM

    try public service:
    WmPublic/pub.soap.handler:addHeaderBlock


    #soa
    #API-Management
    #webMethods


  • 4.  RE: Adding Header in SOAP Request

    Posted Wed April 27, 2016 05:35 AM

    Thanks Guys for the response.

    Was able to create soap data and post it over HTTP using soap handler services.
    Please refer below screenshot for sample code.

    Thanks,
    Amit
    SoapHTTP.JPG


    #webMethods
    #soa
    #API-Management


  • 5.  RE: Adding Header in SOAP Request

    Posted Mon November 28, 2016 09:27 PM

    Hello Guys,

    I am trying to do same thing our friend Amit has accomplished.
    However, I generated my consumer based on WSLD. It turns out that, it added pub.client:soapClient.

    I am not sure how to generate the same soap header attribute:

    soapenv:Header
    ABC11
    </soapenv:Header>

    Perhaps, the lack of knowledge about the tool makes me little bit confused.

    Can you please advise me,

    Regards


    #webMethods
    #soa
    #API-Management


  • 6.  RE: Adding Header in SOAP Request

    Posted Sun January 20, 2019 12:42 AM

    Hey Amit,

    Would you be able to let me know how did you format your SOAP data as input to these services.

    I tried to do the same but values are not properly being formatted as SOAP message

    Is it possible for you to send the sample code.Your response would behighly appreciated.

    Thanks,
    Arun Cholleti.


    #webMethods
    #API-Management
    #soa


  • 7.  RE: Adding Header in SOAP Request

    Posted Mon January 21, 2019 05:47 AM

    Hi guys,

    I did a couple of posts some time ago that might help you:

    They have screenshots and also attached resources (IS packages).

    Give them a look.


    #soa
    #webMethods
    #API-Management


  • 8.  RE: Adding Header in SOAP Request

    Posted Wed October 23, 2019 12:35 PM

    Hi ,

    I am facing similar issue while trying to add custom header .
    I am creating a consumer by importing the wsdl , but the header information is not part of the wsdl


    #API-Management
    #soa
    #webMethods


  • 9.  RE: Adding Header in SOAP Request

    Posted Wed October 23, 2019 01:52 PM

    Create a header handler service , register it and call it from Consumer WSD .

    You have information in this thread . or you can also refer the below mentioned thread as well .

    http://tech.forums.softwareag.com/techjforum/posts/list/57349.page


    #API-Management
    #webMethods
    #soa


  • 10.  RE: Adding Header in SOAP Request

    Posted Fri January 31, 2020 03:37 AM

    Hi Vlad,First I follwed your tutorial and downloaded attached package,when I implement the same,for request handler I’m facing an issue that when I checked it “outputHeaderBlock[0]/headerDocument” is coming empty from “pub.soap.handler:getHeaderBlock”, I have followed exactly as you described in your site,Please help me on this
    AAWS.zip (26.4 KB)


    #API-Management
    #soa
    #webMethods


  • 11.  RE: Adding Header in SOAP Request

    Posted Thu February 06, 2020 10:36 AM

    This was clarified offline.

    Basically the XML namespace was missing from the header document type.

    In case others have this problem. See attachment.


    #soa
    #API-Management
    #webMethods