HTTP AXIS - Add soap header element

Hi,
I want to use WS-Security in my SOAP flow. But I want also add an attribute inside the soap header.
Here is what I want :
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP:Header>
        <OPER_REF>SAPPI</OPER_REF>
   </SOAP:Header>
   <SOAP:Body>
      <ns2:createSapProductRequest xmlns:ns2="http://www.blabla.com/">
         <productCode>000000000001101238</productCode>
              </ns2:createSapProductRequest>
   </SOAP:Body>
</SOAP:Envelope>
It works fine without security option (I used an HTTP - SOAP adapter) with Java mapping
Now I want to add WS-Security options :
<wsse:Security SOAP: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-17224938" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";>
            <wsse:Username>sp</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">Cv1nK/fX6p8C74aHMJ0iILpeAsc=</wsse:Password>
            <wsse:Nonce>SBjsJ0qqXPNNPfUVP8u87A==</wsse:Nonce>
            <wsse:Created>2009-06-26T07:28:31.720Z<;/wsse:Created>
         </wsse:UsernameToken>
      </wsse:Security>
I reach that with the Java mapping but the generation of the password is not efficient because if there is a problem in the flow, the password has to be regenerated when the message it is send to the receiver. So the password generation has to be inside the receiver adapter not in the mapping itself.
So I would like to use HTTP AXIS adapter, but it cannot deactivate the SOAP envelope so I can't add my parameter OPER_REF inside the soap header.
I'm not sure i'm clear so do not hesitate to ask questions.
Thanks
Regards

Solve with Java Mapping.

