Eclipse, Wsdl2Java and Soap Header

Hi all.
I'm developing the server side of a web service, whose wsdl was given to me by a third party.
The wsdl defines several operations, and in each of them the input consists of a soap:header + a soap:body.
Thus, in my implementation I have to deal with the soap:header, retrevieng the information carried inside.
it's the first time I have to do that since I use Eclipse and its Wsdl2Java utility for skeleton code generation, and I can' t understand if this can be accomplished in this way.
Infact, it seems to me that what eclipse generates is a skeleton by which it's not possible to "inspect-back" the soap:header, as it' already been parsed before (don't know where).
So... the question is: can I develop my Web Service using eclipse (and probably changing something in the way I'm doing) or do I have to do it in another way?
Any help will be very appreciated... thanks in advance!

When invoking the wscompile tool use the option features:
-features:wsi,explicitcontext
for handling the soap:header.
If you type: wscompile.sh -help you can get a listing of the options for the tool

Similar Messages

  • Jdev web service and 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>

    Hello,
    When using OracleAS/JDeveloper 10.1.3.x you are creating Web Service using the standard JAX-RPC API. This API uses the SOAP with Attachments API for Java (SAAJ) to manipulate SOAP messages.
    When dealing with SOAP Header, it is common usage to use the notion of "handler" to set/read header from the messages.
    The chapter "Using JAX-RPC Handler" is a good point to start to see how do deal with this requirement,
    When manipulating the header in the handler, the code will look like:
    SOAPHeader header = message.getSOAPHeader();
    Name headerName = soapFactory.createName("OurCredentials", "ns", "http://schemas.xmlsoap.org/soap/encoding/");
    .. // add sub element
    SOAPHeaderElement headerElement = header.addHeaderElement(headerName);also..
    Could you specify the version of JDeveloper and the type of Web Service that you are using when ascking a question on the forum it help community member to provide a better answer.
    Regards
    Tugdual Grall

  • OWSM: How to encrypt payload and SOAP header?

    Hi,
    Anybody know how I can encrypt the payload and the SOAP header via OWSM? I can only find references on how to do it using SSL. The reason for using OWSM/WS-Security was to move away from using transport based encryption (SSL).
    Regards Pete

    http://download.oracle.com/docs/cd/E10291_01/doc.1013/e10299/policy_steps.htm#sthref612
    if you look at the topic :XML Encrypt
    you will see you can encrypt every part of the xml
    Encrypted Content
    Part of the SOAP envelope to be encrypted. Valid values are: BODY, HEADERS, ENVELOPE, and XPATH. The default is BODY.

  • Create XML with digital sign and SOAP header...

    Hi.
    With ABAP, I need create an XML file iwith SOAP envelope. The message has to be signed and the sign data saved in the ws-security part in the SOAP header. I have to sign the file with a X509v3 certificate in base64.
    Somebody can tell me how can create the SOAP header and sign it with ABAP for the XML.
    Thanks.

    Please refrain from implementing WS-Security yourself.
    NWAS ABAP 7.x provides support for WS-Security - in both roles, as Consumer and Provider.
    The right approach is to generate a proxy based on a given WSDL.
    What kind of (message-based) authentication is demanded by the WS Provider?
    Other info source: see https://wiki.sdn.sap.com/wiki/display/Security/SingleSignonforWeb+Services
    Edited by: Wolfgang Janzen on Jul 8, 2009 12:11 AM

  • Split/Join, Invoke Service and SOAP Header in osb10.3 wls10.3

    Hi gurus,
    Are Split/Join able to invoke external services with a custom SOAP header?
    I have a split join to call 2 external business services in parallel. Those 2 external services requires a custom SOAP Header
    <soapenv:Header>
    <v1:ConsumerRequestHeader>
    <v1:requestSessionID>TEST_1</v1:requestSessionID>
    <v1:requestTimestamp>2011-06-16T16:57:54.943+02:00</v1:requestTimestamp>
    </v1:ConsumerRequestHeader>
    </soapenv:Header>
    All WSDLs were configured by the instructions of this link : http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/eclipsehelp/tasks.html#wp1150628, but in my debuging, the SOAP header is disappeared when calling those external services from the splitjoin. (No problem if designing and testing with the ProxyService. but Proxyservice is useless here because of parallel processing)
    When designing with OSB Workshop IDE, there is no way to pass the custom SOAP header to the "Invoke Service", only the body request/response message.
    My question is, Split/Join automatically uses its header to pass it into the invoke call ?
    Please advise...
    Thanks,

    see this :https://forums.oracle.com/thread/951618
    not the most fancy way, but you can create some sort of  wrapper proxyservice in front of your business service to make it work

  • 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

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

  • Calling A Secured webservice using Username and password in the Soap header

    I want to call a secured webservice.
    The Username and password should be sent with the payload in the SOAP Header
    as
    <wsse:Security S:mustunderstand="0" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <wsse:UsernameToken wsu:Id="SecurityToken-XXXXXXXXXXXXXXXXXXXXXXXXX" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <wsse:Username>uname</wsse:Username>
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">pwd</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    Can you please send me the steps?
    I tried with giving the username and password under Service Account.
    I tried to create a wspolicy under business service. But nothing works...
    Please help me at the earliest.
    Also please give me steps in sequence.

    Now i made sure that the endpoint is available!
    Now am getting this error:
    <soapenv:Fault>
    <faultcode>soapenv:Server</faultcode>
    <faultstring>BEA-380002: localhost1</faultstring>
    <detail>
    <con:fault xmlns:con="http://www.bea.com/wli/sb/context">
    <con:errorCode>BEA-380002</con:errorCode>
    <con:reason>localhost1</con:reason>
    <con:location>
    <con:node>RouteNode1</con:node>
    <con:path>request-pipeline</con:path>
    </con:location>
    </con:fault>
    </detail>
    </soapenv:Fault>
    Also in the invocation trace i can observe the following things:
    Under Invocation Trace:-
    ========================
         Receiving request =====> Initial Message context
         ===============================================
         under added header:-
         ==================
         <soap:Header xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
         </soap:Header>
         under RouteNode1
    ================
         Route to "TargetMyService_BS"
    $header (request):-
    <soap:Header xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    </soap:Header>
    Under Message Context changes:-
    *===============================*
    I can find this element also:-
    con:security>
    *<con:doOutboundWss>false</con:doOutboundWss>*
    *</con:security>*
    eventhough we enabled ws security, how the above tag can be false?
    I think its getting failed to populate the header with the required login credentials.
    The other doubt i have is:-
    =================
    I have chosen the service account type is static...is this right?

  • Post user and pass to SOAP Header message in ABAP Proxy

    Hi Folks!
    I'm trying to post user and pass to SOAP Header on an ABAP proxy. I've already read the thread [Consume web service in ABAP proxy with SOAP header|Re: Consume web service in ABAP proxy with SOAP header; and I see that is possible to manipulate SOAP Header but I cannot understand how I work with function module SDIXML_XML_TO_DOM.
    Do I need pass to parameter xml a complete SOAP Envelope? If it is right how can I get the complete xml message to pass to this parameter? I think I don't need the build the xml strucuture as I did on WebAS 6.40, isn't it?
    Thanks in advanced.

    Hi Rafael,
    I would be interested in the solution... could you please post it into forum.
    Thanks and best regards
    Stefan Bosshard

  • How do pass the UserID and Password in the SOAP header for web services

    I am encountering issues trying to pass the userid and password in the SOAP header when consuming a 3rd party web service.  Rostewitz posted something similiar but I don't know how to type iv_xml.  Any help would be greatly appreciated.
    Thank you,
    jpina

    It helps to post a link to a thread when you refer to it.  If you are trying to implement that solution though, you can look at the parameter of the corresponding method being called.  The parameter has type 'SIMPLE' which means that it is compatible with all of the predefined elementary ABAP types.  In this case, you should use 'STRING'.

  • 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

  • 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

  • WS-security Need to Get Username and Password and time Stamp in SOAP Header

    HI ALL,
    i need to get USERNAME and PWD in my Soap header for consuming Webservice using SAP PI ,
    and my SOAP Header should look like this
    <soapenv:Header>
    <wsse:Security soapenv:mustUnderstand="1"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurityutility-
    1.0.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-
    secext-1.0.xsd">
    <wsu:Timestamp wsu:Id="Timestamp-296915943">
    <wsu:Created>2008-06-05T18:30:59.904Z</wsu:Created>
    <wsu:Expires>2009-06-05T18:35:59.904Z</wsu:Expires>
    </wsu:Timestamp>
    <wsse:UsernameToken wsu:Id="UsernameToken-192809888">
    <wsse:Username>midtier-service</wsse:Username>
    xxxxxxxx: Confidential Green 10
    <wsse:Password Type="http://docs.oasisopen.
    org/wss/2004/01/oasis-200401-wss-username-token-profile-
    1.0#PasswordText">password</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    </soapenv:Header>
    should i need to get some certificates from client and deploy it or should we do anything in SAP PI and send to soap header or can hard code it and send to webservice, please help me in this t
    hanking you
    Sridhar

    i need to get USERNAME and PWD in my Soap header for consuming Webservice using SAP PI ,
    Can be achieved by XSL Mapping or SOAP Axis Adapter. Search on SDN for further details as this has been discussed many a times on the forum.
    should i need to get some certificates from client and deploy it or should we do anything in SAP PI and send to soap header or can hard code it and send to webservice, please help me in this t
    First you need to confirm whether certificates are required or not. Might be the web service is using user id / password security (basic authorization).
    How to use certificates in PI - Search on SAP Help, this has been explained in great details over there.

  • Timestamp and Nonce value in SOAP header

    Hi, can you provide some guidance on how to handle this Oracle SOA suite 11g
    My application was calling an external web service which was just expecting the user name and password. So I was using username_token_client_policy with a csf key
    Now the external web service has changes and they are expecting TimeStamp ( Created & Expires ) and Nonce value to be sent. Below is the format of the SOAP header they are expecting.
    Can someone share what OWSM policy I have to use to build such a SOAP header or should I build the values in my bpel during bpelInputHeaderVariable
    <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <wsu:Timestamp wsu:Id="TS-15">
    <wsu:Created>2013-06-06T22:03:54.397Z</wsu:Created>
    <wsu:Expires>2013-06-06T22:04:54.397Z</wsu:Expires>
    </wsu:Timestamp>
    <wsse:UsernameToken wsu:Id="UsernameToken-14">
    <wsse:Username></wsse:Username>
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"></wsse:Password>
    <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"></wsse:Nonce>
    <wsu:Created>2013-06-06T22:03:49.384Z</wsu:Created>
    </wsse:UsernameToken>
    </wsse:Security>

    i need to get USERNAME and PWD in my Soap header for consuming Webservice using SAP PI ,
    Can be achieved by XSL Mapping or SOAP Axis Adapter. Search on SDN for further details as this has been discussed many a times on the forum.
    should i need to get some certificates from client and deploy it or should we do anything in SAP PI and send to soap header or can hard code it and send to webservice, please help me in this t
    First you need to confirm whether certificates are required or not. Might be the web service is using user id / password security (basic authorization).
    How to use certificates in PI - Search on SAP Help, this has been explained in great details over there.

  • Java Web Service Access SOP Header and SOAP Body

    Hi
    I am newbie to Web Service. I had a Java class and I converted it to Web Service(LoginWebService has methods login, register).
    Now my client is accessing my web services and calling methods login and register.
    Now I want to add few values in SOAP header in client side.
    My Questions:
    1. How can I access the SOAP headers and SOAP Body in my Server Web Service method implementations?
    2. Is there any API that I have to use?
    3. Does anyone have any sample code for these things?
    Thanks

    Seems like the exception handling logic is not sound - but your posting is difficult to read. Please use the *\* tag to mark and end source code snippets.
    Have a look at the sample code in {message:id=4205205} - does a SOAP call using PL/SQL only.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for