Sending parameters through SOAP header

Hi all..
Iam using web services model in my web dynpro application. How will i send some paramters/info in SOAP header??

Hello Sujesh,
In your last thread of SOAP Headers I tried to paste the link containing some information on it's usage, but today when i navigated to the link it took me to different location , so the below message
The SOAP Headers Protocol
Definition
In some scenarios, the client may need to add SOAP headers to the request. This can be done using the SOAP headers protocol, which can be accessed by SOAP Web services. This protocol is not available to Web services with HTTP GET or POST bindings.
The SOAP headers protocol is a client runtime plugin located in com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.SoapHeadersProtocol.
Use
To get an instance of the protocol, use:
SoapHeadersProtocol headers = (SoapHeadersProtocol) ((BaseGeneratedStub) client)._getGlobalProtocols().getProtocol("SoapHeadersProtocol");
Structure
The Service Endpoint Interface (SEI) is typecasted to BaseGeneratedStub, which exposes the internal plugin methods of the client:
com.sap.engine.services.webservices.jaxrpc.wsdl2java.BaseGeneratedStub
The basic methods of the SOAP headers protocol are as follows:
·        headers.setOutputHeader(new Name("urn:myuri.com","myHeader"),value) – With this method you can pass, as a value, any schema-derived element type that is generated by the proxy generator for your client or generic DOM element.
Remember that all header elements must be namespace-qualified and, if you use a schema-derived value, it must be declared by the schema element as follows:
<xs:element name="myHeader" namespace="urn:myuri.com" type=”tns:myType”/>
·        The methods for getting response headers are as follows:
¡        headers.getInputHeader(headerName:QName):Element – Returns the DOM element with the header content response
¡        headers.getInputHeader(headerName:QName,headerClass:Class):Object – Deserializes the schema-declared header in the response class
and once again the link http://help.sap.com/saphelp_nw04/helpdata/en/45/f957507cb343f78e818c50620ed5ca/frameset.htm
Good Luck,
Dharmi

