Getting SOAP Header from Bytes

Hi,
I am fairly new to SAAJ. I have a MDB which is dequeing JMS BytesMessage. Below is the code piece:
    if (inMessage instanceof BytesMessage) {
                // retrieve the object
                msg = (BytesMessage)inMessage;
                byte load = msg.readByte();  
      ....             Now I want to be able to cast this byte to SOAP message and retrive the SOAP header say using SAAJ. Fyi, here is the beginning of my message
<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
     <soapenv:Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
          <wsa:MessageID>GES-6b05eb12e07804b6e54089beb6122767874ae</wsa:MessageID>
Could you please show me how to tackle this?
Thanks in advance,
Mustafa

I have had no problem calling an external web service from a JCD in 5.1.2 I have been able to access and set the fields of the header portion of this external web service as long as the WSDL for the web service has used an explicit header description. If the WSDL contains and implicit header (the header is described as a separate message) I have not been successful getting visibility to the header. See http://www.softwaresummit.com/2005/speakers/TostPracticalLessonsLearnedInWebServicesDesign.pdf pages 30 - 32 it has a nice summary about the difference for header descriptions. If CAPS is cooperating with you, you should be able to import the WSDL for the external web service, create a JCD that is going to call the web service, include the OTD for the web service in your JCD and then just follow the instructions in the eGate users guide to fire off the invoke of the web service.

Similar Messages

  • Get SOAP header information

    Dear,
    In our synchronous scenario SOAP <-> SAP PI <-> ABAP proxy, I face a problem reading the SOAP header from the incoming message.
    PI version used is 7.11
    This is how the incoming SOAP header looks like
    What I need is the content of field UserId.
    Already tried a lot and also ticked this option in the sender SOAP adapter: Do Not User SOAP Envelope.
    If I do that, I get an error saying premature end of file.
    Any lead is welcome.
    Thanks a lot!
    Dimitri

    Hi Dimitri,
    Have you tried to set a technical name in the ASMA attributes (Configuring the Sender SOAP Adapter (SAP Library - SAP NetWeaver Exchange Infrastructure) and later take this variable with the dynamic configuration during the mapping?
    I havent tried it, it's only an idea.
    Regards.

  • Extract SOAP Header from JMS Adapter PartnerLink

    Hi Chintan,
    I have next problem:
    I have a JMS queue. The message in this queue are "SOAP Message" with Body and SOAP Header.
    I have developed a "BPEL JMS service" with a JMS Adapter PartnerLink.I need extract SOAP Header from PartnetLink JMS Adapter, but with headerVariable into "Receive activity" it´s not work OK.
    Could anybody help me with this problems?
    Thanks a lot.
    Regards.

    HI,
    Try your luck at this link
    http://orasoa.blogspot.com/2007/09/using-custom-headers-in-bpel.html

  • Calling Web Service with SOAP header from BPEL

    Hi,
    I am calling a web service (with header information) from BPEL. In the Invoke activity, i created a header variable to pass the header information.
    But, when i test the BPEL service, invoke activity fails because the header information is not being passed.
    Below is the error message (copied from clipboard).
    +<messages><input><Invoke_1_getsubinfo_InputVariable><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="parameters"><getsubinfoElement xmlns="http://ws/its/tabs/webservices/SingleRowWS/SingleRowWS.wsdl">+
    +<pSubnoin>+
    +<insubno>12345678</insubno>+
    +</pSubnoin>+
    +</getsubinfoElement>+
    +</part></Invoke_1_getsubinfo_InputVariable></input><fault><bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>exception on JaxRpc invoke:+
    start fault message:+
    Internal Server Error (Caught exception while handling request: javax.xml.rpc.JAXRPCException: Not authenticated user)+
    *:end fault message*</summary>
    +</part></bindingFault></fault></messages>+
    As said, no header information is visible in the Invoke activity.
    Please provide help for the above issue.
    -MJ

    Hello Patrick,
    Thanks for the response. I am using normal assign activity to assign values to the header variable as shown below. HeadMT is the header variable which is passed in the invoke activity.
    +<assign name="Assign_Header">+
    +<copy>+
    +<from expression="'tkl12'"/>+
    +<to query="/ns1:LOGIN_INFO/ns1:USER_NAME" variable="*HeadMT*"+
    part="payload"/>
    +</copy>+
    +<copy>+
    +<from expression="'tkl123'"/>+
    +<to query="/ns1:LOGIN_INFO/ns1:PASSWORD" variable="*HeadMT*"+
    part="payload"/>
    +</copy>+
    +<copy>+
    +<from expression="'TKL'"/>+
    +<to query="/ns1:LOGIN_INFO/ns1:CHANNEL_ID" variable="*HeadMT*"+
    part="payload"/>
    +</copy>+
    +</assign>+
    The expected input by the web service is as below with the header information highlighted.
    +<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://ws/webservices/RowWS/RowWS.wsdl">+
    +*<soap:Header>*+
    +*<ns1:LOGIN_INFO>*+
    +*<ns1:USERNAME>tkl12</ns1:USERNAME>*+
    +*<ns1:PASSWORD>tkl123</ns1:PASSWORD>*+
    +*<ns1:CHANNEL_ID>TKL</ns1:CHANNEL_ID>*+
    +*</ns1:LOGIN_INFO>*+
    +*</soap:Header>*+
    +<soap:Body>+
    +<ns1:substatusElement>+
    +<ns1:pInparam>+
    +<ns1:insubno>7674988</ns1:insubno>+
    +</ns1:pInparam>+
    +</ns1:substatusElement>+
    +</soap:Body>+
    +</soap:Envelope>+

  • 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

  • Is there a way to get SOAP header in bpel?

    Hi,
    My web service returns a SessionID contained in the SOAP header. In Oracle PM, is there a way I could extract the SOAP header, or manipulate the SOAP header when invoking the web services? Any information would be appreciated.
    Thanks!
    Feng

    Edwin,
    I was trying your second approach, which utilizes the bpel extension to hold the header info, but with no luck.
    The provided sample (Salesforce Flow) works well, and I can see the SOAP header using TCPMonitor. Then I created a simple echo service (using bpel) to replace the Salesforce.com Enterprise Web Services, and invoke the echo service from a bpel process with the same bpel extension. However, no header was sent out.
    I guess there are something I was missing. Attached please find the wsdl file of the echo service, as well as the bpel files. Could you give me some idea what I did wrong? Or do you have any documentation about the bpel extensions?
    Thanks a lot for the good support!
    Feng
    echo.wsdl
    <?xml version="1.0"?>
    <definitions name="echo"
    targetNamespace="http://acm.org/samples"
    xmlns:tns="http://acm.org/samples"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    >
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    TYPE DEFINITION - List of types participating in this BPEL process
    The BPEL Designer will generate default request and response types
    but you can define or import any XML Schema type and use them as part
    of the message types.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <types>
    <schema attributeFormDefault="qualified" elementFormDefault="qualified"
    targetNamespace="http://acm.org/samples"
    xmlns="http://www.w3.org/2001/XMLSchema">
    <element name="echoRequest">
    <complexType>
    <sequence>
    <element name="input" type="string"/>
    </sequence>
    </complexType>
    </element>
    <element name="echoResponse">
    <complexType>
    <sequence>
    <element name="result" type="string"/>
    </sequence>
    </complexType>
    </element>
    <!-- Header Elements -->
    <element name="SessionHeader">
    <complexType>
    <sequence>
    <element name="sessionId" type="xsd:string"/>
    <element name="InvokeID" type="xsd:string"/>
    </sequence>
    </complexType>
    </element>
    <element name="QueryOptions">
    <complexType>
    <sequence>
    <element name="batchSize" type="xsd:int" />
    </sequence>
    </complexType>
    </element>
    <element name="SaveOptions">
    <complexType>
    <sequence>
    <element name="autoAssign" type="xsd:boolean"/>
    </sequence>
    </complexType>
    </element>
    </schema>
    </types>
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    MESSAGE TYPE DEFINITION - Definition of the message types used as
    part of the port type defintions
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <message name="echoRequestMessage">
    <part name="payload" element="tns:echoRequest"/>
    </message>
    <message name="echoResponseMessage">
    <part name="payload" element="tns:echoResponse"/>
    </message>
    <!-- Header Message -->
    <message name="Header">
    <part element="tns:SessionHeader" name="SessionHeader"/>
    <part element="tns:SaveOptions" name="SaveOptions"/>
    <part element="tns:QueryOptions" name="QueryOptions"/>
    </message>
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    PORT TYPE DEFINITION - A port type groups a set of operations into
    a logical service unit.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <!-- portType implemented by the echo BPEL process -->
    <portType name="echo">
    <operation name="process">
    <input message="tns:echoRequestMessage" />
    <output message="tns:echoResponseMessage"/>
    </operation>
    </portType>
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    PARTNER LINK TYPE DEFINITION
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <plnk:partnerLinkType name="echo">
    <plnk:role name="echoProvider">
    <plnk:portType name="tns:echo"/>
    </plnk:role>
    </plnk:partnerLinkType>
    </definitions>
    echo.bpel
    <!-- echo BPEL Process [Generated by the Oracle BPEL Designer] -->
    <process name="echo" targetNamespace="http://acm.org/samples" suppressJoinFailure="yes" xmlns:tns="http://acm.org/samples" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:bpelx="http://schemas.oracle.com/bpel/extension" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:cx="http://schemas.collaxa.com/xpath/extension">
         <!-- ================================================================= -->
         <!-- PARTNERLINKS -->
         <!-- List of services participating in this BPEL process -->
         <!-- ================================================================= -->
         <partnerLinks>
              <!-- The 'client' role represents the requester of this service. -->
              <partnerLink name="client" partnerLinkType="tns:echo" myRole="echoProvider"/>
         </partnerLinks>
         <!-- ================================================================= -->
         <!-- VARIABLES -->
         <!-- List of messages and XML documents used within this BPEL process -->
         <!-- ================================================================= -->
         <variables>
              <!-- Reference to the message passed as input during initiation -->
              <variable name="input" messageType="tns:echoRequestMessage"/>
              <!--
    Reference to the message that will be returned to the requester
    -->
              <variable name="output" messageType="tns:echoResponseMessage"/>
         </variables>
         <!-- ================================================================= -->
         <!-- ORCHESTRATION LOGIC -->
         <!-- Set of activities coordinating the flow of messages across the -->
         <!-- services integrated within this business process -->
         <!-- ================================================================= -->
         <sequence name="main">
              <!-- Receive input from requester.
    Note: This maps to operation defined in echo.wsdl
    -->
              <receive name="receiveInput" partnerLink="client" portType="tns:echo" operation="process" variable="input" createInstance="yes"/>
              <!-- Generate reply to synchronous request -->
              <assign>
                   <copy>
                        <from expression="concat('echo: ', bpws:getVariableData(&quot;input&quot;, &quot;payload&quot;, &quot;/tns:echoRequest/tns:input&quot;))">
                        </from>
                        <to variable="output" part="payload" query="/tns:echoResponse/tns:result"/>
                   </copy>
              </assign>
              <reply name="replyOutput" partnerLink="client" portType="tns:echo" operation="process" variable="output"/>
         </sequence>
    </process>
    bpel process that invokes the echo service
    <!-- testHeader6 BPEL Process [Generated by the Oracle BPEL Designer] -->
    <process name="testHeader6" targetNamespace="http://acm.org/samples" suppressJoinFailure="yes" xmlns:tns="http://acm.org/samples" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:bpelx="http://schemas.oracle.com/bpel/extension" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:cx="http://schemas.collaxa.com/xpath/extension">
         <!-- ================================================================= -->
         <!-- PARTNERLINKS -->
         <!-- List of services participating in this BPEL process -->
         <!-- ================================================================= -->
         <partnerLinks>
              <!-- The 'client' role represents the requester of this service. -->
              <partnerLink name="client" partnerLinkType="tns:testHeader6" myRole="testHeader6Provider"/>
              <partnerLink name="echo" partnerLinkType="tns:echo" partnerRole="echoProvider"/>
         </partnerLinks>
         <!-- ================================================================= -->
         <!-- VARIABLES -->
         <!-- List of messages and XML documents used within this BPEL process -->
         <!-- ================================================================= -->
         <variables>
              <!-- Reference to the message passed as input during initiation -->
              <variable name="input" messageType="tns:testHeader6RequestMessage"/>
              <!--
    Reference to the message that will be returned to the requester
    -->
              <variable name="output" messageType="tns:testHeader6ResponseMessage"/>
              <variable messageType="tns:echoRequestMessage" name="i2"/>
              <variable messageType="tns:echoResponseMessage" name="o2"/>
              <variable name="header" messageType="tns:Header"/>
         </variables>
         <!-- ================================================================= -->
         <!-- ORCHESTRATION LOGIC -->
         <!-- Set of activities coordinating the flow of messages across the -->
         <!-- services integrated within this business process -->
         <!-- ================================================================= -->
         <sequence name="main">
              <!-- Receive input from requester.
    Note: This maps to operation defined in testHeader6.wsdl
    -->
              <receive name="receiveInput" partnerLink="client" portType="tns:testHeader6" operation="process" variable="input" createInstance="yes"/>
              <!-- Generate reply to synchronous request -->
              <assign>
                   <copy>
                        <from expression="12345">
                        </from>
                        <to variable="i2" part="payload" query="/tns:echoRequest/tns:input"/>
                   </copy>
                   <copy>
                        <from expression="1111">
                        </from>
                        <to variable="header" part="SessionHeader" query="/tns:SessionHeader/tns:sessionId"/>
                   </copy>
              </assign>
              <invoke partnerLink="echo" portType="tns:echo" operation="process" inputVariable="i2" bpelx:inputHeaderVariable="header" outputVariable="o2"/>
              <reply name="replyOutput" partnerLink="client" portType="tns:testHeader6" operation="process" variable="output"/>
         </sequence>
    </process>

  • Can't get SOAP Header parameter

    I am developing web services for Web Logic 9.2 server using JWS annotation. I am getting the following error when I run the service. the error is in ServiceResponse. Both Service Request and ServiceResponse is as following:
    Service Request
    =================
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header>test </soapenv:Header>
    <soapenv:Body>
    <echoComplexType xmlns="http://example.org" xmlns:java="java:examples.webservices.complex">
    <struct>
    <java:IntValue>3</java:IntValue>
    <java:StringValue>string</java:StringValue>
    <!--Zero or more repetitions:-->
    <java:StringArray>string</java:StringArray>
    </struct>
    </echoComplexType>
    </soapenv:Body>
    </soapenv:Envelope>
    Service Response
    ================
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header />
    <soapenv:Body>
    <soapenv:Fault>
    <faultcode>soapenv:Server</faultcode>
    <faultstring>[Server CodecHandler] Failed to decode Unable to find xml element for parameter: struct1</faultstring>
    <detail>
    <bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0">weblogic.wsee.codec.CodecException: Unable to find xml element for parameter: struct1
    at weblogic.wsee.codec.soap11.SoapDecoder.checkNullElement(SoapDecoder.java:290)
    at weblogic.wsee.codec.soap11.SoapDecoder.decodeParams(SoapDecoder.java:234)
    at weblogic.wsee.codec.soap11.SoapDecoder.decodeParts(SoapDecoder.java:163)
    at weblogic.wsee.codec.soap11.SoapDecoder.decode(SoapDecoder.java:116)
    at weblogic.wsee.codec.soap11.SoapCodec.decode(SoapCodec.java:138)
    at weblogic.wsee.ws.dispatch.server.CodecHandler.decode(CodecHandler.java:138)
    at weblogic.wsee.ws.dispatch.server.CodecHandler.handleRequest(CodecHandler.java:39)
    at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:127)
    at weblogic.wsee.ws.dispatch.server.ServerDispatcher.dispatch(ServerDispatcher.java:85)
    at weblogic.wsee.ws.WsSkel.invoke(WsSkel.java:80)
    at weblogic.wsee.server.servlet.SoapProcessor.handlePost(SoapProcessor.java:66)
    at weblogic.wsee.server.servlet.SoapProcessor.process(SoapProcessor.java:44)
    at weblogic.wsee.server.servlet.BaseWSServlet$AuthorizedInvoke.run(BaseWSServlet.java:173)
    at weblogic.wsee.server.servlet.BaseWSServlet.service(BaseWSServlet.java:92)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3245)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    </bea_fault:stacktrace>
    </detail>
    </soapenv:Fault>
    </soapenv:Body>
    </soapenv:Envelope>
    The JWS source file is as following;
    package examples.webservices.complex;
    // Import the standard JWS annotation interfaces
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebResult;
    import javax.jws.WebService;
    import javax.jws.soap.SOAPBinding;
    // Import the WebLogic-specific JWS annotation interface
    import weblogic.jws.WLHttpTransport;
    // Import the BasicStruct JavaBean
    import examples.webservices.complex.BasicStruct;
    // Standard JWS annotation that specifies that the portType name of the Web
    // Service is "ComplexPortType", its public service name is "ComplexService",
    // and the targetNamespace used in the generated WSDL is "http://example.org"
    @WebService(serviceName="ComplexService", name="ComplexPortType", targetNamespace="http://example.org")
    // Standard JWS annotation that specifies this is a document-literal-wrapped
    // Web Service
    @SOAPBinding(style=SOAPBinding.Style.DOCUMENT,
                   use=SOAPBinding.Use.LITERAL,
                   parameterStyle=SOAPBinding.ParameterStyle.WRAPPED)
    // WebLogic-specific JWS annotation that specifies the context path and service
    // URI used to build the URI of the Web Service is "complex/ComplexService"
    @WLHttpTransport(contextPath="complex", serviceUri="ComplexService", portName="ComplexServicePort")
    /** * This JWS file forms the basis of a WebLogic Web Service. The Web Services
    * has two public operations:
    * - echoInt(int)
    * - echoComplexType(BasicStruct)
    * The Web Service is defined as a "document-literal" service, which means
    * that the SOAP messages have a single part referencing an XML Schema element
    * that defines the entire body.
    * @author Copyright (c) 2005 by BEA Systems. All Rights Reserved.
    public class ComplexImpl
         // Standard JWS annotation that specifies that the method should be exposed
         // as a public operation. Because the annotation does not include the
         // member-value "operationName", the public name of the operation is the
         // same as the method name: echoInt.
         // The WebResult annotation specifies that the name of the result of the
         // operation in the generated WSDL is "IntegerOutput", rather than the
         // default name "return". The WebParam annotation specifies that the input
         // parameter name in the WSDL file is "IntegerInput" rather than the Java
         // name of the parameter, "input".
         @WebMethod()
         @WebResult(name="IntegerOutput", targetNamespace="http://example.org/complex")
         public int echoInt(
              @WebParam(name="IntegerInput",
                        targetNamespace="http://example.org/complex")
              int input)
              System.out.println("echoInt '" + input + "' to you too!");
              return input;
         // Standard JWS annotation to expose method "echoStruct" as a public operation
         // called "echoComplexType"
         // The WebResult annotation specifies that the name of the result of the
         // operation in the generated WSDL is "EchoStructReturnMessage",
         // rather than the default name "return".
         @WebMethod(operationName="echoComplexType")
         @WebResult(name="EchoStructReturnMessage",
                   targetNamespace="http://example.org/complex")
         public BasicStruct echoStruct(BasicStruct struct,
                   @WebParam(name="struct1", targetNamespace="http://example.org/complex", mode=WebParam.Mode.IN, header=true)
                   BasicStruct struct1)
              System.out.println("echoComplexType called");
              return struct;
    BasicStruct.java
    package examples.webservices.complex;
    /** * Defines a simple JavaBean called BasicStruct that has integer, String, * and String[] properties */
    public class BasicStruct
         // Properties
         private int intValue;
         private String stringValue;
         private String[] stringArray;
         // Getter and setter methods
         public int getIntValue()
              return intValue;
         public void setIntValue(int intValue)
              this.intValue = intValue;
         public String getStringValue()
              return stringValue;
         public void setStringValue(String stringValue)
              this.stringValue = stringValue;
         public String[] getStringArray()
              return stringArray;
         public void setStringArray(String[] stringArray)
              this.stringArray = stringArray;
         public String toString()
              return "IntValue="+intValue+", StringValue="+stringValue;
    Any help is appreciated.
    Thanks in advance.
    Regards,
    Sanjay

    I am getting a similar error.
    Were you able to resolve this ?

  • Getting Soap Attachments from a Web Services Call

    Hi,
    We are using Studio Creator 2 and we need to connect to a web service that returns an attachment.
    We added the web service in the Servers/Web Services tab, and Creator created the Web Service Client jars automatically.
    The problem is that these classes that were produced does not seem to allow access to the attachment in the response (of the SOAP message).
    It appears that the classes that are generated hides the ability to get at the Soap body or message. Is there any way to get the attachment using the generated client classes, or do we have to create our own set of client classes to call the web service, and extract the attachment?
    Is there any sample code for Creator that calls a web service and then saves an attachment that is returned in the Soap message response?
    Thank you
    Matt

    Here is some general information with examples which you might find useful
    to solve your problem.
    Patterns and Strategies for Building Document-Based Web Services
    http://java.sun.com/developer/technicalArticles/xml/jaxrpcpatterns/index5.html

  • How to get DateTime from PI message SOAP Header

    Hi ALL
    Can you please let me know how we can get the time message received in PI from the SOAP message header
    <SAP:TimeSent>2010-08-17T16:24:16Z</SAP:TimeSent>
    I would like to capture this value and send it in the payload of the message, initially I was using the Current TIme date function.
    However, if I can get the time received value from the SOAP Header message, It will be more accurate in providing the Time the message was received by IE.
    Thank you,
    Parikshit
    Sample SOAP Header from MONI:-
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Call Adapter
      -->
    - <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SAP="http://sap.com/xi/XI/Message/30">
    - <SOAP:Header>
    - <SAP:Main xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" versionMajor="003" versionMinor="000" SOAP:mustUnderstand="1" wsu:Id="wsuid-main-92ABE13F5C59AB7FE10000000A1551F7">
      <SAP:MessageClass>ApplicationMessage</SAP:MessageClass>
      <SAP:ProcessingMode>asynchronous</SAP:ProcessingMode>
      <SAP:MessageId>4C69D4B7-9806-0162-E100-80000A8221E6</SAP:MessageId>
    <SAP:TimeSent>2010-08-17T16:24:16Z</SAP:TimeSent>
    - <SAP:Sender>

    If you want to get the TimeSent from SOAP header and map it to some field in ur message then u can easily do it using following UDF :-
    GlobalContainer globalContainer;globalContainer = container.getGlobalContainer();
    java.util.Map param = globalContainer.getParameters();.
    String timeSent = (String) param.get (StreamTransformationConstants.TIME_SENT);
    return timeSent ;
    Note: This UDF won't need any input. So u need not to maintain any variable in UDF signature.
    Edited by: Samiullah Qureshi on Aug 18, 2010 9:41 AM

  • How to get SAMl assertion from SOAP Header and propagate user context to BW

    Hello to all,
    we implemented this scenario:
    3rdparty System to SAP PI 7.11 to SAP BW.
    sync. communication via SOAP Sender adapter and Receiver XI PROXY.
    We get a SAMl assertion in the SOAP Header from the 3rd-Party System.
    The SAP BW System could not read the Header information.
    How can we get the information of the SOAP Header in the PI System and send the usercontext via XI Proxy to the SAP BW system?
    Can we read the Header information in the SOAP adapter and mapping it to another field in the payload or Headerinformation which could read in the backend system in the proxy class?
    Thanks for your help and regards
    Martin

    Dear Fox,
    Thanks for your reply.
    Is it mandatory to have the Header elements and the message defined in the Mediator wsdl?
    At present I have not defined it in the WSDL.
    Thanks,
    Subin

  • Adding WS Security in SOAP header for calling soap services from PI

    When i am calling a wss enabled webservice from soapui with the header parameters
    Username , Password and Password Type - PasswordText , it is able to get results. The soapui tool automatically adds the following in the soap header -
         <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
             <wsse:UsernameToken wsu:Id="UsernameToken-9368150" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                <wsse:Username>xxxxx</wsse:Username>
                <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">xxxxx</wsse:Password>
                <wsse:Nonce>aOA1P6t2hJPRyuraQ/IliQ==</wsse:Nonce>
                <wsu:Created>2009-07-10T14:58:33.781Z</wsu:Created>
             </wsse:UsernameToken>
          </wsse:Security>
    However , in PI when the following configurations are made -
    Web Services Security option selected in soap receiver adapter
    In Receiver Agrrement -
    Security Standard -  http://docs.oasis ....
    Security Procedure (Request) - None
    Security Procedure (response) - None
    the user tokens don't seem to generated and it is giving an authentication error . Is there any process of generating this in the outgoing soap header from PI.
    SOAP Axis framework is not installed at present  and working on PI 7.1 SP6.
    Looking forward for your replies

    same issue for me too.
    Try using WS adapter on receiver side .
    If you are able to attach SOAP header with WSSE fields using SOAP adapter at reciever channel let me know how you did it.

  • How do I access the DCJMS* variables in my response SOAP:Header ?

    Hi all,
    I have set up a sync / async Integration Process in XI
    This is initiated by a SAP R/3 transaction that calls a synchronous function to enter XI
    Once in the Bridge, a JMS receiver adapter sends out an asynchronous request message from XI to MQ
    A correlation allows the JMS sender adapter to return an asynchronous response message from MQ to XI back into my the Integration Process
    I have set up the JMS sender adapter configuration to return the DC (dynamic configuration) variables in the <SOAP:Header> of the XI response message along with the payload
    You can see that the DCJMS* variables are returned below
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--
    Response
      -->
    - <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SAP="http://sap.com/xi/XI/Message/30">
    - <SOAP:Header>
    + <SAP:Main xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsu="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" versionMajor="003" versionMinor="000" SOAP:mustUnderstand="1" wsu:Id="wsuid-main-92ABE13F5C59AB7FE10000000A1551F7">
    + <SAP:ReliableMessaging xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
    + <SAP:HopList xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
    + <SAP:RunTime xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    + <SAP:PerformanceHeader xmlns:SAP="http://sap.com/xi/XI/Message/30">
    - <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Record namespace="http://sap.com/xi/XI/System/JMS" name="DCJMSCorreleationID">40D982A0-B19D-11DB-9508-0002A5D5916B</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/JMS" name="DCJMSTimestamp">1170297456940</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/JMS" name="DCJMSMessageID">ID:414d5120514d4430312020202020202045c12b962001dd02</SAP:Record>
      </SAP:DynamicConfiguration>
    - <SAP:Diagnostic xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:TraceLevel>Information
    <b>Question</b>
    I want to access the DCJMS* variables but am not sure how to go about it as the
    variables exist in the <SOAP:Header>?
    I followed the SAP documentation to access adapter-specific attributes (refer to link http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm )
    I have used the following code to create a user-defined function for the accessing adapter specific attributes (similar to the link)
    public String Get_Msgid(Container container){
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get
    (StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create
    ("http://sap.com/xi/XI/System/JMS","DCJMSMessageID");
    String jmsMsgID = conf.get(key);
    return jmsMsgID;
    <b>Question</b>
    Do I use message mapping to extract the DCJMS* variables?
    <b>Question</b>
    If so then which message is used for the source message so that I can access the <SOAP:Header>?  Eg do I use the response message type or is there a trick to accessing the SOAP:Header?
    <b>Question</b>
    Do I use the user-defined function (like above)?
    I performed the following steps
    •     Opened the message mapping in edit mode
    •     Created the user-defined function using the graphical editor
    •     Saved the message mapping
    •     I have not connected the user-defined function to any of the xml tags in either the source or target messages
    When I go to test the message mapping I am getting the following error
    Compilation process error : CreateProcess: null\bin\javac -J-Xmx256m @E:/usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd79a7bf0b65611dbaf390002a5d5916b/O1170817003886.txt @E:/usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd79a7bf0b65611dbaf390002a5d5916b/S1170817003886.txt error=2
    STACKTRACE:
    com.sap.aii.ib.core.mapping.exec.ExecuteException: Compilation process error : CreateProcess: null\bin\javac -J-Xmx256m @E:/usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd79a7bf0b65611dbaf390002a5d5916b/O1170817003886.txt @E:/usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd79a7bf0b65611dbaf390002a5d5916b/S1170817003886.txt error=2
    at  com.sap.aii.ib.server.mapping.exec.ServiceUtil.compileSourceCode(ServiceUtil.java:207)
    at com.sap.aii.ib.server.mapping.exec.ServiceUtil.compile(ServiceUtil.java:156)
    at com.sap.aii.ibrep.server.mapping.ServerMapService.compileSourceCode(ServerMapService.java:361)
    at com.sap.aii.ibrep.server.mapping.ServerMapService.compileSourceCodeWithoutAndWithArchives(ServerMapService.java:301)
    at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:153)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:259)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146)
    at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:304)
    at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:193)
    at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:122)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    A thread in the SDN (Error while Activating Message Mapping, Posted: Jan 9, 2007 3:32 PM) suggests checking the java path on the XI machine
    This is JAVA_HOME=C:\j2sdk1.4.2_08 and seems ok
    <b>Question</b>
    Do you know why I would get the compilation error?
    Any assistance would be appreciated
    Regards,
    Mike

    Jin,
    My compilation issue has gone via a SAP recommendation to specify the JDK home directory in the instance profile
    Back to the mapping - I can now run my scenario
    <b>Source message</b>
    The response message has the following <SOAP:Header> from which I want to extract the DCJMSCorreleationID (note that it's misspelt)
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Response
      -->
    - <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Record namespace="http://sap.com/xi/XI/System/JMS" name="DCJMSCorreleationID">40D982A0-B19D-11DB-9508-0002A5D5916B</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/JMS" name="DCJMSTimestamp">1170297456940</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/JMS" name="DCJMSMessageID">ID:414d5120514d4430312020202020202045c12b962001dd02</SAP:Record>
      </SAP:DynamicConfiguration>
    <b>Grahpical mapping</b>
    LHS - Response message with occurrance 0..1 so it is not connected to my UDF
    UDF Get_Corrid with no inputs
    RHS - The UDF output is connected to the Acknowledgement msg tag <ACK>
    <b>UDF</b>
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get
    (StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create
    ("http://sap.com/xi/XI/System/JMS","DCJMSCorreleationID");
    String Corrid = conf.get(key);
    return Corrid;
    <b>Target message</b>
    The idea is to copy the correlation id of the response message into the acknowledgement message.  But as you can see the result is NULL
      <?xml version="1.0" encoding="utf-8" ?>
    - <ns2:AWB0020_MARKET_DATA_RESPONSE_ACK xmlns:ns2="http://awb.com.au/mq/tx/MarketData">
      <ACK>null</ACK>
      </ns2:AWB0020_MARKET_DATA_RESPONSE_ACK>
    Please advise
    Thanks Mike

  • Read SOAP Header Information

    Hello All,
    We want to read SOAP header from incoming message. We followed blog from William to use the option "Do not use SOAP Envelop". However, we are not sure if we need to modify Sender Interface to include Envelope / Header in the message structure itself.
    How to Read SOAP Header Information
    If we modify the message structure , it changes the WSDL as well and generating request message something like below :
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:aif="urn://transport.nsw.gov.au/test/poc/aif">
       <soapenv:Header/>
       <soapenv:Body>
          <aif:Envelope>   <------- Added by Modifying the structure
             <Header>
                <FileType>?</FileType>
             </Header>
             <Body>
                <MessageHeader>
                   <!--Optional:-->
    How can we use  "Do not use SOAP Envelop" feature without modifying the WSDL structure?
    If we don't modify the message structure , it is failing to identify the receiver and also we would not be able to see the fields while doing graphical mapping.
    Thanks !!

    Hi,
    Did you check the namespaces in your receiver determination? In interface determination, this could be solved by creating another mapping. Which PI version are you using?
    Regards,
    Mark

  • SOAP header information [continued]

    Dear,
    It all started here Get SOAP header information
    The fact is that I get the WSDL delivered and I need to upload that into the ESR.
    Next step is to create/generate a Service Interface.
    What I see in the WSDL binding
    After I generated a Service Interface
    Where is my SOAP header part? It seems to be gone in the Service interface?
    I tried this for both SOAP 1.1 and 1.2. Both the same phenomenon.
    Any suggestions?
    Thanks a lot
    Kind regards, Dimitri

    Hello Dimitri,
    Have you got any solution of the issue ?
    I think William's blog answer's that :
    http://scn.sap.com/community/pi-and-soa-middleware/blog/2009/07/30/how-to-read-soap-header-information
    However, It suggests to modify XML structure for sender interface as well. By doing so , it gives other challenge as described below :
    If we modify the message structure , it changes the WSDL as well and generating request message something like below :
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:aif="urn://transport.nsw.gov.au/test/poc/aif">
      <soapenv:Header/>
      <soapenv:Body>
          <aif:Envelope>   <------- Added by Modifying the structure
             <Header>
                <FileType>?</FileType>
             </Header>
             <Body>
                <BusinessPartner>
                   <!--Optional:-->
    How can we use  "Do not use SOAP Envelop" feature without modifying the WSDL structure?
    If we don't modify the message structure , it is failing to identify the receiver and also we would not be able to see the fields while doing graphical mapping.
    Let me know if you got any other alternative.
    Thanks & Regards,
    Dijesh Tanna

  • Retrieving the SOAP Header

    Hi All,
    I am getting SOAP Header as follows:
    <soap:Header>
    <m:userName xmlns:m="http://www.w3schools.com/transaction/"
         soap:mustUnderstand="1">Prod5</M:trans>
    <m:passWord xmlns:m="http://www.w3schools.com/transaction/"
         soap:mustUnderstand="1">objectc</m:trans>
    </soap:Header>
    My Question is this:
    I implmented a SOAP Handler, How can I retrieve the value of element userName
    which in this case is Prod5. I am doing something like this:
    soapEnvelope.getHeader().getAttributeValue(name);
    wherein, I defined name as follows:
         Name name = soapEnvelope.createName("userName");
    Is this the rightway of doing.
    Thanks
    ---Radhe

    Hi Radhe,
    It may look something (~) like this:
    SOAPMessageContext ctx = (SOAPMessageContext) c;
    SOAPMessage msg = ctx.getMessage();
    SOAPPart sp = msg.getSOAPPart();
    SOAPEnvelope se = sp.getEnvelope();
    SOAPHeader header = se.getHeader();
    Iterator it = header.getChildElements(se.createName("userName"));
    SOAPElement elem = (SOAPElement) it.next();
    String user = elem.getValue();
    Hope this helps,
    Bruce
    Radhe wrote:
    >
    Hi All,
    Sorry about the earlier post
    Hi All,
    I am getting SOAP Header as follows: <soap:Header> <m:userName xmlns:m="http://www.w3schools.com/transaction/"
    soap:mustUnderstand="1">Prod5</m:userName>
    <m:passWord xmlns:m="http://www.w3schools.com/transaction/" soap:mustUnderstand="1">objectc</m:passWord>
    </soap:Header>
    My Question is this:
    I implmented a SOAP Handler, How can I retrieve the value of element userName
    which in this case is Prod5. I am doing something like this:
    soapEnvelope.getHeader().getAttributeValue(name);
    wherein, I defined name as follows: Name name = soapEnvelope.createName("userName");
    Is this the rightway of doing.
    Thanks ---Radhe

Maybe you are looking for

  • Does the Serial Number work for Mac and Windows?

    I Purchased Photoshop Elements 12 it came with a Windows and a Mac Disc.  My Son just got a Mac.  I was wondering if I can install Elements on his Computer using the serial number I received from the Redemption code that I used  for my Windows Laptop

  • I no longer have toolbars, only a narrow strip that disappears until I pull it down; how do I fix this?

    I was on Facebook last night (6/23/11). I'd gone online about 6:30 and immediately was asked about upgrading to Mozilla 5.0; however, I had crops to harvest before 7, so I clicked "remind me later". I went to Farmville and then Facebook (where I alte

  • Import Issue with "Duets" tracks

    When importing a cd, any track that is 'duets' imports as a separate album instead of being listed with all other tracks. How do I correct this? I've put playlists together to keep all tracks together but there must be a better way (I hope). I'm usin

  • Also Very Slow after 10.4.6

    I have no software installed on this system, just the apps that are bundled with Tiger. The computer and Internet worked fine up until 10.4.6 was installed as an automatic update. Now the Internet i...s v..e.....r...y.. s.....l..o.....w. I suspect th

  • Save image fast

    Hi, I am using a Basler l104k line scan camera and NI pcie-1427 frame grabber. I want to save my images continuously and each image is 10 bit * 2048 *256 *256.  I am using IMAQ write file to save it into PNG file and it takes about 10 seconds to save