Handling SOAP HEADER using SOAP Receiver Adapter

Hi Experts,
I need to implement SOAP Receiver Scenario and passing ( Header fields  User, Password and token)  I have seen a lot of scenario using a XSLT Mapping, to handling the SOAP Header. So  need to help to understand some details:
Suppose I need to implement the SOAP Header below? In this case I need add only the fields u201CUsername, Password and AuthenticationTokenu201D. I created the XSLT Transform, the source XML? Where I put it? Or can create it into Message Interface?
Is it possible to do this in Java Mapping?
Thanks!
Best Regards
Fábio Ferri
<soap:Header>
      <v1:ExecutionHintHeader>
         <v1:Name></v1:Name>
         <!Optional:>
         <v1:Arguments>
            <!1 or more repetitions:>
            <v1:Argument Name="?" Value="?"/>
         </v1:Arguments>
      </v1:ExecutionHintHeader>
      <v1:CredentialsHeader>
         <!Optional:>
         <v1:Username>pi</v1:Username>
         <!Optional:>
         <v1:Password>jhjhjjhjhjius</v1:Password>
         <!Optional:>
         <v1:AuthenticationToken></v1:AuthenticationToken>
      </v1:CredentialsHeader>
   </soap:Header>

You need to put XSLT mapping in 2° step mapping in request.
SourceMessageRequest -> Message Mapping -> XSLT Mapping -> DestinationMessageRequest
If you test mapping program, this should be working fine.
In adapter module, put localejbs/AF_Modules/MessageTransformBean with parameter value text/xml; charset=utf-8 and correctly set Conversion Parameter "Do not use Soap Envelop"
XSLT Request Mapping
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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">
<soap:Header>
<ServiceAuthHeader  xmlns="http://WIND.WEBSERVICES.DMS/">
<Username>USER</Username>
<Password>PASSWORD</Password>
</ServiceAuthHeader>
</soap:Header>
<soap:Body>
<xsl:copy-of select="*"/>
</soap:Body></soap:Envelope>
</xsl:template>
</xsl:stylesheet>