Similar Messages

  • Passing Parameter through SOAP Header in ODIInvokeWebService

    How to pass parameters in SOAP Header in ODIInvokeWebService and not just in SOAP Body?
    Background:
    One of our web service provider expects certain parameters set in SOAP Header. Currently, ODIInvokeWebService allows to set parameters through SOAP (Request) Body and not through SOAP Header.
    How can we set and send parameters in SOAP Header when using ODIInvokeWebService. Can we set this in a request file. Any workaround?
    BTW is this a limitation in the tool. If yes, I am looking for a work around. I can setup a proxy service/servlet and re-route the request to the provider but I would like to know if there is a work that can be done easily through ODIInvokeWebService before I look for other options.
    Appreciate your help.
    Thank you.
    -Muthu

    Hi Muthu ,
    This is not supported by the ODIInvokeWS Tool.
    There are some ER logged against this and may be it will get implemented in ODI 11g
    Sutirtha

  • Username and password through SOAP header

    Hi Gurus
    I am developing web service model in webdynpro by consuming third-party WSDL. This third party web service expecting me to send the user name &password through SOAP header.
    Can any body tell me how to pass the username password through SOAP header using webdynpro model?

    Hi,
       In WD there's no direct way to access the SOAP message header. If the web service defines implicit headers in JAX-RPC then you have to use the setProperty methods of the javax.xml.rpc.Stub interface so that the JAX-RPC handler can retrieve these via the getProperty methods.
    Regards,
    Satyajit.

  • SOAP Header in web dynpro

    Hi,
    Iam using web service model. I have to send some parameters through SOAP header. How can i do this?? pls help.

    Hello Sujesh,
    There is a posibility to use SOAP Header if you are using PHP. If yes have a look at this link
    http://uk.php.net/manual/nl/function.soapheader-soapheader.php
    if no, sorry I have no clue.
    Regards,
    Dharmi

  • URLConnection problems(Sending parameters with URL)

    Guys i have some problems with sending parameters through URL using URLConnection class.
    That's my code:
    URL url = new URL("http://kiosk.homebank.kz:9090/default.asp?action=SaveContact&src=C_HOMEBANK&ClientId="+request.getParameter("ClientId")+
                        "&IdService="+request.getParameter("IdService")+
                        "&Contact="+URLEncoder.encode(request.getParameter("Contact"),"utf-8")+
                        "&Number="+URLEncoder.encode(request.getParameter("Number"),"utf-8")+
                        "&Work="+URLEncoder.encode(request.getParameter("Work"),"utf-8")+
                        "&Mobile="+URLEncoder.encode(request.getParameter("Mobile"),"utf-8"));
            URLConnection connection = url.openConnection();
            connection.setDoInput(true);
            connection.setDoOutput(true);I want just send these parameters without going to this link. How can i do it using URLConnection class? Help please!

    Try using this set method in the URL class (query is the parameters):
    protected void set(String protocol,
    String host,
    int port,
    String authority,
    String userInfo,
    String path,
    String query,
    String ref)

  • Pass additional parameter to SOAP header?

    We are using webservice datawindows to pass request xmls to call webservices. Additionally we use 'wsconnection' objects authenticationmode, username and password property to send information to SOAP header.
    Now we have to send one more value to SOAP header. This new value will be a string(like username).
    I checked the wsConnection properties and did not find anything which could be used. Can anyone please advise on it.

    If they constructed the web service correctly, the WSDL should include information on the custom header attributes you need to pass.  If it's there, any version of PowerBuilder 10.5.1 or later will provide a method you can call to pass it.
    Custom header support for .NET Web services

  • Sender SOAP adapter: get soap header data

    Hi,
    I've been going through various posts and blogs here on SDN + looked in the how to guide for SOAP adapter, but still find it quite difficult to actually find out how to do it. I've tried to follow recommendations seen, but it doesn't add up.
    So can someone please tell me how to get an element situated in the SOAP header of the request sent to XI via sender soap adapter?
    Let's for instance say the request looks like this:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
         <SOAP-ENV:Header>
              <SSN>1234567890</SSN>
         </SOAP-ENV:Header>
         <SOAP-ENV:Body>
              <event>
                   <elem1>data 1</elem1>
                   <elem2>data 2</elem2>
                   <elem3>data 3</elem3>
              </event>
         </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    How can I get the data in the SSN-header element at mapping time?
    I'm sure this can be done by using adapter modules as the first step adapter, but I prefer doing it at mapping time if possible.
    Best Regards,
    Daniel

    I solved it on my own now. My missing link was the fact that I'm using XMLSPY to send request and thus need to replace all '&amp;' with & in Connection Endpoint.
    Message was edited by:
            Daniel Engsig-Karup

  • Could not access SOAP header - sending sopa message using weblogic

    i am using saaj to send a SOAP message ,through weblogic, i am getting an error like below
    Could not access SOAP header
    what should i do for sending a soap message using weblogic

    You're going to have to provide many more details than that. If it's useful, you could go here and read all the documentation books covering web services.

  • Creating Custom SOAP header in the Sender soap scenario

    Hello Experts,
    Currently i have a SOAP to RFC scenario . In which in the request parameter i have single input parameter. But as per the requirement we need to have some xml parameters in the soap header .
    So i want the soap request looks like below,
    <?xml version="1.0"?>
    -<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    -<SOAP-ENV:Header>
    -<ns0:TestHeader xmlns:ns0="http://testcustomer.com">
    -<MessageDetails>
    <ServiceType/>
    <ServiceAction>String</ServiceAction>
    <MessageRole rtype=""/>
    -<MessageSource>
    <SourceName/>
    <SourceID idtype=""/>
    </MessageSource>
    -<MessageDestinations>
    -<MessageDestination>
    <DestinationID idtype=""/>
    <DestinationName/>
    </MessageDestination>
    </MessageDestinations>
    <Property Name=""/>
    </MessageDetails>
    </ns0:TestHeader>
    </SOAP-ENV:Header>
    -<SOAP-ENV:Body>
    -<m:MT_CERT_IP xmlns:m="http://mydzit.gov.sa/zakat">
    <INPUT1>102140000007</INPUT1>
    </m:MT_CERT_IP>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    Kindly let me know the steps, how can i achieve this ??
    I have referred the AddSOAPHeaderBean  module but still not received the needed output.
    Best Regards,
    Amit

    Hi Amit,
    My few cents.
    You have an example in Dimitri Sannen's blog Read SOAP header information doing the mapping with XSLT.
    Also, you have an other example like Dev Noronha suggestion, in William Li's blog How to Read SOAP Header Information
    Regards.

  • XI30 SPS16 - SOAP Sender Adapter - self-defined SOAP-Header

    Hi Folks!
    My scenario is that I have to send a synchronous SOAP message to an external receiving system which expects certain processing information in the SOAP header. That external system then synchronously sends back a response SOAP message to tell me the processing results of my request message.
    The How-To Guide SOAP Adapter says that for the request message I have to create the whole SOAP Envelope (SOAP Enevelope, Header and Body) on my own within the mapping and that I have to remove the SOAP header in the response message. Unfortunately this guide does not tell me how this can be realized.
    In other SDN threads I've read that this can be achieved by using XSLT mappings. Unfortunately I have never done this before and currently I have no clear idea how to do this. And to be honest: I am everything else than an XSLT expert (historically I'm coming from the ABAP part of SAP R/3).
    My plan is to create the request payload using the graphical mapping tool and to add an XSLT mapping as 2nd mapping to build the SOAP "overhead" around the payload.
    For the response my plan is to first use XSLT mapping to remove the SOAP "overhead" from the response message and then use the graphical mapping to handle the payload.
    Questions:
    1. Is this possible?
    2. How can I achieve this?
    3. Can anybody send me an XSLT mapping sample to create a SOAP envelope, header and body around the payload for the request message?
    4. Can anybody send me an XSLT mappping sample to remove the SOAP envelope, header and body around the payload for the response message?
    Because I'm everything else than an expert in XSLT mappings, some kind of a "click guide with samples" would be VERY GREAT!
    Thanx in advance to anybody who will help me!!! For real help maximum points are guaranteed.
    Regards,
    Volker
    mail: [email protected]

    Hi Volker,
    Try this XSLT code, chanfe the TODO part.. add the SOAP header part. Save it as .xsl. ZIP it and import it in the Imported archive. Please test it I have'nt test the code as I dont have a system access now.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <xsl:template match="/">
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Header xmlns="http://schemas.xmlsoap.org/soap/envelope/">
    --- TODO -
    </Header>
    <soap:Body>
    <xsl:copy-of select="*"/>
    </soap:Body></soap:Envelope>
    </xsl:template>
    </xsl:stylesheet>
    For the rest have a look at this thread
    SOAP Adapter: DO not use soap envelope
    Thanks,
    Prakash

  • How to send images through PI using SOAP adapter

    hi,
    Can anybody tell me how to send images through PI using SOAP adapter.
    Regards ,
    Loveena

    Hi Loveena,
    only as attachments of a SOAP message.
    Regards,
    Udo

  • How to send a signed SOAP message with additional HTTP Header fields

    Our Partner's integration requirements are that we send them asynchronous SOAP messages, that are digitally signed, and whose HTTP headers contains 5 or 6 additional header fields, of which 3 or 4 will need to be dynamically set during the message mapping.  I believe we can use the HTTP adapter for adding new fields to the HTTP header, but don't believe it supports signing.  I believe that the SOAP adapter supports signing, but I'm not clear on how to use it to add fields to the HTTP header.  What is the most straight-forward way to achieve both the signing of the message and the addition of the HTTP header values?
    Thanks,
    Kurt

    >>>What is the most straight-forward way to achieve both the signing of the message and the addition of the HTTP header values?
    Use Java mapping for both.
    1) Signing the message
    You can digitally sign the soap message using many standard api like WSS4j? or  refer Java XML signature API which comes in Jdk1.6.
    Refer these links
    WSS4J  -  http://ws.apache.org/wss4j/axis.html
    Java XML signature : http://java.sun.com/developer/technicalArticles/xml/dig_signature_api/
    2) >>whose HTTP headers contains 5 or 6 additional header fields, of which 3 or 4 will need to be dynamically set during the message mapping
    Use Dynamic configuration API to set the additional header fields during message mapping.

  • Using Message ID in the SOAP header (Sender)

    Hi Experts,
    The scenario is SOAP to IDoc.
    We have requirement to insert the Message ID in the SOAP header for avoiding duplicate messages from the SOAP client.
    Please note SOAP client is unable to support URL parameter, so we have to use Message ID in the SOAP header.
    So please suggest how to insert the Message ID in the SOAP header (WSDL) , and do we need to implement any mapping to retrieve the Message ID value from the SOAP header  - to create a PI message.
    Thanks in advance.
    MK

    But I want to know how we update the WSDL with the required Feild(messageID).
    I dont think you can update the wsdl url to include the messageID field...if you notice the other fields in the wsdl you will find all are static...however your messageID will be dynamic.....so just ask the SOAP client application to append the MessageId field and send the message.....at runtime the message id will be extracted by PI......did you test the scenario?...if no then test it once so that if there is an error we will come to know...
    Regards,
    Abhishek.

  • Soap Sender Adapter Preserve And Access Soap Header

    Hi,
    I would like to preserve the Soap Header created by a client and access it in a mapping using the the Soap Sender Adapter (SP16). Does anybody know how to do this?
    Kind regards,
    Heiko

    Hello Udo,
    I have found a solution to this problem. It is possible to add header entries to the DynamicConfiguration which is available by an API:
    soapMsg.append("<SOAP-ENV:Header>");
    soapMsg.append("<SAP:DynamicConfiguration xmlns:SAP=\"http://sap.com/xi/XI/Message/30\" xmlns:SOAP=\"http://schemas.xmlsoap.org/soap/envelope/\" SOAP:mustUnderstand=\"1\">");
    soapMsg.append("<SAP:Record namespace=\"http://sap.com/xi/XI/System/SOAP\" name=\"SRmsUser\">test</SAP:Record>");      
    This code snip shows Java client code to add an element to the SOAP header which corresponds to the DynamicConfiguration. In XI it will be accessable using the respective API.
    Cheers,
    Heiko

  • Web Services Test Page: No input fields for SOAP header parameters?

    Hello,
    we're using OracleAS / OC4J 10.1.3.1 and have developed a web service that has some self defined SOAP header parameters.
    I would like to use the Web Services Test Page provided by the OAS but it seems that there is no opportunity
    to provide input values for these SOAP header parameters.
    Do I miss something there or is it not supported by OAS?
    I've read the documentation but could not find a clue.
    any help is appreciated,
    Regards,
    Martin

    I hear you. As you have probably heard, OC4J is being replaced by WebLogic Server and the 10.1.3.x releases are the last that will be produced. We'll do maintenance on it of course, but little/no new feature work. This would be a new feature we'd have to add, so I'm afraid there's not much chance in having it done.
    It's not ideal, and of course more work for you, but if you want to provide your client with a test page that exposes the SOAP headers as form fields, you could always develop and ship one yourself.
    -steve0

Maybe you are looking for