Similar Messages

  • How to add SOAP header element?

    Hi,
    Scenario : RFC --> SOAP
    I would like to add parameters into the soap header :
    <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
          <SOAP:Header>
                *<OPER_REF>SAPPI</OPER_REF>*
          </SOAP:Header>
          <SOAP:Body>
              <ns2:createSapProductRequest xmlns:ns2="http://www.mycompnay.com/projectname">
                        <country>FR</country>
                     <division>1300</division>
                     <productStage/>
              </ns2:createSapProductRequest>
            </SOAP:Body>
    </SOAP:Envelope>
    So I made a Java Mapping to reach my goal so my message looks like :
    <ns0:Messages
         xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
         <ns0:Message1>
              <SOAP:Envelope
                   xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
                   <SOAP:Header>
                        <OPER_REF>SAPPI</OPER_REF>
                   </SOAP:Header>
                   <SOAP:Body>
                        <ns2:createSapProductRequest
                             xmlns:ns2="http://www.mycompany.com/myproject">
                             <country>FR</country>
                             <division>1300</division>
                             <productStage/>
                        </ns2:createSapProductRequest>
                   </SOAP:Body>
              </SOAP:Envelope>
         </ns0:Message1>
    </ns0:Messages>
    But when I launch the process here is what PI do :
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
      <soapenv:Header>
       <OPER_REF xmlns="">SAPPI</OPER_REF>
      </soapenv:Header>
      <soapenv:Body>
       <ns2:createSapProductRequest xmlns="http://www.mycompnay.com/myprojecty" xmlns:ns2="http://www.mycompnay.com/myprojecty">
        <country xmlns="">FR</country>
        <division xmlns="">1300</division>
        <productStage xmlns=""></productStage>
       </ns2:createSapProductRequest>
      </soapenv:Body>
    </soapenv:Body>
    </soapenv:Envelope>
    this request has been found thanks to the tool TCPGW. Has you can see there is 2 <soapenv:Body>
    What is wrong ?
    regards

    I was right, the solution is :
    My problem was the adapter. It was miss used.
    _The configuration is : _
    HTTP without SOAP Envelope and in the Module :
    Name : localejbs/AF_Modules/MessageTransformBean
    Type : L
    Key : Plain2XML
    _Module's Configuration : _
    Plain2XML -> Transform.ContentType -> text/xml;charset=utf-8
    All the XML messages was well formed even with the strange xmlns attributes.
    Regards

  • How to create SOAP Header elements using SAAJ??

    I am facing a problem when adding header elements under SOAP Header
    using SAAJ(api).
    I want to create a structure as following:
    I get a empty SOAP header obejct by writing code--> SOAPHeader header
    = envelope.getHeader();
    But not able to add SOAP header elements as specified in example
    below. I tried but its giving me error as
    "HeaderElements must be namespace qualified"
    CAN ANYBODY TELL ME THAT HOW TO ADD HEADER ELEMENTS USING SAAJ??
    <SOAP:Header>
    <AccountNumber>123</AccountNumber>
    <AuthorisationCode>test111</AuthorisationCode>
    <Source>abc</Source>
    <Market>01</Market>
    </SOAP:Header>

    I'm including this comment from some code I've just written after wrestling with this for hours (I've actually left it on another post as well). The upshot of it all is that you have to include a namespace URI when creating a header in SAAJ:
            NOTE: SOAP 1.1 requires that all header entries be namespace-qualified to
            namespace URI's.  The SAAJ 1.2 implementation requires a Name object with
            the namespace URI to make this happen even if the prefix used is already
            visible by being declared higher in the document (e.g. in the Envelope).
            However, the namespace URI is not present in the serialized header element
            as long as it was declared higher in the document.  In order to create a
            header element without a prefix (to conform to a web service definition
            that doesn't use a prefix in its headers, for example), leave the prefix
            null in the addHeaderElement() method. 
            For example, with a SOAPHeader 'hdr':
              //first create the name
              Name name = env.createName("my-local-name", null, "my-URI");
              //then create the header element
              SOAPHeaderElement he = hdr.addHeaderElement(name);
            This would result in an XML element that looked like this:
              <my-local-name xmlns="my-URI"/>
            This would allow SAAJ developers to create a header for a service that
            only expected a local name in its header elements (as many do!).  As long
            as the service doesn't choke on the attribute (validation!  evil!), this
            should work.
                                                        Rob Kemmer
                                                        01/12/2005
     

  • Remove SOAP Header Element from ALSB Proxy Service Response

    I've got a client of one of my ALSB Proxy services that needs the SOAP header element removed from the response. I'm struggling to find a way to do that with a WSDL-based proxy service. Do I need to change my service to an Any XML Service or is there an easier way?

    At the same time, could you please also tell me how do i convert a XML Response from a business service to a SOAP Response in Proxy Service.
    My client is expecting a soap response and the backend gives back only the XML Response
    Thanks in advance!!
    ~Swagat

  • Set  SOAP header element while invoking WS thru ADF webservice Data control

    Experts,
    I am trying to invoke/call a webservice (using ADF web service data control ) which is expecting custom element in SOAP-Header. I want to know the steps needed to set SOAP-Header custom element when using ADF web service data control. SOAP-Header custom element will be string type, something like
    <soap:Header><element1>String</element1></soap:Header>
    Thank you,
    Ashish

    Hi,
    extend the SOAPProvider class
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPException;
    import javax.xml.soap.SOAPMessage;
    import oracle.adf.model.adapter.AdapterException;
    import oracle.adfinternal.model.adapter.webservice.provider.soap.SOAPProvider;
    public class CustomSOAProvider extends SOAPProvider {
        public CustomSOAProvider() {
            super();
        //expose protected method to public
        public void handleRequest(SOAPMessage soapMessage) throws AdapterException {
            super.handleRequest(soapMessage);
        //Expose protetcted method to public
        public void handleResponse(SOAPMessage soapMessage) throws AdapterException {
            super.handleResponse(soapMessage);
        }And configure it in the DataControls.dcx file of your WS DC project
    <AdapterDataControl id="..."
    xmlns="http://xmlns.oracle.com/adfm/datacontrol">
    <Source>
    <definition xmlns="http://xmlns.oracle.com/adfm/adapter/webservice"
    name="..." version="1.0"
    provider="adf.sample.wsdc.CustomSOAProvider"
    wsdl="http://...">
    Frank

  • Add soap header in SALT

    Hi everyone!
    I want to send a soap header(an UUID) using SALT, and honestly, I didn't found a detailed explanation or an example on how to do that.
    The only thing I know so far is:
    - Add in the ".wsdf" file: <Property name="mapsoapheader" value="true" />
    - And then somehow using "TA_WS_SOAP_HEADER" (previously included by wssoapflds.h) I will get what I need.
    So, am I in a good way to solve my problem?
    If yes, how exactly I should set TA_WS_SOAP_HEADER in my C code?
    I don't know if you need more details, just ask me and I'll reply to you as fast as I can.
    Thanks in advance,
    Daniel.

    If want to use soap header, The data type must be FML32.
    SALT will add a field TA_WS_SOAP_HEADER in user's FML32 buffer type.
    The feature only in SALT version greater than 12c Release 1

  • Add SOAP header before the WebService request (Windows Forms)

    I have to add this header before my Request:
    <h:FordDealerIdentity xmlns:h="urn:ford/star/security/v1.0" xmlns="urn:ford/star/security/v1.0">
    <soapenv:Header>
    <SiteCode>SZBRA</SiteCode>
    </soapenv:Header>
    </h:FordDealerIdentity>
    My request:
    var srv = new ConsumerServiceScheduleV1();
    var a = new RetrieveScheduleRequestType();
    var b = new DealerType();
    var c = new ScheduleType();
    srv.Credentials = new System.Net.NetworkCredential("","SZBRA05168");
    //ScheduleType[] ret;
    b.Code = 05168;
    b.Name = "BraconCampos";
    a.Dealer = b;
    a.SchedulingFrom = new DateTime(10/10/2014);
    a.SchedulingTo = new DateTime(15/10/2015);
    c.SchedulingCategory = SchedulingCategoryType.Regular;
    srv.ClientCertificates.Add(new System.Security.Cryptography.X509Certificates.X509Certificate2(@"E:\Agenda Ford\Certificados Agend@Ford\BracomCampos.pfx", "qaz123"));
    textBox1.Text = srv.RetrieveSchedule(a).ToString();

    Is Windows Forms! :)
    And what forum deals with SOAP and Web services more than any other forum?  Many types of client based applications such as  Windows form, WPF, Sliverlight, Windows service classlib project like a BLL and so forth deal sith SOAP and WEB.
    How is what you are talking about a Windows forms issue?
    My Application is Windows Forms. I need to know how to insert this header before request.

  • Meaning of SOAP Header element.

    Hi Frnds,
    Can you please tell me, in the moni, what is the significant use of -
    >
    Main, ReliableMessaging, HopList, RunTime, PerformanceHeader, Diagnostic, and Trace of the SOAP Header.
    And, Manifest of the SOAP BODY.
    Thanks,
    Raj.

    Hi,
      Check the link for more detail..
    [http://help.sap.com/saphelp_nw70/helpdata/EN/dc/c5223d78cb752de10000000a114084/content.htm]
    Regards,
    Prakasu.M

  • How to add a custom element to a SOAP Header in c#

    I am new to SOAP and web-services, and not an expert on c# either so sorry if I have made an infuriatingly simple error.
    I am calling several web-services and I now need to add an element called *pcimask* to the SoapHeader in order to get a response that is PCI Compliant.
    The web-services/WSDL don't expose this property so I guess I need to add it at runtime.
    My application creates SOAP messages like the below: (the Soap Request and Response are output into a text file by a SOAP Logging class)
    <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>
    <AutHeader xmlns="http://edb.com/ws/WSCommon_v21">
    <SourceApplication>myApp</SourceApplication>
    <DestinationApplication>theirApp</DestinationApplication>
    <Function>CardCreate</Function>
    <Version>3.0.0</Version>
    <ClientContext>
    <userid>myID</userid>
    <credentials>SecureToken</credentials>
    <channel>NBA</channel>
    <orgid>123456</orgid>
    <orgunit>654321</orgunit>
    <customerid />
    <locale xsi:nil="true" />
    <ip>123.456.789.012</ip>
    </ClientContext>
    </AutHeader>
    </soap:Header>
    As I understand it, I need to add an element `pcimask="true` to the
    <ClientContext element, and it must be after the <ip>
    However the wsdl doesn't expose this as a property.
    So I have looked at the below resources:
     Bytes.com - how-add-soap-header-soap-message
     Stackoverflow: (18980689) adding-custom-soapheader-in-c-sharp-for-a-web-service-call
     Stackoverflow: (4035423) add-child-elements-to-custom-soap-header-in-spring-ws
    and I came up with a little class inside my `common.cs` as below:
    using System.Web.Services.Protocols;
    using System.Xml.Serialization;
    namespace EvryCardManagement
    [XmlRoot(Namespace = "http://edb.com/ws/WSCommon_v21")]
    [SoapHeader("EDBHeaderType", Direction = SoapHeaderDirection.In)]
    public class CardCreateEx : SoapHeader
    public string Value;
    public CardCreateEx pcimask;
    public static class Common
    public static bool closeMe { get; set; }
    public static int iMQRowID;
    public static string impNme;
    public static string impPwd;
    and I wanted to try and use it in my code that creates the SoapHeader as below:
    private EDBHeaderType wsSoapHeader()
    EDBHeaderType wsSoapHeader = new EDBHeaderType();
    /* ClientContext */
    ClientContextType clientContext = new ClientContextType();
    clientContext.userid = edb_service[0].userid;
    clientContext.credentials = Common.SOToken;
    //clientContext.pc
    clientContext.orgid = edb_service[0].orgid;
    clientContext.orgunit = edb_service[0].orgunit;
    clientContext.customerid = "";
    clientContext.channel = edb_service[0].channel;
    clientContext.ip = edb_service[0].ip;
    /* PCI MASK added to ClientContext in header; P-02925; Jan 2015 */
    CardCreateEx cardCreateExt = new CardCreateEx(); // P-02925; Jan 2015
    cardCreateExt.Value = "true";
    /* EDBHeader */
    wsSoapHeader.SourceApplication = edb_service[0].SourceApplication;
    wsSoapHeader.DestinationApplication = edb_service[0].DestinationApplication;
    wsSoapHeader.Function = edb_service[0].Function;
    wsSoapHeader.Version = edb_service[0].Version; // P-02925; Oct-Nov 2014
    wsSoapHeader.ClientContext = clientContext;
    return wsSoapHeader;
    but I get a build error:
        Attribute 'SoapHeader' is not valid on this declaration type. It is only valid on 'method' declarations.
    so what is the correct way to do this?

    Hi,
    >>Attribute 'SoapHeader' is not valid on this declaration type. It is only valid on 'method' declarations.
    Base on this situation, just as the error message says, the 'SoapHeader' attribute can only use on method, such as:
    [SoapHeader("myHeader", rection=SoapHeaderDirection.InOut)]
    //Receive any SOAP headers other than MyHeader.
    [SoapHeader("unknownHeaders",Required=false)]
    public string MyWebMethod() {
    return "Hello";
    For mire information:
    http://msdn.microsoft.com/en-us/library/system.web.services.protocols.soapheader(v=vs.110).aspx
    Besides, about Defining and Processing SOAP Headers:
    http://msdn.microsoft.com/en-us/library/77hkfhh8(v=vs.71).aspx
    http://stackoverflow.com/questions/18980689/adding-custom-soapheader-in-c-sharp-for-a-web-service-call
    Regards

  • 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

  • Reading custom SOAP header with XHeaderName1

    Hello Experts,
    I have a SOAP to File scenario and I am trying to do dynamic receiver determination by looking at the SOAP request header info. I am adding a custom field (System_ID) that I want rules to run against in Receiver Determination..
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:urn="urn:*******************">
    <soapenv:Header>
    <System_ID>100</System_ID>
    </soapenv:Header>
      <soapenv:Body>
       </soapenv:Body>
    </soapenv:Envelope>
    In the Receiver Determination I have multiple rules using SOAP context object to  XHeaderName1 = the System_ID (100) to pass the message to the right system at runtime according to the  System_ID.
    In the SOAP sender channel I have Set Adapter-Specific Message Attributes and Variable Transport Binding checked. I also have the variable name System_ID in the first Variable Header (XHeaderName1).
    In the SOAP sender Conversion Parameters I have Do Not Use SOAP Envelope and Keep Headers checked, as well as nosoap=true in the SOAP request URL.
    I'm getting the System ID to show in XI in sxmb_moni in the Header but no where do I see it being used with XHeaderName1.
    Am I using XHeaderName1 right? If not could you advise as to how XHeaderName1 should be used?
    My requirement is to read system ID from Header, not payload.
    Thank you!
    Tim

    I was able to find a solution to my problem.
    I created a basic senario below to test:
    1.A basic Asynchronous scenario is created using a SOAP sender adapter to 2 possible flat file receivers.
    2.The SOAP sender channel will have the option u201CDo Not Use SOAP envelopeu201D checked and SOAPUI URL will have u201C&nosoap=trueu201D added to the end.
    3.The receiver system name will be stored in the WS-Addressing u201CActionu201D field sent from SOAPUI.
    4.Two ABAP mappings are created. One mapping will extract the system number from the WS-Addressing u201CActionu201D field. The other mapping will extract just the body of the SOAP message to send along. Using regex and string manipulation in the ABAP mappings we can reuse the mappings for any SOAP message.
    5.Enhanced (Extended) Receiver Determination is selected and interface mapping using system/XI ReceiverDetermination  service interface is used to capture the receiver system.
    While this is a solution is not the best, it is a solution. Upon research I found a recent SAP Note 1385579 talking about implementing a SAP delivered generic SOAP Sender AXIS handler com.sap.aii.axis.soap.HeaderExtractionHandler to extract SOAP Header elements and place in message attributes. I will be trying this out.

  • Adding soap header in MX6.1

    I have a code working on MX7, it first adds soap
    header(username and password) then gets the response, but similar
    code didn't work on MX6.1. Please help.
    MX7 code:
    <cfscript>
    ru = XmlNew();
    ru.AuthenticationHeader = XmlElemNew(ru, "
    http://www.mytesting.com/Webservices/ProductInfo","AuthenticationHeader");
    ru.AuthenticationHeader.UserName = mlElemNew(ru,"
    http://www.mytesting.com/Webservices/ProductInfo","UserName");
    ru.AuthenticationHeader.UserName.XmlText = "myusername";
    ru.AuthenticationHeader.Password = XmlElemNew(ru,"
    http://www.mytesting.com/Webservices/ProductInfo","Password");
    ru.AuthenticationHeader.Password.XmlText = "mypassword";
    ws = CreateObject("webservice", "
    http://www.mytesting.com/Webservices/ProductInfo/Management.asmx?WSDL");
    addSOAPRequestHeader(ws, "
    http://www.mytesting.com/Webservices/ProductInfo",
    "AuthenticationHeader", ru.AuthenticationHeader, true);
    subbid = ws.GetProductInfo();
    </cfscript>
    MX6.1 code:
    <!--- get SOAP functions --->
    <cfinclude template="soap-udfs.cfm">
    <cfscript>
    ru = XmlNew();
    ru.AuthenticationHeader = XmlElemNew(ru, "
    http://www.mytesting.com/Webservices/ProductInfo","AuthenticationHeader");
    ru.AuthenticationHeader.UserName = XmlElemNew(ru,"
    http://www.mytesting.com/Webservices/ProductInfo","UserName");
    ru.AuthenticationHeader.UserName.XmlText = "myusername";
    ru.AuthenticationHeader.Password = XmlElemNew(ru,"
    http://www.mytesting.com/Webservices/ProductInfo","Password");
    ru.AuthenticationHeader.Password.XmlText = "mypassword";
    ws = CreateObject("webservice", "
    http://www.mytesting.com/Webservices/ProductInfo/Management.asmx?WSDL");
    addRequestHeader(ws, "AuthenticationHeader",
    ru.AuthenticationHeader, "
    http://www.mytesting.com/Webservices/ProductInfo",
    true);
    subbid = ws.GetProductInfo();
    </cfscript>
    Error message for MX6.1:
    Could not perform web service invocation "GetProductInfo"
    because AxisFault faultCode: {
    http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode: faultString: java.io.IOException: No serializer found
    for class coldfusion.xml.XmlNodeList in registry
    org.apache.axis.encoding.TypeMappingImpl@19a61ad faultActor:
    faultNode: faultDetail: {
    http://xml.apache.org/axis/}stackTrace:
    java.io.IOException: No serializer found for class
    coldfusion.xml.XmlNodeList in registry
    org.apache.axis.encoding.TypeMappingImpl@19a61ad at
    org.apache.axis.encoding.SerializationContextImpl.serializeActual(SerializationContextImp l.java:1281)
    at
    org.apache.axis.encoding.SerializationContextImpl.serialize(SerializationContextImpl.java :795)
    at
    org.apache.axis.message.MessageElement.outputImpl(MessageElement.java:817)
    at
    org.apache.axis.message.SOAPHeaderElement.outputImpl(SOAPHeaderElement.java:250)
    at
    org.apache.axis.message.MessageElement.output(MessageElement.java:783)
    at
    org.apache.axis.message.SOAPHeader.outputImpl(SOAPHeader.java:342)
    at org.apache.ax...

    XML snippit
    <soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:con="urn:crmondemand/ws/contact/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
    xmlns:con1="urn:/crmondemand/xml/contact">
    <soapenv:Header>
    <wsse:Security>
    <wsse:UsernameToken>
    <wsse:Username>your_site/your_login</wsse:Username>
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">your_password</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    </soapenv:Header>
    This isn't exactly what you are looking for but you can use this to add a header to a axis web service call.
    SOAPHeaderElement header = new SOAPHeaderElement("http://your.xsd", "your tag");
    SOAPHeaderElement header1 = new SOAPHeaderElement("http://your other.xsd", "your other tag");
    header1.setAttribute("Id", "your value");
    header.addChild(header1);
    SOAPElement node = header1.addChildElement("more text");
    node.addTextNode("more text");
    SOAPElement nodepwd = header1.addChildElement("another tag");
    nodepwd.addTextNode("more text");
    nodepwd.setAttribute("Type", "http://another url");
    ((Stub)service2).setHeader(header);
    Hope this is more helpful than confusing.

  • WSSE usename token not in the SOAP Header

    Background:
    Webservice with four methods; OpGet, OpCreate, OpGetList, OpSet. Setup a jcx with this webservice URL, generate a test harness from workshop, and running this test harness and looking at the SOAP messages being send and received to verify that the web services are working. The OpGet is working since it doesn't require user credentials. But the OpCreate is currently not working. Remedy is rejecting it because of access control.
    Problem #1:
    Need to pass the user credential in the SOAP header. Here's the required information in WSDL regarding Authentication.
    <wsdl:operation name="OpCreate">
    <soap:operation soapAction="urn:SimpleWebService/OpCreate" style="document"/>
    <wsdl:input>
    <soap:header message="s:ARAuthenticate" part="parameters" use="literal">
    </soap:header>
    <soap:body use="literal"/>
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    Solution that I have implemented so far:
    I have setup a WSSE file with the simple username/password in the <wsSecurityOut> element and was expecting to see this in the SOAP Header element in the WSDL message. When I look at the SOAP message in the test harness that I have generated in Workshop, I don't see this credential information. I have set the "ws-security-service property to the wsse file. I know that the harness has seen the wsse file since it gives me warning about having the password in simple text without encryption.
    Shouldn't I be seeing this userNameToken information in the SOAP Header when I run the test harness (jws) from workshop? As you can see below (Problem #2) no SOAP header is being generated.
    Problem #2:
    I see that in the SOAP message that test harness is sending wrong "xsi:type" information. It seems to be sending the "StatusType" for all the parameters except the one "Status" where it needs to?
    SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Body>
    <ns:OpCreate xmlns:ns="urn:SimpleWebService">
    <ns:Assigned_To xsi:type="ns:StatusType">donnab</ns:Assigned_To>
    <ns:Short_Description xsi:type="ns:StatusType">testing from weblogic 8.1 SP3 Workshop</ns:Short_Description>
    <ns:Status>New</ns:Status>
    <ns:Submitter xsi:type="ns:StatusType">donnab</ns:Submitter>
    </ns:OpCreate>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    Here's the WSDL where the OpCreate is defined:
    <xsd:element name="OpCreate" type="s:CreateInputMap"/>
    <xsd:complexType name="CreateInputMap">
    <xsd:sequence>
    <xsd:element name="Assigned_To" type="xsd:string"/>
    <xsd:element name="Short_Description" type="xsd:string"/>
    <xsd:element name="Status" type="s:StatusType"/>
    <xsd:element name="Submitter" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>

    I've never been able to see that information because I assume Weblogic server strips it out the minute it receives it and uses it to authenticate the user against a principal in the server.
    You can get ahold of this info, though. In your .jws file, in workshop, add this as a context:
    /** @common:context */
    JwsContext context;
    In your web services method, access the context to get the username:
    context.getCallerPrincipal().getName();
    That will return a String w/ the username passed in the username token.
    -Becky

  • SOAP header in my WSDL ignored by Creator

    The soap:header element from the bind section of my WSDL file is being ignored by Creator.
    Creator is picking up the soap:operation element soapAction=..
    and
    My <input> element for a operation has both soap:body and soap:header elements. The soap:body works.
    Any suggestions?

      Here is a valid Soap Request from XMLSPY and
    a Request from a JSC app and the WSDL used to create the both.
    Sample of Reqest generated by XMLSPY
    <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>
              <m:Security_Request xmlns:m="http://psfttemp.org">
                   <m:Username>String</m:Username>
                   <m:Password>String</m:Password>
              </m:Security_Request>
         </SOAP-ENV:Header>
         <SOAP-ENV:Body>
              <m:Get__CompIntfc__USER_PROFILE xmlns:m="http://psfttemp.org">
                   <m:UserID>String</m:UserID>
              </m:Get__CompIntfc__USER_PROFILE>
         </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    Sample of a Request from  the JSC generated application
    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="http://psfttemp.org">
         <env:Body>
              <ns0:Get__CompIntfc__USER_PROFILE>
                   <ns0:UserID>DPAT</ns0:UserID>
              </ns0:Get__CompIntfc__USER_PROFILE>
         </env:Body>
    </env:Envelope>
    Original WSDL file
    <?xml version="1.0"?>
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:psftci="http://psfttemp.org" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://psfttemp.org">
         <types>
              <s:schema targetNamespace="http://psfttemp.org" elementFormDefault="qualified">
                   <s:element name="Get__CompIntfc__USER_PROFILE">
                        <s:complexType>
                             <s:sequence>
                                  <s:element name="UserID" type="s:string" maxOccurs="1" minOccurs="1"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="Get__CompIntfc__USER_PROFILEResponse">
                        <s:complexType>
                             <s:sequence>
                                  <s:element name="UserID" type="s:string" maxOccurs="1" minOccurs="1"/>
                                  <s:element name="UserDescription" type="s:string" maxOccurs="1" minOccurs="0"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="Security_Request">
                        <s:complexType>
                             <s:sequence>
                                  <s:element name="Username" type="s:string" maxOccurs="1" minOccurs="1"/>
                                  <s:element name="Password" type="s:string" maxOccurs="1" minOccurs="1"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="detail">
                        <s:complexType>
                             <s:sequence>
                                  <s:element name="keyinformation" maxOccurs="1" minOccurs="0"/>
                                  <s:element name="messages" maxOccurs="unbounded" minOccurs="1">
                                       <s:complexType>
                                            <s:sequence>
                                                 <s:element name="type" type="s:string" maxOccurs="1" minOccurs="1"/>
                                                 <s:element name="messagesetnumber" type="s:decimal" maxOccurs="1" minOccurs="0"/>
                                            </s:sequence>
                                       </s:complexType>
                                  </s:element>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
              </s:schema>
         </types>
         <message name="Get__CompIntfc__USER_PROFILESoapIn">
              <part name="parameters" element="psftci:Get__CompIntfc__USER_PROFILE"/>
         </message>
         <message name="Get__CompIntfc__USER_PROFILESoapOut">
              <part name="parameters" element="psftci:Get__CompIntfc__USER_PROFILEResponse"/>
         </message>
         <message name="Security_Request">
              <part name="parameters" element="psftci:Security_Request"/>
         </message>
         <message name="Fault">
              <part name="fault" element="psftci:detail"/>
         </message>
         <portType name="USER_PROFILESoap">
              <operation name="Get__CompIntfc__USER_PROFILE">
                   <input message="psftci:Get__CompIntfc__USER_PROFILESoapIn"/>
                   <output message="psftci:Get__CompIntfc__USER_PROFILESoapOut"/>
                   <fault name="Fault" message="psftci:Fault"/>
              </operation>
         </portType>
         <binding name="USER_PROFILESoap" type="psftci:USER_PROFILESoap">
              <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
              <operation name="Get__CompIntfc__USER_PROFILE">
                   <soap:operation soapAction="#SOAPTOCI#UU_WS" style="document"/>
                   <input>
                        <soap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                        <soap:header xmlns:n1="http://schemas.xmlsoap.org/wsdl/" message="psftci:Security_Request" part="parameters" use="literal" namespace="http://psfttemp.org"/>
                   </input>
                   <output>
                        <soap:body use="literal"/>
                   </output>
                   <fault name="Fault">
                        <soap:fault name="fault" use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://psfttemp.org"/>
                   </fault>
              </operation>
         </binding>
         <service name="USER_PROFILECIService">
              <documentation>This is the service for accessing the USER_PROFILE Component Interface using SOAP requests through PeopleSoft's Integration Broker</documentation>
              <port name="USER_PROFILESoap" binding="psftci:USER_PROFILESoap">
                   <soap:address location="http://localhost:14000/PSIGW/HttpListeningConnector"/>
              </port>
         </service>
         <documentation>This component interface is based off of the USERMAINT component.  It is used for User Profile maintenance.</documentation>
    </definitions>

  • 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