Similar Messages

  • How to generate soap header using java code

    Hi,
    I need to generate the following soap header using java DOM.
    Can you send me some java code snippet to do so?
    <soapenv:Header>
    <api:RequesterCredentials soapenv:mustUnderstand="0" xmlns:api="urn:ThinkPod:api:ThinkPodAPI" xmlns:ebl="urn:ThinkPod:apis:eBLBaseComponents">
    <ebl:ThinkPodAuthToken>YourToken</ebl:ThinkPodAuthToken>
    <ebl:Credentials>
    <ebl:DevId>YourDevId</ebl:DevId>
    <ebl:AppId>YourAppId</ebl:AppId>
    <ebl:AuthCert>YourAuthCert</ebl:AuthCert>
    </ebl:Credentials>
    </api:RequesterCredentials>
    </soapenv:Header>

    You want to generate that on a mobile device or how is that related to CLDC and MIDP?

  • How to bind soap header using jax-rpc

    To Whom It May Concern:
    I am using Rad7, Ibm Websphere 6.1, on Windows XP.
    I created an SoapHeader first using a string and bind it using jax-ws.
    It works for jax-ws but unfortunately, my work services uses jax-rpc.
    Does anybody know how to bind the soap header using jax-rpc.
    Any help or hint would be greatly appreciated it.
    Here is my code:
    import org.apache.cxf.headers.Header;
    import org.apache.cxf.headers.Header.Direction;
    import org.apache.cxf.helpers.DOMUtils;
    import org.apache.cxf.binding.soap.SoapHeader;
    import javax.xml.namespace.QName;
    import java.io.StringReader;
    import java.util.List;
    import java.util.ArrayList;
    import javax.xml.ws.BindingProvider;
                   @Test
         public void testService() throws Exception {     
                   try
                        URL wsdlURL = new URL("http://localhost:9087/abc/services/ServiceABCService");
                        ServiceRequestServiceService service = new ServiceRequestServiceServiceLocator();
                        ServiceRequestService port = service.getServiceRequestService(wsdlURL);
                   //How to Add Soap Header using jax-ws
              String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?><ABCHdrRq "
              + "xmlns=\"http://xmlns.ABCgc.net/ABC/2002/header/\" "
              + ">"
              + "<version>1.0</version><srcInfo><chType>abc</chType><chInst>0124</chInst>" +
                        "<appName>sSAR</appName><hostName>DW70210521</hostName><userId>fxue</userId>" +
                        "</srcInfo><startTimeStamp>2010-06-04T13:44:45.132</startTimeStamp><clientDt>2010-06-04T13:44:53.242</clientDt><serviceInfo><serviceName>ServiceRequestService</serviceName>" +
                        "<serviceFunc>addServiceRequest</serviceFunc></serviceInfo>" +
                   "<prevTransInfo><prevRqUID>BORS2010-06-04T13:41:10.2067f9368d1-8c5c</prevRqUID>" +     
                   "<prevRespTimestamp>2010-06-04T13:41:10.871</prevRespTimestamp>"+
                   "<prevRespEndTimestamp>2010-06-04T13:41:10.902</prevRespEndTimestamp>+</prevTransInfo>"+
                   "</ABCHdrRq>";
              SoapHeader dummyHeader1 = new SoapHeader(new QName("uri:http://xmlns.ABCgc.net/ABC/2002/header/", "ABCHdrRq"),
              DOMUtils.readXml(new StringReader(xml)).getDocumentElement());
              dummyHeader1.setDirection(Direction.DIRECTION_OUT);
              List<Header> headers = new ArrayList<Header>();
                   headers.add(dummyHeader1);
                   ((BindingProvider)port).getRequestContext().put(Header.HEADER_LIST, headers);
                   //How to Add Soap Header to the request using jax-ws
                   catch(Exception e)
                        System.out.println("Exception message:"+e.getMessage());
    Yours,
    Frustrated

    Well, how an attachment is processed depends on your application logic...if your application logic requires to processing attachments and verify it before processing the SOAP message, handlers could be better option.
    If you need to process the attachment while processing the SOAP message, you can do it in the service implementation class.
    In both the cases you need to get access to SOAPMessage object and from there get the attachments with getAttachments method.

  • HTTPS communication using HTTP receiver adapter URL address as Address Type

    Hi All,
    If some one who has tried HTTPS communication using HTTP receiver adapter using URL address as Address type can you please guide me what are the steps need to be done.
    Note : Address type is a parameter in HTTP adapter setup .
    Regards,
    Reddy

    Hi,
    Check this,
    Configurations in Integration Directory
    The plain HTTP adapter gives the receiver system the following specifications:
    &#151; Specifications for addressing using a URL address:
    Target host, service number, and path prefix including query string:
    http://<hostname:port>/<path>?<query-string>
    You can identify the target host (HTTP port) of a SAP Web Application Server using
    the
    ICM monitor
    Host and port of the HTTP proxy (optional if there is a firewall between the plain
    HTTP adapter and the receiver system)
    Authentication data for the receiver system.
    See also: transaction Display and Maintain RFC Destinations (SM59).
    &#151; Specifications for addressing using an HTTP destination:
    HTTP destination
    &#151; Parameters from the communication channel for technical routing
    Content type (the entry text/XML is expected as default)
    Specifies the format that the message contents (the payload) should have.
    Optional header fields for the receiver-specific protocol
    Attributes for the query string
    1. Sender party
    2. Sender service
    3. Receiver Interface
    4. Message ID
    5. Quality of service
    6. Queue ID
    All attributes are selected except for the queue ID. If you do not want a value to be
    transferred to the receiver, deselect it. The queue ID is only required if the quality of
    service is EOIO.
    Specifications for payload manipulation
    XML code (default UFT-8)
    Specifies the character set.
    URL escaping
    Presents the XML in a URL-enabled format. Special characters that could be
    interpreted as control characters are replaced with escape characters (masked).
    Prolog
    Enhances the payload for particular servers (optional, see below).
    Epilog
    Enhances the payload for particular servers (optional, see below).
    Enhancing the Payload
    Regards
    Seshagiri

  • Error while updating database using jdbc receiver adapter

    Hi All,
    I am trying to update a single record using jdbc receiver adapter.
    This is my the message that is getting created..
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:Data xmlns:ns0="urn:Test">
    - <STATEMENT>
    - <TABLENAME ACTION="UPDATE_INSERT">
      <TABLE>ORDERS</TABLE>
    - <ACCESS>
      <OrderID>99999</OrderID>
      <CustomerID>VICTE</CustomerID>
      <EmployeeID>3</EmployeeID>
      <ShipAddress>VICTE</ShipAddress>
      </ACCESS>
    - <KEY>
      <OrderID compareOperation="EQ">99999</OrderID>
      <ShipAddress compareOperation="EQ">VICTE</ShipAddress>
      </KEY>
      </TABLENAME>
      </STATEMENT>
      </ns0:Data>
    But in Adapter Monitoring i am getting the following error..
    <i>Error while parsing or executing XML-SQL document: Error processing request in sax parser: Error when executing statement for table/stored proc. 'ORDERS' (structure 'STATEMENT'): java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'VICTE'.</i>
    Regards,
    Rahul

    Rahul,
    > In this case i believe the interface has to be synch.
    > So what will the response message type be like..
    Not necessary. UPDATE can be asynch as well.
    Can you turn the trace on like pointed by Michal and then you can see the Query in the Audit Log of the adapter montioring. Try to execute the same query from your DB Client like TOAD and see what is the Syntax error you are getiing.!
    The problem looks like some field has some dataype / column name mismatch.
    Regards
    Bhavesh

  • Encrypt Data using File Receiver Adapter

    Dear All,
    How to encrypt file content using file receiver adapter?
    Any suggestions would be of great help.
    Thanks and Regards
    Bhasker

    Hi,
    U can also develop custom adapter module code. For more reference plz have a look:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0ac06cf-6ee2-2c10-df98-e17430ca5949?quicklink=index&overridelayout=true
    Re: Encyprtion in XI.
    Thanks
    Amit

  • How many messsages can we insert using JDBC receiver adapter in to DB

    Hi Friends,
    We are having 30 JDBC receiver interfaces in my current implementation project; load of JDBC receiver interfaces was 50 k messages per day and Performing only INSERT operation on data base.
    We have created individual communication channel for every JDBC receiver interface and max concurrency value set in CC was 5.
    Now we are testing all interfaces in quality with all possible cases, but we found that JDBC receiver adapter unable to process 50 k messages per day, we are on PI 7.1 EHP1 SP7.
    Please share your experiences with JDBC adapter receiver like per day how many messages we can transfer.
    Thanks a Ton,
    Raj

    Raja Sekhar Reddy T wrote:
    we are processing 50 k individual messages.
    >
    > I have increased max threads for JDBC receiver to 20 but no luck same rate only . My questions here is how many messages we can trasfer using JDBC receiver adapter?
    >
    > Regards,
    > Raj
    Hi raj,
    I have seen some interfaces that deal with upload of 5000 rows at a rime.. I don't there will be a restriction in the no of messages that can be transferred using the JDBC adapter as such  unless until the requirement is so para-normal and in your case it is not
    Kind regards
    XA

  • Executing Select query using JDBC Receiver Adapter

    I created couple types in Oracle and also new function instead of procedure
    Can I execute the above query using JDBC Receiver Adapter.
    select *
    from  the ( select cast( apr.get_distribut('', '', '', 'hdfcgd', 'CAN') as dsrTable )
             from dual );
    If possible how my message structure should look like...

    Hi vikram,
       If you use JDBC as Receiver Adapter you can only post the data to the data base I do no think so we can select the records from the data base.
       If you use JDBC as Sender hope,we can the select query in the sender communication channel.
        Hope I am clear.
      Thanks and Regardds,
      Chandu.

  • Soap testing Using Soap UI ?

    Hi Experts,
    Will please can any one tell me
    how to test soap scenarios using soap UI Tool...?
    Thanks in Advance
    Regards,
    Ravi

    Hi Ravi,
    Not exactly sure what do you mean by clear screens.
    Please check below simple approach which explains how you can create project for your WSDL and test it.
    As shown below, double click on request and you will be able to see its structure at right hand side.
    Once you submit the request you will get response in the same window.
    Hope this is helpful .
    Regards,
    Pranil.

  • SOAP Header in SOAP Receiver adapter

    Hi All,
    I am doing a Proxy to  Webservice scenario where webservice requires the SOAP request as below.
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
        <SOAP-ENV:Header>
            <mh:CustomHeader xmlns:mh="http://schemas.test.com/customHeader">
                <mh:MessageData>
                    <mh:MessageId>12345</mh:MessageId>
                    <mh:Timestamp>2004-06-09T14:41:44Z</mh:Timestamp>
                </mh:MessageData>
            </mh:CustomHeader>
            <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext">
                <wsse:UsernameToken>
                    <wsse:Username>test</wsse:Username>
                    <wsse:Password>test123</wsse:Password>
                </wsse:UsernameToken>
            </wsse:Security>
        </SOAP-ENV:Header>
        <SOAP-ENV:Body>
        </SOAP-ENV:Body>
    Need your help to understand how can we achieve this using Standard SOAP adapter to customize the Header part as it requires to include "<mh:CustomHeader " & "UsernameToken".
    Or Do i need to go for adapter module development to create this SOAP request.
    Please provide your suggestion to achieve this scenario.
    Thanks & regards
    Ashwin
    Edited by: ashwin dhakne on May 17, 2010 5:32 PM

    Hi all,
    Created  a below target payload in a message mapping with  SOAP Header & Body part as per the requirement.
    In SOAP receiver communication channel, checked the option " Do Not Use SOAP Envelope".
    But while executing an sceanrio, i am facing  an error in SOAP receiver channel as Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 500 Internal Server Error
    And if i don't check the option " Do Not Use SOAP Envelope" it gives an error as
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: Unable to obtain service binding,error=Payload Envelope is not a known message for TestWebserviceService.
    Please provide your suggestions to handle this issue.
      <?xml version="1.0" encoding="UTF-8" ?>
    <ns1:Envelope xmlns:ns1="http://schemas.test.com/CustomrHeader">
    <ns1:Header>
    <ns1:CustomrHeader>
    <ns1:MessageData>
      <ns1:MessageId>Constant</ns1:MessageId>
      <ns1:Timestamp>Constant</ns1:Timestamp>
      </ns1:MessageData>
    <ns1:Security>
    <ns1:UsernameToken>
      <ns1:Username>Constant</ns1:Username>
      <ns1:Password>Constant</ns1:Password>
      </ns1:UsernameToken>
      </ns1:Security>
      </ns1:CustomrHeader>
      </ns1:Header>
    <ns1:Body>
    <ns1:Details>
    <ns1:Information>
      <ns1:Title>Test</ns1:JobTitle>
      </ns1:Information>
    <ns1:Contacts>
      <ns1:Street>Test Drive</ns1:Street />
      </ns1:Contacts>
      </ns1:Details>
      </ns1:Body>
      </ns1:Envelope>
    Thanks
    Ashwin
    Edited by: ashwin dhakne on May 18, 2010 5:47 PM
    Edited by: ashwin dhakne on May 18, 2010 5:48 PM
    Edited by: ashwin dhakne on May 18, 2010 5:48 PM

  • Overriding Soap Header using Axis(SOAP) Receiver

    Hi Experts,
    I am having a problem in including the SOAP Header in the XML using the SOAP Axis Receiver Adapter. Well I am not sure on how to place this structure in the header:
    <SoapHeader>
        <Header1>
            <child1>
            <child2>
        </Header1>
        <Header2>
            <child1>
            <child2>
        </Header2>
    </SoapHeader
    I have already tried overriding the SOAP Header via Java Mapping but it is not working when I send it to the third-party. I believe this header should be directly encoded using the axis module, but I can only find examples for simple headers and not nested ones...
    Please help.
    Edited by: Mark Dihiansan on Sep 7, 2010 5:15 PM

    Hi,
    you simply place your header template in the handler configuration. If you need to set some values of the header dynamically, you can pass each value in the dynamic configuration header. The axis handler will fill the header with the supplied values.
    The Axis Note 1039369 describes a few header insertion examples that you should look at.
    regards, yza

  • Is it possible to call a SOAP webservice using HTTP POST adapter

    Hello Experts,
    Is it possible to call a webservice using a HTTP adapter with POST method? If yes, how?
    Regards,
    Diptee

    No this will not work since you have additional SOAP information (i.e. SOAP envelope, security information) in addition to the payload. If you need a simple HTTP-Post for example, then you don't need SOAP, you can use the more simple http protocol without the additional features of SOAP.
    Also refer to this link for differences: Difference b/w SOAP and HTTP

  • HTTP UPLOAD using HTTP receiver adapter

    Hello Experts,
    I am facing a problem where i have to upload a file to webserver using POST , I am using a file adapter to pick the file and http or soap adapter to post the file to webserver. Here the request structure expected by the webserver is a file.
    below is the form based web request:
    <form enctype="multipart/form-data" name="Upload_File" method="POST" action="https://-------/servlet/zxcdsf">
    Choose File:  <input type=file name="Upload_File" value="fileUpload" ><br><br>
    <input type=submit value="upload">
    </form>
    Please guide me how to achieve this using SOAP or HTTP.

    Hi Hemant
    Yes you can try with proglog and epilog
    Develop the Java mapping to convert the paylaod to HTML tags and replace the tags with corresponding (&, +, =, and %) . This may be able to post the data.
    Try to create generic mapping to convert the payload to HTML this will help if you have more than one interface for the same requirement.
    Java proxy code is having an advantage that you can always have that as a receiver for any of these request instead of dealing with individual Java mappings.
    Try with epilog and prolog and as you said next step can be Java proxy.
    Thanks
    Gaurav

  • OSB: Attach SOAP Header for SOAP Fault

    Hi,
    Is there a way to return OSB SOAP Fault with custom SOAP Header?
    Currently, when SOAP Fault happens, SOAP Header is not returned. I would like to insert some elements in the SOAP header and return when SOAP Fault happens.
    Thanks.

    Hi Eric,
    Thanks for your tips. It was helpful!
    I've managed to insert custom SOAP header to a SOAP fault.
    In service error handler,
    1. Construct custom header and replace header variable content
    2. Replace body content with fault variable
    3. Reply with failure
    Thanks.

  • Error while using Jdbc receiver adapter

    Hi,
    Iam using a receiver jdbc adapter to update a table in my database.Here iam using 'UPDATE' as my action in the mapping.It is giving the foowing error....
    Error while parsing or executing XML-SQL document: Error processing request in sax parser: No 'action' attribute found in XML document (attribute "action" missing or wrong XML structure)
    Can Please anybody tell me what may be the problem with my scenario...
    Thanks & Regards,
    Radhika.

    Hi ,
         action type should be attribute .  Please go through the following structure for update .
    <b>
       <?xml version="1.0" encoding="UTF-8"?>
    <ns1:MT_RESPONSE xmlns:ns1="http://com/Test">
       <STATEMENT_NAME>
          <TABLENAME action="UPDATE">
             <TABLE>Utility</TABLE>
             <access>
                <Updated_On/>
             </access>
             <key>
                <TrnHisID/>
             </key>
          </TABLENAME>
       </STATEMENT_NAME>
    </ns1:MT_RESPONSE></b>
              query for above we may say as
    <b>UPDATE  Utility set  Updated_On='' where  TrnHisID =''</b>
              Hope it helps
    Regards.,
    V.Rangarajan

Maybe you are looking for