Accessing Soap header in webservices

Hi,
My webservice needs to read a soap header "locale" and do some processing based on this soap header.
I understand the concept of handlers..but anywhere I see examples, the handler handles it and returns the data back.
My requirement is that once this locale is retrieved, each of the webservice method should be able to read this locale, and do some processing based on that, as they need to return the localized data.
I am not sure if I am missing something, but not yet able to find a direct way of doing it..
Any response would be highly appreciated..
Thanks

user10455639 wrote:
Yes I can..what I still dont understand from yourr email is why are you askign this..
"if you can get the soap header"
Because any header we should be able to retrieve from this context...Because I saw the following statement from [JavaDoc | http://e-docs.bea.com/wls/docs103/javadocs/weblogic/wsee/jws/JwsContext.html#getInputHeaders()].
<<<<<<<<<<
....The SOAP headers used by WebLogic Workshop to manage conversations are included in the list of headers returned.
<<<<<<<<<<
If it works, then just use it :) because it is public supported
Edited by: LJ on Apr 23, 2009 10:04 PM
Edited by: LJ on Apr 23, 2009 10:21 PM

Similar Messages

  • Accessing SOAP header information in a custom adaptor module

    Hi Guys,
    Could anyone point me in the direction of information on how to access the SOAP:Header element when writing a custom adaptor module for a http/ SOAP communication channel?
    I'm trying to add some WS-Security stuff which isn't available in XI 3.0.
    Many thanks,
    John

    The solution is as follows:
    Mark as Do Not Use SOAPEnvelope in the communication channel.
    It may be possible to use the SAP implementation of MessageFactory, SOAPEnvelope etc., I forced XI the Apache Axis implementation, a thread on which can be found here Link: [Accessing SOAP header information in a custom adaptor module;
    The SOAP Envelope is created by
    javax.xml.soap.MessageFactory mf= org.apache.axis.soap.MessageFactoryImpl.newInstance();
    This doesn't work it creates a com.sap.engine.services.webservices.jaxm.soap.SOAPMessageImpl
    org.apache.axis.message.SOAPEnvelope env = new org.apache.axis.message.SOAPEnvelope();
    org.apache.axis.Message iSoapMessage = new org.apache.axis.Message(env);
    SOAPMessage sm = iSoapMessage;
    SOAPBody iBody = se.getBody();
    if(iBody!=null)
         iBody.addDocument(iDoc);
         addDocument failed for some reason when called in XI returning
         Exception caught by adapter framework: Exception in method process.
         The code below is copied straight from the addDocument method, but it works.
         org.w3c.dom.Element iDocRoot= iDoc.getDocumentElement();
         org.apache.axis.message.SOAPBodyElement bodyElement = new org.apache.axis.message.SOAPBodyElement(iDocRoot);
         iBody.addChildElement(bodyElement);
    In order to get a document representation of the Envelope you can use
    Document iEnvelopeDoc = ((org.apache.axis.message.SOAPEnvelope)env).getAsDocument();
    You are now in a position to add or adjust the SOAP Envelope as your require. It enabled me to add WS-Security information to a message.
    It is normally possible to use javax.xml.transform.Transformer on the various classes SOAPEnvelope, SOAPBody etc. as they implement Node. However doing this in XI caused a crash.
    The final document can be then be set in the xmlPayload before being sent out the door.
    Hope this helps someone,
    John

  • 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.

  • JCAPS 5.12 - modifying SOAP header for webservice Invocation

    I am trying to call an external web service from JCAPS 5.1.2 and need to set a token in the SOAP header. I am able to do this in other client implementations, however, the methods to modify the header don't seem to be exposed within JCAPS 5.1.2 or I do not know how to find the methods.
    Has anyone tried this before?

    Hi Experts,
    I'm trying to protect a web service deployed in jcaps 5.1.1, using SAML assertions against an Access Manager 7/7.1, the web services clients are both, web and standalone applications, I also have read netbeans tutorials, that expose how to implement identity webservices using AppServer 9.1 + AccessManager 7.1 using the SAML Holder of key and other security mechanisms, but this implementation requiere modifications to the server.policy file to add support to SOAP message security providers and HttpServlet message security providers, the addition of a library called amwebservicesprovider.jar to the classpath suffix (this library implements the jsr-196 java Authentication Service Provider Interface for Containers) and aditional configuration required in the AM side that is not detailed in the tutorials.
    Could someone guide me on how to protect the acces to a web services deployed in the jcaps logicalhost based on AM roles assigned to users?
    Any help is aprecciated
    Juan

  • 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

  • XI APIs to access SOAP Header Tags

    Hi Forum,
    The way we use DynamicConfiguration class from com.sap.aii.mapping.api.* API, to access file names etc,
    is there classes available for accessing other tags in the SOAP Header, for example ReliableMessaging, PerformanceHeader, etc

    U can look into Adapter Specific attributes for soap adapter also. If you want to transfer header fields, set the relevant indicator for Variable Header in the SOAP communication channel. This is generic for header fields. Not sure about the particual fields
    Regards,
    Prateek

  • Access SOAP:Header section

    Hello,
    I need to call a WebService with some extensions in the SOAP:Header. I don't find a solution without a custom develop Adaptermodul which renders the whole SOAP request and uses the SOAP Adapter without the SOAP functions.
    What do you think ?
    Regards,
    Gerald

    Hi,
    We have the same problem with SP14.
    Looks like the soap adapter can't handle soap headers correctly.
    A workaround may be to use the http adapter instead and generate the xml envelope messages for request and parsing the response. We have tried this for document based soap and it works.
    Obbviously you would like to have the soap adapter fixed so it can support soap headers.
    Best regards otto

  • Access soap header

    Hey there,
    is there a way to read out the custom header elements of the invoking soap message in a process? E.g. a client creates a soap message, adds optional information to the header and sends it to the bpel server. In order to react on that information, the process needs to access these data.
    Thanks!

    Another example to look at for this is the Sabre HotelShopFlow (I’ll see if I can send you this sample - please email me). All the interesting work is done in the WSDL for the service. If the WSDL for the service defines a multi-part input message, where some parts are mapped to the SOAP header and some to the soap body, then you are in good shape and can set those parts in BPEL like any other input message data. From the enterprise.wsdl in salesforce demo:
    <operation name="describeSObject">
    <soap:operation soapAction=""/>
    <input>
    <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
    <soap:body parts="parameters" use="literal"/>
    </input>
    And then from the BPEL code, the SessionHeader is set with:
    <copy>
    <from variable="loginResponse" part="parameters" query="/salesforce:loginResponse/salesforce:result/salesforce:sessionId">
    </from>
    <to variable="headerRequest" part="SessionHeader" query="/salesforce:SessionHeader/salesforce:sessionId"/>
    </copy>
    Note that if the WSDL does not define the header data as a messageType, then you will need to create your own local copy of the WSDL for the service and edit it to be what you want.
    (taken from one of the devloper responses to this question already available). Please let me know if you can move forward with this response.

  • How to access SOAP header without using SOAP message handler

    I have a requirement to retrieve SOAP header information within each web services operation. So I can't use SOAP message handler. Is there any way to do that? BTW, I am not using workshop.
    Thanks.

    Howeve how can I put data into soap header in UDF? DynamicConfiguration won't work for soap header, right?
    Which data do you want ot put into the Header section.
    ASMA or Dynamic Configuration is used to read/ put the details from/ into the header elements.....
    Refer: http://help.sap.com/saphelp_nw04/helpdata/en/43/0a7d1be4e622f3e10000000a1553f7/frameset.htm
    From the help section:
    This information is not located in the payload of the message, but in additional message header fields.
    Regards,
    Abhishek.

  • Create/access SOAP header

    Hello,
    How can I implement a web service in jdev that extracts some elements from the SOAP header ?
    How can I implement a web service proxy in jdev so that it inserts elements in SOAP header?
    Thank you.
    The operation WSDL looks approx like this:
              <operation name="SoapDDXML">
                   <soap:operation soapAction="someaction"/>
                   <input>
                        <soap:body
                             use="encoded"
                             namespace="ns"
                             encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                             parts="psXML"/>
                   </input>
                   <output>
    <soap:Header>
    <OurCredentials xmlns="ns">
    <UserName>string</UserName>
    <Password>string</Password>
    </OurCredentials>
    </soap:Header>
                        <soap:body
                             use="encoded"
                             namespace="ns"
                             encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                             parts="Result"/>
                   </output>
              </operation>

    Also facing the same problem - has anyone found an answer?
    Thanks,

  • Accessing SOAP over JMS webservice

    Hi,
    From Webdynpro can I access a webservice which is using SOAP over JMS.
    Is there any example on it.
    Thanks.
    MS.

    I have similar situation.
    R/3->XI->java message server
    XI and message server exchange SOAP envelope using JMS. (SOAP over JMS)
    XI posts SOAP message in queue & in inbound case would pickup SOAP message from JMS queue.
    My question: When using a SOAP adapter, it does work of stripping SOAP envelope/ header? Do we need to handle it in xslt when a message is picked up from external message queue(from message server)? In other words how to handle SOAP message in inbound case?
    Thanks,
    sachin
    PS: Points will be awarded for useful answer

  • Error in soap header when use webservice consumer proxy

    Hi all,
    I create a webservice consumer proxy to external server. the webservice provider is .Net  and it required a message level security.
    The soap message should include a soap header, like this:
    <SOAP-ENV:Header>
    <m:AuthHeader xmlns:m="http://tempuri.org/">
    <m:Username>test1</m:Username>
    <m:Password>test</m:Password>
    </m:AuthHeader>
    </SOAP-ENV:Header>
    I have found many information from here. Now I used  IF_WSPROTOCOL_WS_HEADER in my program, like this:
    REPORT  zws_jp_test01.
    DATA: lo_zws_jp_co_service_soap TYPE REF TO zws_jp_co_service_soap .
    DATA: lo_fault TYPE REF TO cx_ai_system_fault.
    DATA: lo_appl_fault TYPE REF TO cx_ai_application_fault.
    TRY.
        CREATE OBJECT lo_zws_jp_co_service_soap
          EXPORTING
            logical_port_name = 'ZWS_JP_LP4'.
      CATCH cx_ai_system_fault INTO lo_fault.
        MESSAGE lo_fault TYPE 'I'.
    ENDTRY.
    DATA: output TYPE zws_jp_create_job_ad_soap_out .
    DATA: input TYPE zws_jp_create_job_ad_soap_in .
    DATA: lr_ws_header TYPE REF TO if_wsprotocol_ws_header.
    DATA: lv_name TYPE string,
          lv_namespace TYPE string.
    DATA l_xstring TYPE xstring.
    DATA l_string TYPE string.
    DATA: ixml TYPE REF TO if_ixml,
         xml_document TYPE REF TO if_ixml_document,
         xml_root TYPE REF TO if_ixml_element,
         xml_element TYPE REF TO if_ixml_element,
         xml_node TYPE REF TO if_ixml_node.
    lr_ws_header ?= lo_zws_jp_co_service_soap->get_protocol(
                                               if_wsprotocol=>ws_header ).
    CONCATENATE
      '<SOAP-ENV:Header>'
        '<m:AuthHeader xmlns:m="http://tempuri.org/">'
          '<m:Username>test1</m:Username>'
          '<m:Password>test</m:Password>'
        '</m:AuthHeader>'
      '</SOAP-ENV:Header>'
    INTO l_string.
    l_xstring = cl_proxy_service=>cstring2xstring( l_string ).
    CALL FUNCTION 'SDIXML_XML_TO_DOM'
      EXPORTING
        xml           = l_xstring
      IMPORTING
        document      = xml_document
      EXCEPTIONS
        invalid_input = 1
        OTHERS        = 2.
    IF sy-subrc = 0 AND NOT xml_document IS INITIAL.
      xml_root = xml_document->get_root_element( ).
      xml_element ?= xml_root->get_first_child( ).
      WHILE NOT xml_element IS INITIAL.
        lv_name = xml_element->get_name( ).
        lv_namespace = xml_element->get_namespace_uri( ).
        lr_ws_header->set_request_header(
            name            = lv_name
            namespace       = lv_namespace
            dom             = xml_element
            must_understand = SPACE
        xml_element ?= xml_element->get_next( ).
      ENDWHILE.
    ENDIF.
    input-job_ad-id = 0.
    input-job_ad_text-id = 0.
    input-job_ad-publish_location = 1.
    TRY.
        CALL METHOD lo_zws_jp_co_service_soap->create_job_ad
          EXPORTING
            input  = input
          IMPORTING
            output = output.
      CATCH cx_ai_system_fault INTO lo_fault .
        MESSAGE lo_fault TYPE 'I'.
      CATCH cx_ai_application_fault INTO lo_appl_fault.
        MESSAGE lo_appl_fault TYPE 'I'.
        WRITE: output-create_job_ad_result-id.
    ENDTRY.
    But there is error when I run this program. the error is "SoapFaultCode:1"
    In tcode ST11, I see this log:
    E SOAP_RUNTIME 20100624004837.9280000 : CL_SOAP_RUNTIME_CLIENT
    ->EXEC_PROCESSING SOAP Fault Exception caught: : SOAP header To
    was not understood.
    btw the release is  701.
    Any one can navigate me to solved the problem?

    Hi,
      I have the same problem as you did before and I posted my code in this [thread|Change SOAP Header: Consuming Webservice;.
      In order to to solve your problem, I need to know what is the header that you want to add into the header, what is WSDL, and have you try testing that web service using other tool such as SOAPUI or XMLSPY and what is the result of testing tool?
    Regards,
    Chaiphon

  • Access to SOAP Header/SOAP Envelope in OSB

    We have a need where we need to copy the SOAP header request to SOAP header response. Is there a way to access SOAP Header/SOAP Env in OSB ?
    Thanks,
    Pavan
    Edited by: user10413378 on Mar 6, 2010 7:14 AM

    There is $header variable with headers:
    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageflow.html#wp1093911
    You can pass all headers through using "Get All Headers" option in Proxy settings and Transport Headers - Pass all Headers in your flow:
    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageflow.html#wp1125345

  • Exapmle for SOAP Header in WS using JAXRPC Handler

    Any one has example of how to use the SOAP Header in Webservice implementation using the JAX RPC handler?
    We have a situation where several PL/SQL web services require some context being set in the PL/SQL package. I am planning to use the PL/SQL web service with some soap headers , when present the Handler will take those values from the SOAP header and make the extra pl/sql calls, before the BODY which will be mapped to the pl/sql procedure whose response will be sent back as the WS response..
    I will really appreciate if some one show me the example on how to use the JAXRPC handler in JDEV.
    Thank you very much.

    Probably the easiest way is to insert
    @Resource
    WebServiceContext wsc;
    in your @WebService annotated class.
    Depending what you want to do a SOAPHandler might be appropriate.
    also possible:
    http://www.khapre.org/blog/archives/2008_08_01_index.aspx
    Edited by: Konrad KRENTZ on Dec 1, 2009 8:56 PM

  • SOAP Header

    Hi Experts,
    My scenario is to access the HEADER element in the incoming SOAP Header and use it as a condition for Receiver determination.
    Can somebody give example of
    1) XSLT / java  code which can be used to access SOAP Header elements.
    2) How use this to determine the receiver.

    Hi,
    You can achieve this by setting the Adapter-Specific Message Attributes under advanced tab in your CC.
    check below link for the same..
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/fc/5ad93f130f9215e10000000a155106/content.htm
    Regards,
    Sarvesh

Maybe you are looking for

  • All my photo albums are empty

    I upgraded to Photos Beta fine and everything worked, all my albums were ok but then suddenly last night all of my albums were empty on my Mac, iPhone and iPad. The album folders were there but no photos inside. All of my photos were still in the All

  • How to see computers in windows network

    My router is cisco 881-w my server pc ip address is 10.10.10.3, but my wireless clients from 10.10.12.1 till 10.10.12.20, how can i see each other computers in windows network... I can ping computers, but i can't browse... I preffer to use cisco conf

  • T430 Right shift key showing context menu

    Hi, I just got a Lenovo T430 and after using for barely a month, i got this issue that makes me go crazy. The OS is windows 8.0 Pro. Anytime i press the right shift key or the Enter key, i get this context menu popping out, sometimes moving my cursor

  • How Do I accurately measure digital Polses using a compact field point

    Hi All, My Goal Is to measure the speed of an item by measuring the difference between operation of 2 switches. Pulse can be between 100 msec and hours. I require > 100 uSec Accuracy @ 100 msec, 1msec @ 1 Sec etc... This architecture is fixed, What I

  • Calendar events missing in new ios7

    updated my iPhone 4 to the new iOs 7 and my calendar events in the past are missing along with events that cannot be deleted.  Basically its crap, any help