Workshop 8.1 WS-Security (WSSE)

Dear Colleagues,
I am new to Bea Platform 8.1 and Workshop 8.1 that comes with it.
I have installed this platform on my Windows 2000 professional machine.
I have started evaluating Workshop 8.1 to see how it can improve the development
of enterprise applications.
I thought I should start with the tutorial that comes with Workshop. This is
also available on-line at http://e-docs.bea.com/workshop/docs81/doc/en/core/index.html.
The problem is that I have been through the tutorial as instructed up to the section
on "Step 6: Web Service Security" but the code does not work. When I run the
TestClient.jws I get an exclamation mark on the requestCreditReport and investigateControl.requestCreditReport
methods in the Message Log on the left pane of the test browser.
On the right pane of the test browser, I have the following exception:
Exception
Submitted at 05 November 2003 21:40:29 o'clock GMT
Exception in requestCreditReport
com.bea.control.ServiceControlException: SERVICE FAULT:
Code:com.bea.wlw.runtime.jws.wssecurity.exception.WLWWSSEException
String:java.io.FileNotFoundException: .\client.jks (The system cannot find the
file specified)
Detail:
END SERVICE FAULT
at com.bea.wlw.runtime.core.control.ServiceControlImpl.invoke(ServiceControlImpl.jcs:853)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:359)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:420)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:393)
at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke(JcsProxy.java:387)
at $Proxy9.requestCreditReport(Unknown Source)
at client.TestClient.requestCreditReport(TestClient.jws:20)
As a result of this, I have dropped a copy of the client.jks in the InvestigateClient
folder which contains the client folder where the TestClient.jws resides. This
makes n o difference. I am sure this problem is due to missing security policy
files but I don't know how to solve it.
If any of you have gone through this tutorial already, you might have come across
this problem. Can you help please.
Many thanks,
Koudry.
[workshop81_wsse_error.txt]

Hi Isi,
I haven't ever tried it, but I highly doubt it was supported.
In WLW 8.1, a non-final version of the WS-Security Spec was supported
and I thought WS-Addressing came after WS-Security.
-Jacobd
Isi Legido wrote:
Hi,
I'm using BEA WebLogic Workshop to develop a process which access external WS (so, I'm developing the client side). For performing that I'm using a JavaControl. I know I can add WS-Security support via de control property "ws-security-service". Is there something similar for WS-Addressing? What about all the other WS-* standards?
Unformtunatelly I can't use AXIS due to the fact my BEA installation uses a certain version of JRockit (I can't change that) which contains a javax.xml.*'s old version, incompatible with AXIS :-(
Thanks a lor, really!! :-)
Isi,

Similar Messages

  • Calling Secured Business Service from OSB

    Hi,
    I am trying to call a Service which is secured.
    the Request SOAP message is like :
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns="urn:crmondemand/ws/activity/10/2004"
    xmlns:act="urn:/crmondemand/xml/activity"
    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    *<soapenv:Header>*
    *     *<wsse:Security>**
    *          *<wsse:UsernameToken>**
    *               *<wsse:Username>USERX</wsse:Username>**
    *               *<wsse:Password type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">PASSWORD</wsse:Password>**
    **          </wsse:UsernameToken>**
    *     </wsse:Security>*
    *</soapenv:Header>*
    <soapenv:Body>
    ========================
    ========================
    </soapenv:Body>
    </soapenv:Envelope>
    I have created a business service and attached the service to Proxy service.
    I am new to OSB.I am unable to change the header data.In the forums i found couple of responses pointing to create
    Policy file or creating service account which were not clear to me.Dear expert , please guide me what exactly need to be done in this case.
    Thanks in advance,
    Regards,
    Chandra

    hi,
    Finally i have done it with the help of documentation.
    solution is :
    In the service configuration --> Policy -->select OWSM policy bindings (your domain should be configured with OWSM extention))
    select predefined oracle/wss_username_token_client_policy from in the OWSM configuration window
    next login to the em console: http://localhost:7001/em
    In the left hand side pane Go to Weblogic Domain -> select <your domain name>
    In the central pallete Weblogic Domain drop down goto secutiry --> Credentials.
    Here create a map with name : oracle.wsm.security (if not exists)
    Create a key by selecting the map as :oracle.wsm.security
    Key name : Sample_KEY
    Type : password
    Username: The username you are expecting in the soap header
    Password: The password you are expecting in the soap header
    Now go back to your service configuration -> Policy -> select the policy that you have added.
    there you can see the properties button enabled.click on it...
    there for the default_value = basic_credentials give the over_ride value as Sample_KEY (the key name you have mapped to the map)
    Regards,
    Chandra sekhar kommalapati

  • Problem in reading the userid from ws-security

    Hi
    I have an ESB with two processes 1.Synchronous 2.Asynchronous.
    In both the processes i do some transformation and invoke the web services.
    First i invoke a synchronous process by posting the XML data with the WS-Security information(useid/password).I get the userID value using below XPath in the XSL
    "ehdr:getRequestHeader'//soap:Header/wsse:Security/wsse:UsernameToken/wsse:Username','wsse=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd; soap=http://schemas.xmlsoap.org/soap/envelope/;')"
    after getting the response from this synchronous process,my asynchronous process will be invoked automatically.
    The problem here is,i am getting the userId value as null in the asynchronous process filter xsl with the same above Xpath.Can any one help me on this.
    thanks in advance.

    what soa suite version are you using?
    there are some issues on setting
    passThruHeaders=true
    to make sure esb is actually propagating header, when transformations are done in ESB layer.
    Should be fixed in 10.1.3.4

  • Problem in updating a java client to invoke data-secured web service

    hello
    i'm following the document 'programming weblogic web services' to use ws-security
    functionality to encrypt & digitally sign SOAP Request & Response
    and I first made a client that calls a secure weblogic web service.
    ( using a keystore having RSA key pair. )
    the code is like below -----------------------------------------------------------------
    final KeyStore keystore = loadKeystore(CLIENT_KEYSTORE, KEYSTORE_PASS);
    TestEJB_Impl service = new TestEJB_Impl("file:///C:/bea/user_projects/domains/FirstDomain/working/TestEJB_with_Security_surpport.wsdl");
    WebServiceContext context = service.context();
    System.out.println("passing context info to the client");
    X509Certificate clientcert;
    clientcert = getCertificate(CLIENT_KEYNAME, keystore);
    PrivateKey clientprivate;
    clientprivate = getPrivateKey(CLIENT_KEYNAME, CLIENT_KEYPASS, keystore);
    WebServiceSession session = context.getSession();
    session.setAttribute(WSSEClientHandler.CERT_ATTRIBUTE, clientcert);
    session.setAttribute(WSSEClientHandler.KEY_ATTRIBUTE, clientprivate);
    UserInfo ui = new UserInfo(AUTHENTICATION_USER, AUTHENTICATION_USER_PASS);
    session.setAttribute(WSSEClientHandler.REQUEST_USERINFO, ui);
    TestEJBPort port = service.getTestEJBPort();
    String result = null;
    result = port.firstMethodTest("A123");
    System.out.println(result);
    and there comes error stacktrace like below ------------------------------
    <Info> <WebService> <BEA-220024> <Handler
    weblogic.webservice.core.handler.WSSEClientHandler threw an exception from its
    h
    andleRequest method. The exception was:
    weblogic.xml.security.SecurityConfigurationException: Failed adding encryption
    t
    o request - with nested exception:
    [weblogic.xml.security.SecurityProcessingException: No keywrapping algorithm ava
    ilable for DSA keys].>
    Exception in thread "main" java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.so
    ap.SOAPFaultException: Exception during processing: weblogic.xml.security.Securi
    tyConfigurationException: Failed adding encryption to request - with nested exce
    ption:
    [weblogic.xml.security.SecurityProcessingException: No keywrapping algorithm ava
    ilable for DSA keys] (see Fault Detail for stacktrace)
    Detail:
    <detail>
    <bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webse
    rvice/fault/1.0.0">
    </bea_fault:stacktrace>weblogic.xml.security.SecurityProcessingException: No
    ke
    ywrapping algorithm available for DSA keys
    at weblogic.xml.security.wsse.v200207.SecurityImpl.getWrappingAlgorithm(
    SecurityImpl.java:200)
    at weblogic.xml.security.wsse.v200207.SecurityImpl.addEncryption(Securit
    yImpl.java:175)
    at weblogic.xml.security.wsse.v200207.SecurityImpl.addEncryption(Securit
    yImpl.java:153)
    i am using RSA key pair but, when i use DSA key pair , the error message is same
    as above.
    what is problem? and what am i missing?

    Hello,
    The current implementation only supports RSA key types as legal
    wrapping. It is on the TODO list to expand this to other algorithms.
    Regards,
    Bruce
    dolso wrote:
    >
    hello
    i'm following the document 'programming weblogic web services' to use ws-security
    functionality to encrypt & digitally sign SOAP Request & Response
    and I first made a client that calls a secure weblogic web service.
    ( using a keystore having RSA key pair. )
    the code is like below -----------------------------------------------------------------
    final KeyStore keystore = loadKeystore(CLIENT_KEYSTORE, KEYSTORE_PASS);
    TestEJB_Impl service = new TestEJB_Impl("file:///C:/bea/user_projects/domains/FirstDomain/working/TestEJB_with_Security_surpport.wsdl");
    WebServiceContext context = service.context();
    System.out.println("passing context info to the client");
    X509Certificate clientcert;
    clientcert = getCertificate(CLIENT_KEYNAME, keystore);
    PrivateKey clientprivate;
    clientprivate = getPrivateKey(CLIENT_KEYNAME, CLIENT_KEYPASS, keystore);
    WebServiceSession session = context.getSession();
    session.setAttribute(WSSEClientHandler.CERT_ATTRIBUTE, clientcert);
    session.setAttribute(WSSEClientHandler.KEY_ATTRIBUTE, clientprivate);
    UserInfo ui = new UserInfo(AUTHENTICATION_USER, AUTHENTICATION_USER_PASS);
    session.setAttribute(WSSEClientHandler.REQUEST_USERINFO, ui);
    TestEJBPort port = service.getTestEJBPort();
    String result = null;
    result = port.firstMethodTest("A123");
    System.out.println(result);
    and there comes error stacktrace like below ------------------------------
    <Info> <WebService> <BEA-220024> <Handler
    weblogic.webservice.core.handler.WSSEClientHandler threw an exception from its
    h
    andleRequest method. The exception was:
    weblogic.xml.security.SecurityConfigurationException: Failed adding encryption
    t
    o request - with nested exception:
    [weblogic.xml.security.SecurityProcessingException: No keywrapping algorithm ava
    ilable for DSA keys].>
    Exception in thread "main" java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.so
    ap.SOAPFaultException: Exception during processing: weblogic.xml.security.Securi
    tyConfigurationException: Failed adding encryption to request - with nested exce
    ption:
    [weblogic.xml.security.SecurityProcessingException: No keywrapping algorithm ava
    ilable for DSA keys] (see Fault Detail for stacktrace)
    Detail:
    <detail>
    <bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webse
    rvice/fault/1.0.0">
    </bea_fault:stacktrace>weblogic.xml.security.SecurityProcessingException: No
    ke
    ywrapping algorithm available for DSA keys
    at weblogic.xml.security.wsse.v200207.SecurityImpl.getWrappingAlgorithm(
    SecurityImpl.java:200)
    at weblogic.xml.security.wsse.v200207.SecurityImpl.addEncryption(Securit
    yImpl.java:175)
    at weblogic.xml.security.wsse.v200207.SecurityImpl.addEncryption(Securit
    yImpl.java:153)
    i am using RSA key pair but, when i use DSA key pair , the error message is same
    as above.
    what is problem? and what am i missing?

  • WS-Security Username Token issue with soap receiver

    Hi All,
    I have Proxy to SOAP scenario. Receiver web service is expecting below message in the soap header for authentication purpose.
    <soapenv:Header>
          <wsse:Security>
    <wsse:UsernameToken>
    <wsse:Username>username</wsse:Username>
    <wsse:Password Type="PasswordText">Password< wsse:Password>
    </wsse:UsernameToken>
          </wsse:Security>
       </soapenv:Header>
    User will trigger the message from ECC using some transaction. I need to pass this triggering person’s username and password to soap header dynamically. There are more than 2000 users in the system.
    How can I retrieve this username and password and bind it to <wsse:Security> node?
    Is it possible to achieve?
    Please note: User’s details will not come in the message payload. I cannot user look up here.
    Regards,
    Muni

    Asked web service team to use one service account for authentication. Used this blog How to Configure AXIS Framework for Authentication Using the "wsse" Security Standard in SAP PI to configure axis framework. Now we are able to send message to web service.
    Regards,
    Muni.

  • Web Service Security Username Token Issue

    Hi,
    I am trying to implement WS-Security (Username Token) on web services deployed on Weblogic Server 8.1 (sp4). The deployment works fine but whenever I try to invoke the service using auto generated client stub (created using clientgen) or weblogic server console (service test page) , I get the following error:
    <Nov 8, 2006 12:01:46 PM GMT+05:30> <Info> <WebService> <BEA-220024> <Handler weblogic.webservice.core.handler.WSSEClientHandler threw an exception from its handleRequest method. The exception was:
    java.lang.AssertionError: Bad password type: wsse:PasswordText.>
    Failed to create web service client:java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.soap.SOAPFaultException: Exception during processing: java.lang.AssertionError: Bad password type: wsse:PasswordText (see Fault Detail for stacktrace)
    Detail:
    <detail>
    <bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0">java.lang.AssertionError: Bad password type: wsse:PasswordText
    at weblogic.xml.security.wsse.v200207.UsernameTokenImpl.<init>(UsernameTokenImpl.java:64)
    at weblogic.xml.security.wsse.v200207.SecurityElementFactoryImpl.createToken(SecurityElementFactoryImpl.java:59)
    at weblogic.webservice.core.handler.WSSEClientHandler.processSpecs(WSSEClientHandler.java:300)
    at weblogic.webservice.core.handler.WSSEClientHandler.handleRequest(WSSEClientHandler.java:100)
    at weblogic.webservice.core.HandlerChainImpl.handleRequest(HandlerChainImpl.java:143)
    at weblogic.webservice.core.ClientDispatcher.send(ClientDispatcher.java:231)
    at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:143)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:457)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:443)
    at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:303)
    at com.cts.sipservices.implementation.client.MrmPartyServiceImplementationPort_Stub.getParty(MrmPartyServiceImplementationPort_Stub.java:46)
    at com.cts.sipservicesclient.client.SecureClient.<init>(SecureClient.java:76)
    at com.cts.sipservicesclient.client.SecureClient.main(SecureClient.java:38)
    </bea_fault:stacktrace>
    </detail>; nested exception is:
    javax.xml.rpc.soap.SOAPFaultException: Exception during processing: java.lang.AssertionError: Bad password type: wsse:PasswordText (see Fault Detail for stacktrace)
    This is the ‘security’ tag of my ‘web-services.xml’:
    <security>
    <spec:SecuritySpec xmlns:spec="http://www.openuri.org/2002/11/wsse/spec"
    Namespace="http://schemas.xmlsoap.org/ws/2002/07/secext"
    Id="default-spec">
    <spec:UsernameTokenSpec xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext"
    PasswordType="wsse:PasswordText">
    </spec:UsernameTokenSpec>
    </spec:SecuritySpec>
    </security>
    Thanks

    Apply these debug flags, to get some more debug information from WSSE server side processing following debug flags are helpful:
    -Dweblogic.webservice.security.debug=true
    -Dweblogic.webservice.security.verbose=true

  • SOAP Request with Web Service Security

    Hi masters of XI,
    the Oasis standard for web services security saids that exists three levels of security for web services, at higher level is Encryption, middle level is signature and at lower level is authentication with username and password inside the soap envelope.
    I need to do a SOAP Request signed with a X.509 certificate and username and password too in SAP PI 7.0 SP11. I can sign the request with X.509 certificate without problems but i can't authenticate the request with username and password in usernametoken element like saids the Oasis standard
    <wsse:Security>
    <wsse:UsernameToken>
    <wsse:Username>XXXX</wsse:Username>
    <wsse:Password>XXXXXXXXX</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    How can we send UserNameToken's elements inside SOAP web service envelope
    signing with X.509 certificate also? There are any way to do it in the
    receiver agreement or receiver SOAP adapter?
    thanks.

    Hi,
    thank you very much for your answers.
    I have solved the SSL comunication and i can sign with X.509 certificates. My problem is that in the SOAP envelope of resquest signed only travels the X.509 certificate and I need to send the username security token (wsse:UsernameToken) also.
    <wsse:Security>
    <wsse:UsernameToken>
    <wsse:Username>XXXX</wsse:Username>
    <wsse:Password>XXXXXXXXX</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    I can't find the solution to do it. The Netweaver documentation says that Netweaver is able to sign SOAP request with X.509 certificates and is able too for using UsernameToken as part of Oasis standard for web service security. In abap stack of NW you can assign a security profile to a web service call for signing the message or authenticate it with username/password inside SOAP envelope, but in java stack of XI i think that there is no way to do it.
    This is my Request:
    <?xml version="1.0" encoding="utf-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Header>
        <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1">
          <wsse:BinarySecurityToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="CertId-71968700">MIIHdTCCBl2gAwIBAgIQOq4nmg5zi4NGsIGjPUZVuTANBgkqhkiG9w0BAQUFADCCAT4xCzAJBgNVBAYTAkVTMTswOQYDVQQKEzJBZ...8d4pAJYk=</wsse:BinarySecurityToken>
          <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Signature-104376803">
            <ds:SignedInfo>
              <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
              <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
              <ds:Reference URI="#id-104309952">
                <ds:Transforms>
                  <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
                </ds:Transforms>
                <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
                <ds:DigestValue>R6WE9gs+l496jHCgslgALWswEnE=</ds:DigestValue>
              </ds:Reference>
              <ds:Reference URI="#Timestamp-104310599">
                <ds:Transforms>
                  <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
                </ds:Transforms>
                <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
                <ds:DigestValue>aiCTZ0WwiZQEv8zVmmf8GLu/bYA=</ds:DigestValue>
              </ds:Reference>
            </ds:SignedInfo>
            <ds:SignatureValue>YR9Q5oUA6kFFmPYOIOQPTOgTgapMbkmgdlDM/TZJ2CS8ENAntfsnmpEbpUgOPUVMkgaECog0OKvlADHP0HvJtPdm2NJljZNCCgrk3hlmmtkXkRauVuH5KRiHE5NeWT4+Uspp3ashebu0IuOO66zt4Q=</ds:SignatureValue>
            <ds:KeyInfo Id="KeyId-104377209">
              <wsse:SecurityTokenReference xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="STRId-104377346">
                <wsse:Reference URI="#CertId-71968700" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
              </wsse:SecurityTokenReference>
            </ds:KeyInfo>
          </ds:Signature>     
          <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Timestamp-104310599">
            <wsu:Created>2008-01-16T21:28:44.081Z</wsu:Created>
            <wsu:Expires>2008-01-16T21:33:44.081Z</wsu:Expires>
          </wsu:Timestamp>
        </wsse:Security>
      </soapenv:Header>
    And this is the request I need:
    <?xml version="1.0" encoding="utf-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Header>
        <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1">
          <wsse:BinarySecurityToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="CertId-71968700">MIIHdTCCBl2gAwIBAgIQOq4nmg5zi4NGsIGjPUZVuTANBgkqhkiG9w0BAQUFADCCAT4xCzAJBgNVBAYTAkVTMTswOQYDVQQKEzJBZ...8d4pAJYk=</wsse:BinarySecurityToken>
          <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Signature-104376803">
            <ds:SignedInfo>
              <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
              <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
              <ds:Reference URI="#id-104309952">
                <ds:Transforms>
                  <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
                </ds:Transforms>
                <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
                <ds:DigestValue>R6WE9gs+l496jHCgslgALWswEnE=</ds:DigestValue>
              </ds:Reference>
              <ds:Reference URI="#Timestamp-104310599">
                <ds:Transforms>
                  <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
                </ds:Transforms>
                <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
                <ds:DigestValue>aiCTZ0WwiZQEv8zVmmf8GLu/bYA=</ds:DigestValue>
              </ds:Reference>
            </ds:SignedInfo>
            <ds:SignatureValue>YR9Q5oUA6kFFmPYOIOQPTOgTgapMbkmgdlDM/TZJ2CS8ENAntfsnmpEbpUgOPUVMkgaECog0OKvlADHP0HvJtPdm2NJljZNCCgrk3hlmmtkXkRauVuH5KRiHE5NeWT4+Uspp3ashebu0IuOO66zt4Q=</ds:SignatureValue>
            <ds:KeyInfo Id="KeyId-104377209">
              <wsse:SecurityTokenReference xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="STRId-104377346">
                <wsse:Reference URI="#CertId-71968700" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
              </wsse:SecurityTokenReference>
            </ds:KeyInfo>
          </ds:Signature>
    <!-- THIS IS THE PART I NEED -->
    <wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-104312926">
            <wsse:Username>xxxxxxx</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"/>
          </wsse:UsernameToken>
    <!--  -->
    <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Timestamp-104310599">
            <wsu:Created>2008-01-16T21:28:44.081Z</wsu:Created>
            <wsu:Expires>2008-01-16T21:33:44.081Z</wsu:Expires>
          </wsu:Timestamp>
        </wsse:Security>
      </soapenv:Header>

  • Unable to add security token for identity

    Hi all,
    I am trying to implement a web service with username token authentication. I have defined the ws -policies in the wsdl, and checked the Process Security Header checkbox in the proxy configuration. But when I invoke the proxy through test console and pass the full soap envelope , I am getting an "Unable to add security token for identity" error
    This is how the soap header looks from the request document part of the test console:
         <soap:Header>
         <wsse:Security>
         <wsse:UsernameToken>
         <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">yyyyyy</wsse:Password>
         </wsse:UsernameToken>
         </wsse:Security>
         </soap:Header>
         <soap:Body>
    I have configured the user at alsb security configuration and added an acces policy stating that the proxy can be accessed only by user "xxxx"
    Please help
    -Atheek

    Mostafa ,
    This points to a misconfiguration of your security. Possible causes are:
    * There is not a valid RSA key to sign the SAML token with.
    * The SAML CredentialMapper is missing
    * There is no Relying Party (rp) configured for SAML Credential Mapper that matches your producer
    * The producer is using User Name Token and you have no configured the DefaultCredentialMapper to allow for UserNameToken.
    Good Luck,
    Nate
    Edited by: user650654 on Sep 9, 2008 4:31 AM

  • Problems with JAX-WS when using security (e.g. username token profile)

    Hello,
    I am deploying a web service on weblogic 11g (10.3.1) with this policy:
    @Policy(uri = "policy:Wssp1.2-2007-Https-UsernameToken-Plain.xml",attachToWsdl=true)
    I have another web application as client which is using a JAX-WS SOAP handler to communicate with web service
    and everything works fine when my client is deployed on tomcat 6 (JRE 6) (anthentication goes through)
    The handleMessage() method of my handler is posted here :
         public boolean handleMessage(SOAPMessageContext context) {
         m_logger.debug("UserNameTokenHandler handleMessage() called");
         Boolean outboundProperty = (Boolean) context.get (MessageContext.MESSAGE_OUTBOUND_PROPERTY);
         SOAPMessage message =context.getMessage();
    if (outboundProperty.booleanValue()) {
         m_logger.debug("\n (client protocol handler) Outbound message:");
    try {
         SOAPEnvelope envelope = context.getMessage().getSOAPPart().getEnvelope();
         SOAPHeader header = envelope.getHeader();
         if (header == null ) {
              header = envelope.addHeader();
         SOAPElement security = header.addChildElement("Security", "wsse", WSSE_NAMESPACE);
         SOAPElement usernameToken = security.addChildElement("UsernameToken", "wsse");
         usernameToken.addAttribute(new QName("xmlns:wsu"), WSU_NAMESPACE);
         SOAPElement username = usernameToken.addChildElement("Username", "wsse");
         username.addTextNode(user);
         SOAPElement password = usernameToken.addChildElement("Password", "wsse");
         password.addTextNode(pass);
         } catch (Exception e) {
              m_logger.error("Failed to add username token profile security", e);
    } else {
         m_logger.debug("\n (client protocol handler) Inbound message:");
    return true;
    but when I deploy the same client on weblogic server it fails to communicate with my web service with this error:
    javax.xml.ws.soap.SOAPFaultException: Unable to add security token for identity, token uri =http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken
    I noticed Weblogic has some packages to handle security like:
    weblogic.wsee.security.unt.ClientUNTCredentialProvider
    weblogic.xml.crypto.wss.provider.CredentialProvider
    weblogic.xml.crypto.wss.WSSecurityContext
    So I added another mechanism using weblogic package to add username password to SOAP header
    Map<String, Object> request = ((BindingProvider) proxy).getRequestContext();
              if (connectInfo.get("username") != null && connectInfo.get("password") != null) {
              List<CredentialProvider> credProviders = new ArrayList<CredentialProvider>();
              //client side UsernameToken credential provider
              CredentialProvider cp = new ClientUNTCredentialProvider((String)connectInfo.get("username"),
                        (String)connectInfo.get("password"));
              credProviders.add(cp);
              request.put(WSSecurityContext.CREDENTIAL_PROVIDER_LIST, credProviders);      
    This seems to be ok but only for weblogic.
    I don't want to have one client for deploying on weblogic and another one for JAX-WS
    I suppose weblogic follows the standard and should support the original approach.
    Is this an incompatibly issue or am i missing something

    In one of WLP Pageflows, I invoke a SOA BPEL WebService that needs Security Header like the way you have. I have my own Handler class and I call the below private method in handleMessage(...) and so far it is working fine. Security Header is adding fine.
    One difference I could see in your method and my method is when we create SOAPElement for "Security" Tag, at the time of creation itself, I pass the third argument also that is the namespace. I remember vaguely, when I used code like yours, like first instantiate with only 2 args. Then set the namespace. It did not work. So I used the API, that takes the namespace as third argument.
    So try something like below. This is a working code snipped deployed on WLP 10.3 (WLP is on top of WLS 10.3).
    Thanks
    Ravi Jegga
         private void setSOAPSecurityHeader(SOAPEnvelope soapEnvelope) throws Exception {
              try {
                   //soapEnvelope.addNamespaceDeclaration("soap", "http://schemas.xmlsoap.org/soap/envelope/");
                   soapEnvelope.addNamespaceDeclaration("wsu", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");
                   SOAPHeader header = soapEnvelope.addHeader();
                   String namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
                   SOAPElement securityElement = header.addHeaderElement(soapEnvelope.createName("Security", "wsse", namespace));
                   securityElement.addNamespaceDeclaration("", namespace);
                   //securityElement.addNamespaceDeclaration("env", "http://schemas.xmlsoap.org/soap/envelope/");
                   SOAPElement usernameTokenElement = securityElement.addChildElement(soapEnvelope.createName("UsernameToken", "wsse", namespace));
                   usernameTokenElement.addNamespaceDeclaration("", namespace);
                   SOAPElement usernameElement = usernameTokenElement.addChildElement(soapEnvelope.createName("Username"));
                   SOAPElement passwordElement = usernameTokenElement.addChildElement(soapEnvelope.createName("Password"));
                   // For Testing Purposes only hardcoded this username and password values. Later on this may be set dynamically
                   usernameElement.setValue("xxxxxxx");
                   passwordElement.setValue("yyyyyyy");
                   //SOAPBody soapBody = soapEnvelope.getBody();
                   //SOAPHeader soapHeader = soapEnvelope.getHeader();
              } catch (Exception e) {
                   // Handle This error in the main method that is calling this private method. So just return the Exception as it is...
                   throw e;
         }

  • ColdFusion failed security in invoking a WebSphere web service

    Hello,
    I tried to call a web service hosted in a IBM WebSphere
    server, but could not pass WebSphere's security framework. After
    some talking with the guys in the WebSphere side, I'm not sure
    whether this is possible in ColdFusion because they ask for a
    <wsse:UsernameToken> in the SOAP envelope header. We did some
    testing, and they confirmed that ColdFusion could talk to the web
    service, by could not pass security validation. Would someone help
    me here? Must it be done in Java?
    Here is my calling syntax in ColdFusion:
    <cfinvoke webservice="https://WebServiceURL?wsdl"
    method="myMethod" username="myUserName" password="myPassword"
    returnVariable="ReturnCode">
    <cfinvokeargument name="ParaName"
    value="ParameterValue">
    </cfinvoke>
    The web service is locked down, so the calling client must
    issue a SOAP message containing VALID security extensions:
    <soapenv:Envelope
    xmlns:soapenv="
    http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ws="
    http://somedomain"
    xmlns:wsse="
    http://schemas.xmlsoap.org/ws/2002/07/secext">
    <soapenv:Header>
    <wsse:Security>
    <wsse:UsernameToken>
    <wsse:Username>myUserName</wsse:Username>
    <wsse:Password>myPassword</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    </soapenv:Header>
    <soapenv:Body>
    ... REMOVED as this depends on your individual SOAP service
    </soapenv:Body>
    </soapenv:Envelope>
    The guys at WebSphere said that my ColdFusion SOAP call
    probably did not have the envelope security header. IIs there a way
    to capture the underlying actual SOAP call format? Here is the
    error msg:
    AxisFault
    faultCode: {
    http://schemas.xmlsoap.org/ws/2003/06/secext}FailedAuthentication
    faultSubcode:
    faultString: WSEC5075E: No security token found which
    satisfies any one of AuthMethods.
    faultActor:
    faultNode:
    faultDetail:
    http://xml.apache.org/axis/}stackTrace:WSEC5075E:
    No security token found which satisfies any one of AuthMethods.
    at
    org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221)
    at org.apache.axis
    Larry

    Sadly, byrning's reply ended with just "how to use CF with stupid WSSE security", which leads readers to wonder if he meant to share more. For instance, was that supposed to be a link to a blog entry?
    I did some digging, and I found an old google cache of another version of this forum, and it showed that he had included the following code, which somehow never made it into the message here:
    <cfset myUsername = "yourUsername" />
    <cfset myPassword = "yourPassword" />
    <cfset myDate = DateFormat(DateConvert("local2Utc", now()),
    "yyyy-mm-ddThh:mm:ssZ")>
    <cfset myNonce = createPIN(33)> <!--- this is just a random alpha numeric
    string 33 chars long - got the function at cflib.org --->
    <cfset myPasswordDigest = ToBase64(Hash(myNonce & myDate & myPassword ))>
    <cfscript>
            myObj = createObject("webservice", "http://urltoYourService?wsdl");
            headerElement = createObject("java",
    "org.apache.axis.message.SOAPHeaderElement");
            headerElement.init("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wss
    ecurity-secext-1.0.xsd", "wsse:Security");
            headerElement.addChildElement("wsse:UsernameToken");
            headerElement.getFirstChild().addChildElement("wsse:Username").setValue(myUsern
    ame);
            mypass = headerElement.getFirstChild().addChildElement("wsse:Password");
            mypass.setValue(myPasswordDigest);
            mypass.setAttribute("Type", "wsse:PasswordDigest");
            headerElement.getFirstChild().addChildElement("wsse:Nonce").setValue(
    ToBase64(Hash(myNonce, "SHA")) );
            myCreated = headerElement.getFirstChild().addChildElement("wsu:Created");
            myCreated.setValue(myDate);
            myCreated.setAttribute("xmlns:wsu",
    "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-ut....
    xsd");
            headerElement.setMustUnderstand(1);
            headerElement.setActor("");
            myObj.setHeader(headerElement);
            result = myObj.methodtoCall(param1="yadda", param2="yadda")
    </cfscript>    

  • (264361962) Q ADVC-27 How do you pass the security info to access the EJB?

    Q<ADVC-27> How do you pass the security info to access the EJB?
    A<ADVC-27> Authentication for web service users must occur at the web layer. This
    means providing appropriate web resource definitions and restrictions in the web.xml
    file for your project. The most common and useful form of security for application
    interaction is via client-side certificates. Then the client identity is transmitted
    to the EJB is the same way as in regular J2EE environments. There is a complete description
    on security on e-docs:
    http://edocs.bea.com/workshop/docs70/help/guide/security/ovwSecurity.html
    Adam

    You need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    (119093)

  • Difficulty in WS_security

    I am using Workshop vesrion 8.1.4. I have coded an application exactly similar to the security.wsse.reqResp.mycompany.MyCompany & security.wsse.reqResp.client.Client in sample directory which comes with Workshop. I am using the exactly the same key store used in the sample. The sample programs work fine, while something I did exactly similar to samples is not working.
    The problem is when I run the client, it does not seem to apply the policies resulting in the error
    below. I am not sure why it is not applying signature as per the policy file defined for the control used in the client. Thnakful, if some one can help. Can provide more info, if needed. Thnaks.
    <faultcode> SOAP-ENV:Client </faultcode>
    <faultstring> EJB Exception: ; nested exception is:
    com.bea.wlw.runtime.jws.wssecurity.exception.WLWWSSEException: Policy requires Message to be signed, Message was not signed. </faultstring>
    <detail>
    java.rmi.RemoteException: EJB Exception: ; nested exception is:
    com.bea.wlw.runtime.jws.wssecurity.exception.WLWWSSEException: Policy requires Message to be signed, Message was not signed.
    at weblogic.ejb20.internal.EJBRuntimeUtils.throwRemoteException(EJBRuntimeUtils.java:102)
    On the service side, I have the following jws file:
    package security.wsse.reqresp.service;
    * @jws:ws-security-service file="MyCompanySecurityPolicy.wsse"
    * @common:target-namespace namespace="http://workshop.bea.com/MyCompany"
    public class GreetGuest implements com.bea.jws.WebService
    static final long serialVersionUID = 1L;
    * @common:operation
    public String SayHello(String aGuest)
    return "Welcome " + aGuest + " This is a Secure Service";
    The policy is exactly as in the sample ( in fact I cut and pasted from sample)
    <wsSecurityPolicy xsi:schemaLocation="WSSecurity-policy.xsd" xmlns="http://www.bea.com/2003/03/wsse/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <wsSecurityOut>
    <!--
    Accompany the SOAP message with a valid username and password
    -->
    <userNameToken>
    <userName>weblogic</userName>
    <password type="TEXT">weblogic</password>
    </userNameToken>
    <!--
    Encrypt the SOAP message with the recipient's (MyCompany.jws) public key.
    Only the recipient's private key can decrypt it.
    Ensures the confidentiality of the SOAP message.
    (This process requires that the sender's keystore already contains
    a digital certificate containing the recients public key.)
    -->
              <encryption>
                   <encryptionKey>
                        <alias>mycompany</alias>
                   </encryptionKey>
              </encryption>
    <!--
    Sign the SOAP message with the sender's (Client.jws) private key.
    Only the sender's public key can validate the signature.
    Ensures the authenticity of the sender, i.e., that the sender is
    in fact the source of the SOAP message.
    -->
    <signatureKey>
                   <alias>client1</alias>
                   <password>password</password>
              </signatureKey>
         </wsSecurityOut>
    <wsSecurityIn>
    <!--
    Incoming SOAP message must be accompanied by a valid username
    and password.
    -->
              <token tokenType="username"/>
    <!--
    Incoming SOAP messages must be encrypted with client.jws's
    public key. The alias and password to access the client.jws's
    decrypting private key in the keystore are provided by
    the <decryptionKey> element below.
    -->
              <encryptionRequired>
                   <decryptionKey>
                        <alias>client1</alias>
                        <password>password</password>
                   </decryptionKey>
              </encryptionRequired>
    <!--
    Incoming SOAP messages must be digitally signed with the sender's
    private key.
    The sender's public key is used to validate the signature.
    -->
              <signatureRequired>true</signatureRequired>
    </wsSecurityIn>
    <!--
    Look for the client.jks keystore in the default location, the server domain
    root, in this case, BEA_HOME\weblogic81\samples\domains\workshop.
    -->
         <keyStore>
    <keyStoreLocation>samples_client.jks</keyStoreLocation>
    <keyStorePassword>password</keyStorePassword>
    </keyStore>
    </wsSecurityPolicy>
    on the client side:
    I have jws :
    package security.wsse.reqresp.client;
    * @common:target-namespace namespace="http://workshop.bea.com/Client"
    public class Client implements com.bea.jws.WebService
    * @common:control
    private security.wsse.reqresp.client.SecuredGreeting securedGreetingControl;
    * @common:control
    private security.wsse.reqresp.client.GreetGuest greetGuestControl;
    static final long serialVersionUID = 1L;
    * @common:operation
    public void getGreeted(String myName)
    String aReturnValue = securedGreetingControl.SayHello(myName);
    System.out.println("Message from Service=" + aReturnValue );
    The control in the client , I used is:
    package security.wsse.reqresp.client;
    * @jc:location http-url="http://localhost:7001/TestWebServicesProject/security/wsse/reqresp/service/GreetGuest.jws"
    * @jc:wsdl file="#GreetGuestWsdl"
    * @editor-info:link autogen-style="java" source="GreetGuestContract.wsdl" autogen="true"
    public interface SecuredGreeting extends com.bea.control.ControlExtension, com.bea.control.ServiceControl
    public java.lang.String SayHello (java.lang.String aGuest);
    static final long serialVersionUID = 1L;
    /** @common:define name="GreetGuestWsdl" value::
    <?xml version="1.0" encoding="utf-8"?>
    <!-- @editor-info:link autogen="true" source="GreetGuest.jws" -->
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:conv="http://www.openuri.org/2002/04/soap/conversation/" xmlns:cw="http://www.openuri.org/2002/04/wsdl/conversation/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:jms="http://www.openuri.org/2002/04/wsdl/jms/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://workshop.bea.com/MyCompany" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://workshop.bea.com/MyCompany">
    <types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://workshop.bea.com/MyCompany" xmlns:s="http://www.w3.org/2001/XMLSchema">
    <s:element name="SayHello">
    <s:complexType>
    <s:sequence>
    <s:element name="aGuest" type="s:string" minOccurs="0"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="SayHelloResponse">
    <s:complexType>
    <s:sequence>
    <s:element name="SayHelloResult" type="s:string" minOccurs="0"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="string" nillable="true" type="s:string"/>
    </s:schema>
    </types>
    <message name="SayHelloSoapIn">
    <part name="parameters" element="s0:SayHello"/>
    </message>
    <message name="SayHelloSoapOut">
    <part name="parameters" element="s0:SayHelloResponse"/>
    </message>
    <message name="SayHelloHttpGetIn">
    <part name="aGuest" type="s:string"/>
    </message>
    <message name="SayHelloHttpGetOut">
    <part name="Body" element="s0:string"/>
    </message>
    <message name="SayHelloHttpPostIn">
    <part name="aGuest" type="s:string"/>
    </message>
    <message name="SayHelloHttpPostOut">
    <part name="Body" element="s0:string"/>
    </message>
    <portType name="GreetGuestSoap">
    <operation name="SayHello">
    <input message="s0:SayHelloSoapIn"/>
    <output message="s0:SayHelloSoapOut"/>
    </operation>
    </portType>
    <portType name="GreetGuestHttpGet">
    <operation name="SayHello">
    <input message="s0:SayHelloHttpGetIn"/>
    <output message="s0:SayHelloHttpGetOut"/>
    </operation>
    </portType>
    <portType name="GreetGuestHttpPost">
    <operation name="SayHello">
    <input message="s0:SayHelloHttpPostIn"/>
    <output message="s0:SayHelloHttpPostOut"/>
    </operation>
    </portType>
    <binding name="GreetGuestSoap" type="s0:GreetGuestSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <operation name="SayHello">
    <soap:operation soapAction="http://workshop.bea.com/MyCompany/SayHello" style="document"/>
    <input>
    <soap:body use="literal"/>
    </input>
    <output>
    <soap:body use="literal"/>
    </output>
    </operation>
    </binding>
    <binding name="GreetGuestHttpGet" type="s0:GreetGuestHttpGet">
    <http:binding verb="GET"/>
    <operation name="SayHello">
    <http:operation location="/SayHello"/>
    <input>
    <http:urlEncoded/>
    </input>
    <output>
    <mime:mimeXml part="Body"/>
    </output>
    </operation>
    </binding>
    <binding name="GreetGuestHttpPost" type="s0:GreetGuestHttpPost">
    <http:binding verb="POST"/>
    <operation name="SayHello">
    <http:operation location="/SayHello"/>
    <input>
    <mime:content type="application/x-www-form-urlencoded"/>
    </input>
    <output>
    <mime:mimeXml part="Body"/>
    </output>
    </operation>
    </binding>
    <service name="GreetGuest">
    <port name="GreetGuestSoap" binding="s0:GreetGuestSoap">
    <soap:address location="http://localhost:7001/TestWebServicesProject/security/wsse/reqresp/service/GreetGuest.jws"/>
    </port>
    <port name="GreetGuestHttpGet" binding="s0:GreetGuestHttpGet">
    <http:address location="http://localhost:7001/TestWebServicesProject/security/wsse/reqresp/service/GreetGuest.jws"/>
    </port>
    <port name="GreetGuestHttpPost" binding="s0:GreetGuestHttpPost">
    <http:address location="http://localhost:7001/TestWebServicesProject/security/wsse/reqresp/service/GreetGuest.jws"/>
    </port>
    </service>
    </definitions>
    The policy file for the control is:
    <wsSecurityPolicy xsi:schemaLocation="WSSecurity-policy.xsd" xmlns="http://www.bea.com/2003/03/wsse/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <wsSecurityOut>
    <!--
    Accompany the SOAP message with a valid username and password
    -->
    <userNameToken>
    <userName>weblogic</userName>
    <password type="TEXT">weblogic</password>
    </userNameToken>
    <!--
    Encrypt the SOAP message with the recipient's (MyCompany.jws) public key.
    Only the recipient's private key can decrypt it.
    Ensures the confidentiality of the SOAP message.
    (This process requires that the sender's keystore already contains
    a digital certificate containing the recients public key.)
    -->
              <encryption>
                   <encryptionKey>
                        <alias>mycompany</alias>
                   </encryptionKey>
              </encryption>
    <!--
    Sign the SOAP message with the sender's (Client.jws) private key.
    Only the sender's public key can validate the signature.
    Ensures the authenticity of the sender, i.e., that the sender is
    in fact the source of the SOAP message.
    -->
    <signatureKey>
                   <alias>client1</alias>
                   <password>password</password>
              </signatureKey>
         </wsSecurityOut>
    <wsSecurityIn>
    <!--
    Incoming SOAP message must be accompanied by a valid username
    and password.
    -->
              <token tokenType="username"/>
    <!--
    Incoming SOAP messages must be encrypted with client.jws's
    public key. The alias and password to access the client.jws's
    decrypting private key in the keystore are provided by
    the <decryptionKey> element below.
    -->
              <encryptionRequired>
                   <decryptionKey>
                        <alias>client1</alias>
                        <password>password</password>
                   </decryptionKey>
              </encryptionRequired>
    <!--
    Incoming SOAP messages must be digitally signed with the sender's
    private key.
    The sender's public key is used to validate the signature.
    -->
              <signatureRequired>true</signatureRequired>
    </wsSecurityIn>
    <!--
    Look for the client.jks keystore in the default location, the server domain
    root, in this case, BEA_HOME\weblogic81\samples\domains\workshop.
    -->
         <keyStore>
    <keyStoreLocation>samples_client.jks</keyStoreLocation>
    <keyStorePassword>password</keyStorePassword>
    </keyStore>
    </wsSecurityPolicy>

    Hi Vijay
    It appears like you are not applying the wsse policy on the client side.
    Check the jws as well as the control on the Client side. Both do not refer to a wsse policy file
    Your code snippets:
    Jws:
    * @common:target-namespace namespace="http://workshop.bea.com/Client"
    public class Client implements com.bea.jws.WebService
    Service Control:
    * @jc:location http-url="http://localhost:7001/TestWebServicesProject/security/wsse/reqresp/service/GreetGuest.jws"
    * @jc:wsdl file="#GreetGuestWsdl"
    * @editor-info:link autogen-style="java" source="GreetGuestContract.wsdl" autogen="true"
    public interface SecuredGreeting extends com.bea.control.ControlExtension, com.bea.control.ServiceControl
    Please refer to the wsse file on the Client side just like how you have done it on the server side.
    Vimala-

  • Web service handler could not called in client web service

    Hi All,
    I have two web service ServiceA & ServiceB and both implemented in weblogic.
    The ServiceA is SSL enable and protocol is https which is not published by me.
    The ServieB is my web service(wls8.1) and act as client for ServiceA.
    My problem is when i hit my service, its not able set the handler when it call ServiceA but it is invoking the service and giving application exception like authentication error.
    My service file:
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Map;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.rpc.handler.HandlerRegistry;
    import javax.xml.rpc.handler.soap.SOAPMessageContext;
    import weblogic.webservice.client.SSLAdapterFactory;
    import weblogic.webservice.client.WLSSLAdapter;
    public class HelloService {
    String wsdl = "https://188.122.123.23/RemoetService?WSDL";
    static {
    SSLAdapterFactory factory = SSLAdapterFactory.getDefaultFactory();
    WLSSLAdapter adapter = (WLSSLAdapter) factory.getSSLAdapter();
    adapter.setTrustedCertificatesFile("D:\\lib\\certs
    cacerts");
    factory.setDefaultAdapter(adapter);
    System.setProperty("weblogic.xml.encryption.verbose","true");
    System.setProperty("weblogic.xml.signature.verbose","true");
    System.setProperty("weblogic.webservice.verbose","true");
    public String sayHello(String user) {
    RemoteService_Impl service = new RemoteService_Impl(wsdl);
    RemotePortType port = service.getRemoteServicePort1();
    String namespace = service.getServiceName()
    .getNamespaceURI();
    QName portName = new QName(namespace,
    "RemoteServicePortType");
    HandlerRegistry reg = service.getHandlerRegistry();
    List handlerList = new ArrayList();
    Map map = new HashMap();
    map.put("Username", "user1");
    map.put("Password", "pwd1");
    HandlerInfo info = new HandlerInfo();
    info.setHandlerClass(WSClientHandler .class);
    info.setHandlerConfig(map);
    handlerList.add(info);
    reg.setHandlerChain(portName,(List)handlerList);
    RemoteServiceResponse = port.callMe(name);
    My Handler file:
    package com.test;
    import java.util.Map;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.handler.Handler;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.rpc.handler.MessageContext;
    import javax.xml.rpc.handler.soap.SOAPMessageContext;
    import javax.xml.soap.Name;
    import javax.xml.soap.SOAPElement;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPException;
    import javax.xml.soap.SOAPHeader;
    import javax.xml.soap.SOAPHeaderElement;
    public class WSClientHandler implements Handler {
    private HandlerInfo handlerInfo;
    public WSClientAuthenticateHandler(){}
    public void init(HandlerInfo hi) {
    System.out.println("Handler init");
    handlerInfo = hi;
    public void destroy() {
    System.out.println("Handler destroy method called");
    handlerInfo = null;
    public QName[] getHeaders() {
    System.out.println("Handler Header method called");
    try {
    Map map = handlerInfo.getHandlerConfig();
    QName[] headers = handlerInfo.getHeaders();
    System.out.println(" Config :"+map);
    for(int i=0;i<headers.length;i++) {
    System.out.println(headers.getLocalPart()+" "+
    headers.toString()+" "+headers.getNamespaceURI());
    }catch(Exception e) {
    e.printStackTrace();
    return handlerInfo.getHeaders();
    public boolean handleRequest(MessageContext mc) {
    SOAPMessageContext smc = (SOAPMessageContext) mc;
    System.out.println("Calling handler class.....................");
    try {
    SOAPEnvelope se = smc.getMessage().getSOAPPart().getEnvelope();
    System.out.println("Calling handler class.....................");
    SOAPHeader soapHeader = se.getHeader();
    Name headerName = se.createName("Security","wsse","http://schemas.xmlsoap.org/ws/2002/07/secext");
    SOAPHeaderElement headerElement = soapHeader.addHeaderElement(headerName);
    SOAPElement element = headerElement.addChildElement(se.createName("UsernameToken", "wsse", "http://schemas.xmlsoap.org/ws/2002/07/secext"));
    element.addChildElement(se.createName("Username", "wsse","http://schemas.xmlsoap.org/ws/2002/07/secext")).addTextNode("testuser");
    element.addChildElement(se.createName("Password", "wsse","http://schemas.xmlsoap.org/ws/2002/07/secext")).addTextNode("testpwd");
    System.out.println("Calling handler class.....................");
    System.out.println("** Request: \n "se.toString()"\n");
    }catch(SOAPException e) {
    e.printStackTrace();
    return true;
    /** * Specifies that the SOAP response message be logged to a
    * log file before the
    * * message is sent back to the client application
    * that invoked the Web service.
    public boolean handleResponse(MessageContext mc) {
    System.out.println("Handler Response method called");
    SOAPMessageContext messageContext = (SOAPMessageContext) mc;
    System.out.println("** Response: \n"messageContext.getMessage().toString()"\n");
    return true;
    /** * Specifies that a message be logged to the log file if a SOAP fault is
    * * thrown by the Handler instance.
    public boolean handleFault(MessageContext mc) {
    SOAPMessageContext messageContext = (SOAPMessageContext) mc;
    System.out.println("** Fault: \n"messageContext.getMessage().toString()"\n");
    return true;
    Please need help here.
    Thanks in Advance,
    pps

    I have tested static client calling using handler simple above service and found the issues.
    QName portName = new QName(namespace,
    "*RemoteServicePortType*");
    The above line code has created the issues,becuase in wsdl file ( given similar wsdl file).
    <?xml version="1.0"; encoding="UTF-8"?>
    <definitions name="HelloService"
    targetNamespace="http://www.ecerami.com/wsdl/HelloService.wsdl"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="http://www.ecerami.com/wsdl/HelloService.wsdl"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <message name="SayHelloRequest">
    <part name="firstName" type="xsd:string"/>
    </message>
    <message name="SayHelloResponse">
    <part name="greeting" type="xsd:string"/>
    </message>
    *<portType name="RemoteServicePortType">*
    <operation name="sayHello">
    <input message="tns:SayHelloRequest"/>
    <output message="tns:SayHelloResponse"/>
    </operation>
    </portType>
    <binding name="Hello_Binding" type="tns:*RemoteServicePortType*">
    <soap:binding style="rpc"
    transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="sayHello">
    <soap:operation soapAction="sayHello"/>
    <input>
    <soap:body
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    namespace="urn:examples:helloservice"
    use="encoded"/>
    </input>
    <output>
    <soap:body
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    namespace="urn:examples:helloservice"
    use="encoded"/>
    </output>
    </operation>
    </binding>
    <service name="Hello_Service">
    <port binding="tns:Hello_Binding" name="*RemoteServicePortType1*">
    <soap:address
    location="http://host1:8080/soap/servlet/rpcrouter"/>
    </port>
    <port binding="tns:Hello_Binding" name="*RemoteServicePortType2*">
    <soap:address
    location="http://host2:8080/soap/servlet/rpcrouter"/>
    </port>
    <port binding="tns:Hello_Binding" name="*RemoteServicePortType3*">
    <soap:address
    location="http://host3:8080/soap/servlet/rpcrouter"/>
    </port>
    <port binding="tns:Hello_Binding" name="*RemoteServicePortType4*">
    <soap:address
    location="http://host4:8080/soap/servlet/rpcrouter"/>
    </port>
    </service>
    </definitions>
    From the above WSDL, I have four port name (port binding="tns:Hello_Binding" name="*RemoteServicePortType1*) which is not matching with PortType (portType name="*RemoteServicePortType*")
    even i have iterated from getPorts() method and used to invoke the service.But handler was not calling when i invoke.
    Please guide me here how i specify correct portname which can call Handler class also.
    Thanks in advance,
    pps

  • Web service handler could not registered/called in client web service

    Hi Expert,
    I have two web service ServiceA & ServiceB and both implemented in weblogic.
    The ServiceA is SSL enable and protocol is https which is not published by me.
    The ServieB is my web service(wls8.1) and act as client for ServiceA.
    My problem is when i hit my service, its not able set the handler when it call ServiceA but it is invoking the service and giving application exception like authentication error.
    My service file:
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Map;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.rpc.handler.HandlerRegistry;
    import javax.xml.rpc.handler.soap.SOAPMessageContext;
    import weblogic.webservice.client.SSLAdapterFactory;
    import weblogic.webservice.client.WLSSLAdapter;
    public class HelloService {
    String wsdl = "https://188.122.123.23/RemoetService?WSDL";
    static     {
              SSLAdapterFactory factory =                SSLAdapterFactory.getDefaultFactory();
              WLSSLAdapter adapter = (WLSSLAdapter)     factory.getSSLAdapter();
              adapter.setTrustedCertificatesFile("D:\\lib\\certs\\cacerts");
              factory.setDefaultAdapter(adapter);
              System.setProperty("weblogic.xml.encryption.verbose","true");
              System.setProperty("weblogic.xml.signature.verbose","true");
              System.setProperty("weblogic.webservice.verbose","true");
         public String sayHello(String user) {
              RemoteService_Impl service = new RemoteService_Impl(wsdl);
              RemotePortType port = service.getRemoteServicePort1();
              String namespace = service.getServiceName()
                        .getNamespaceURI();
              QName portName = new QName(namespace,
                        "RemoteServicePortType");
              HandlerRegistry reg = service.getHandlerRegistry();
              List handlerList = new ArrayList();
              Map map = new HashMap();
              map.put("Username", "user1");
              map.put("Password", "pwd1");
              HandlerInfo info = new HandlerInfo();
              info.setHandlerClass(WSClientHandler .class);
              info.setHandlerConfig(map);
              handlerList.add(info);
              reg.setHandlerChain(portName,(List)handlerList);
              RemoteServiceResponse = port.callMe(name);
    My Handler Class:
    package com.test;
    import java.util.Map;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.handler.Handler;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.rpc.handler.MessageContext;
    import javax.xml.rpc.handler.soap.SOAPMessageContext;
    import javax.xml.soap.Name;
    import javax.xml.soap.SOAPElement;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPException;
    import javax.xml.soap.SOAPHeader;
    import javax.xml.soap.SOAPHeaderElement;
    public class WSClientHandler implements Handler {
         private HandlerInfo handlerInfo;
         public WSClientAuthenticateHandler(){}
         public void init(HandlerInfo hi) {   
              System.out.println("Handler init");
              handlerInfo = hi;
         public void destroy() {
              System.out.println("Handler destroy method called");
              handlerInfo = null;
         public QName[] getHeaders() {
              System.out.println("Handler Header method called");
              try     {
                   Map map = handlerInfo.getHandlerConfig();
                   QName[] headers = handlerInfo.getHeaders();
                   System.out.println(" Config :"+map);
                   for(int i=0;i<headers.length;i++)     {
                        System.out.println(headers.getLocalPart()+" "+
                        headers[i].toString()+" "+headers[i].getNamespaceURI());
              }catch(Exception e)     {
                   e.printStackTrace();
              return handlerInfo.getHeaders();
         public boolean handleRequest(MessageContext mc) {   
              SOAPMessageContext smc = (SOAPMessageContext) mc;
              System.out.println("Calling handler class.....................");
              try     {
              SOAPEnvelope se =      smc.getMessage().getSOAPPart().getEnvelope();
              System.out.println("Calling handler class.....................");
         SOAPHeader soapHeader = se.getHeader();
         Name headerName = se.createName("Security","wsse","http://schemas.xmlsoap.org/ws/2002/07/secext");
         SOAPHeaderElement headerElement = soapHeader.addHeaderElement(headerName);
         SOAPElement element = headerElement.addChildElement(se.createName("UsernameToken", "wsse", "http://schemas.xmlsoap.org/ws/2002/07/secext"));
         element.addChildElement(se.createName("Username", "wsse","http://schemas.xmlsoap.org/ws/2002/07/secext")).addTextNode("testuser");
         element.addChildElement(se.createName("Password", "wsse","http://schemas.xmlsoap.org/ws/2002/07/secext")).addTextNode("testpwd");
         System.out.println("Calling handler class.....................");
                   System.out.println("** Request: \n "+se.toString()+"\n");
              }catch(SOAPException e)     {
                   e.printStackTrace();
              return true;
         /** * Specifies that the SOAP response message be logged to a
         * log file before the
         * * message is sent back to the client application
         * that invoked the Web service.
         public boolean handleResponse(MessageContext mc) {  
              System.out.println("Handler Response method called");
              SOAPMessageContext messageContext = (SOAPMessageContext) mc;
              System.out.println("** Response: \n"+messageContext.getMessage().toString()+"\n");
              return true;
         /** * Specifies that a message be logged to the log file if a SOAP fault is
         * * thrown by the Handler instance.
         public boolean handleFault(MessageContext mc) {   
              SOAPMessageContext messageContext = (SOAPMessageContext) mc;
              System.out.println("** Fault: \n"+messageContext.getMessage().toString()+"\n");
              return true;
    Please need help here.
    Thanks in Advance,
    pps

    I have tested static client calling using handler simple above service and found the issues.
    QName portName = new QName(namespace,
    *"RemoteServicePortType");*
    The above line code has created the issues,becuase in wsdl file ( given similar wsdl file).
    <?xml version="1.0"; encoding="UTF-8"?>
    <definitions name="HelloService"
    targetNamespace="http://www.ecerami.com/wsdl/HelloService.wsdl"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="http://www.ecerami.com/wsdl/HelloService.wsdl"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <message name="SayHelloRequest">
    <part name="firstName" type="xsd:string"/>
    </message>
    <message name="SayHelloResponse">
    <part name="greeting" type="xsd:string"/>
    </message>
    <portType name="*RemoteServicePortType*">
    <operation name="sayHello">
    <input message="tns:SayHelloRequest"/>
    <output message="tns:SayHelloResponse"/>
    </operation>
    </portType>
    <binding name="Hello_Binding" type="tns:*RemoteServicePortType*">
    <soap:binding style="rpc"
    transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="sayHello">
    <soap:operation soapAction="sayHello"/>
    <input>
    <soap:body
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    namespace="urn:examples:helloservice"
    use="encoded"/>
    </input>
    <output>
    <soap:body
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    namespace="urn:examples:helloservice"
    use="encoded"/>
    </output>
    </operation>
    </binding>
    <service name="Hello_Service">
    +<port binding="tns:Hello_Binding" name="*RemoteServicePortType1*">+
    +<soap:address+
    location="http://host1:8080/soap/servlet/rpcrouter"/>
    +</port>+
    +<port binding="tns:Hello_Binding" name="*RemoteServicePortType2*">+
    +<soap:address+
    location="http://host2:8080/soap/servlet/rpcrouter"/>
    +</port>+
    +<port binding="tns:Hello_Binding" name="*RemoteServicePortType3*">+
    +<soap:address+
    location="http://host3:8080/soap/servlet/rpcrouter"/>
    +</port>+
    +<port binding="tns:Hello_Binding" name="*RemoteServicePortType4*">+
    +<soap:address+
    location="http://host4:8080/soap/servlet/rpcrouter"/>
    +</port>+
    </service>
    </definitions>
    From the above WSDL, I have four port name (port binding="tns:Hello_Binding" name="*RemoteServicePortType1*) which is not matching with PortType (portType name="*RemoteServicePortType*")
    even i have iterated from getPorts() method and used to invoke the service.But handler was not calling when i invoke.
    Please guide me here how i specify correct portname which can call Handler class also.
    Thanks in advance,
    pps

  • RMI exception calling web service from proxy class

    I am getting the following error attempting to call a web service from a proxy. It appears to relate to the type of objects I am trying to send vs the type that is expected. Following the exception I am adding a copy of the control where calling the web service is sucessful, a copy of the proxy class that I am using to make this unsucessful call, and the controller.jpf that has the formBean where I am creating my objects
    Caught Exception Calling the Web Service from the Proxy. The Exception is the f
    ollowing: java.rmi.RemoteException: web service invoke failed: javax.xml.soap.SO
    APException: failed to serialize class org.openuri.www.CreateAccountCheckingReq
    uestweblogic.xml.schema.binding.SerializationException: type mapping lookup fail
    ure on class=class controls.CheckingService$anyType TypeMapping=TYPEMAPPING SIZE
    =5
    ENTRY 1:
    class: org.openuri.www.CreateAccountCheckingResponse
    xsd_type: ['http://www.openuri.org/']:lcl0:CreateAccountCheckingResponse
    ser: org.openuri.www.CreateAccountCheckingResponseCodec@c0f4da
    deser: org.openuri.www.CreateAccountCheckingResponseCodec@b1dd4
    ENTRY 2:
    class: org.openuri.www.FundingInfoAnonType
    xsd_type: ['http://www.openuri.org/']:lcl0:FundingInfoAnonType
    ser: org.openuri.www.FundingInfoAnonTypeCodec@1d36711
    deser: org.openuri.www.FundingInfoAnonTypeCodec@13a59e
    ENTRY 3:
    class: org.openuri.www.AccountInfoAnonType
    xsd_type: ['http://www.openuri.org/']:lcl0:AccountInfoAnonType
    ser: org.openuri.www.AccountInfoAnonTypeCodec@1de5959
    deser: org.openuri.www.AccountInfoAnonTypeCodec@bbf788
    ENTRY 4:
    class: org.openuri.www.CustomerInfoAnonType
    xsd_type: ['http://www.openuri.org/']:lcl0:CustomerInfoAnonType
    ser: org.openuri.www.CustomerInfoAnonTypeCodec@7824f9
    deser: org.openuri.www.CustomerInfoAnonTypeCodec@1c35fe1
    ENTRY 5:
    class: org.openuri.www.CreateAccountCheckingRequest
    xsd_type: ['http://www.openuri.org/']:lcl0:CreateAccountCheckingRequest
    ser: org.openuri.www.CreateAccountCheckingRequestCodec@1cbcd7b
    deser: org.openuri.www.CreateAccountCheckingRequestCodec@11f60ce
    ; nested exception is:
    javax.xml.soap.SOAPException: failed to serialize class org.openuri.www
    .CreateAccountCheckingRequestweblogic.xml.schema.binding.SerializationException:
    type mapping lookup failure on class=class controls.CheckingService$anyType Typ
    eMapping=TYPEMAPPING SIZE=5
    ENTRY 1:
    class: org.openuri.www.CreateAccountCheckingResponse
    xsd_type: ['http://www.openuri.org/']:lcl0:CreateAccountCheckingResponse
    ser: org.openuri.www.CreateAccountCheckingResponseCodec@c0f4da
    deser: org.openuri.www.CreateAccountCheckingResponseCodec@b1dd4
    ENTRY 2:
    class: org.openuri.www.FundingInfoAnonType
    xsd_type: ['http://www.openuri.org/']:lcl0:FundingInfoAnonType
    ser: org.openuri.www.FundingInfoAnonTypeCodec@1d36711
    deser: org.openuri.www.FundingInfoAnonTypeCodec@13a59e
    ENTRY 3:
    class: org.openuri.www.AccountInfoAnonType
    xsd_type: ['http://www.openuri.org/']:lcl0:AccountInfoAnonType
    ser: org.openuri.www.AccountInfoAnonTypeCodec@1de5959
    deser: org.openuri.www.AccountInfoAnonTypeCodec@bbf788
    ENTRY 4:
    class: org.openuri.www.CustomerInfoAnonType
    xsd_type: ['http://www.openuri.org/']:lcl0:CustomerInfoAnonType
    ser: org.openuri.www.CustomerInfoAnonTypeCodec@7824f9
    deser: org.openuri.www.CustomerInfoAnonTypeCodec@1c35fe1
    ENTRY 5:
    class: org.openuri.www.CreateAccountCheckingRequest
    xsd_type: ['http://www.openuri.org/']:lcl0:CreateAccountCheckingRequest
    ser: org.openuri.www.CreateAccountCheckingRequestCodec@1cbcd7b
    deser: org.openuri.www.CreateAccountCheckingRequestCodec@11f60ce
    Java Control for the web service:
    package controls;
    import weblogic.webservice.context.WebServiceContext;
    * @jc:location http-url="http://localhost:7001/Checking.jws"
    * @jc:wsdl file="#CheckingWsdl"
    * @jc:handler callback="MessageHandler" operation="MessageHandler"
    public interface CheckingService extends com.bea.control.ControlExtension, com.bea.control.ServiceControl
    public static class CustomerInfo
    implements java.io.Serializable
    public java.lang.String FirstName;
    public java.lang.String LastName;
    public java.lang.String MiddleName;
    public int SSN;
    public int CustomerNumber;
    public java.util.Calendar CreationDate;
    public java.util.Calendar LastModifiedDate;
    public static class FundingInfo
    implements java.io.Serializable
    public float Amount;
    public java.util.Calendar CurrentDate;
    public int AccountNumber;
    public static class anyType
    implements java.io.Serializable
    public com.bea.xml.XmlObject[] t;
    public static class AccountInfo
    implements java.io.Serializable
    public int AccountNumber;
    public float Balance;
    public int CustomerNumber;
    public java.util.Calendar LastModifiedDate;
    public WebServiceContext context = CheckingService.context;
    * @jc:protocol form-post="false" form-get="false"
    public AccountInfo CreateAccountChecking (CustomerInfo CustomerInfo, FundingInfo FundingInfo, anyType CommonHeader);
    static final long serialVersionUID = 1L;
    /** @common:define name="CheckingWsdl" value::
    <?xml version="1.0" encoding="utf-8"?>
    <!-- @editor-info:link autogen="false" source="" -->
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:conv="http://www.openuri.org/2002/04/soap/conversation/" xmlns:cw="http://www.openuri.org/2002/04/wsdl/conversation/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:jms="http://www.openuri.org/2002/04/wsdl/jms/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://www.openuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://www.openuri.org/">
    <types>
    <s:schema targetNamespace="http://www.openuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema">
    <s:element name="CreateAccountCheckingRequest">
    <s:complexType>
    <s:sequence>
    <s:element name="CustomerInfo">
    <s:complexType>
    <s:sequence>
    <s:element name="FirstName" type="s:string" nillable="false"/>
    <s:element name="LastName" type="s:string" nillable="false"/>
    <s:element name="MiddleName" type="s:string" nillable="true"/>
    <s:element name="SSN" type="s:int"/>
    <s:element name="CustomerNumber" type="s:int"/>
    <s:element name="CreationDate" type="s:dateTime"/>
    <s:element name="LastModifiedDate" type="s:dateTime"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="FundingInfo">
    <s:complexType>
    <s:sequence>
    <s:element name="Amount" type="s:float"/>
    <s:element name="CurrentDate" type="s:dateTime"/>
    <s:element name="AccountNumber" type="s:int"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="CommonHeader" type="s:anyType"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="CreateAccountCheckingResponse">
    <s:complexType>
    <s:sequence>
    <s:element name="AccountInfo">
    <s:complexType>
    <s:sequence>
    <s:element name="AccountNumber" type="s:int"/>
         <s:element name="Balance" type="s:float"/>
         <s:element name="CustomerNumber" type="s:int"/>
         <s:element name="LastModifiedDate" type="s:dateTime"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="string" nillable="true" type="s:string"/>
    </s:schema>
    </types>
    <message name="CreateAccountCheckingSoapIn">
    <part name="parameters" element="s0:CreateAccountCheckingRequest"/>
    </message>
    <message name="CreateAccountCheckingSoapOut">
    <part name="parameters" element="s0:CreateAccountCheckingResponse"/>
    </message>
    <portType name="CheckingSoap">
    <operation name="CreateAccountChecking">
    <input message="s0:CreateAccountCheckingSoapIn"/>
    <output message="s0:CreateAccountCheckingSoapOut"/>
    </operation>
    </portType>
    <binding name="CheckingSoap" type="s0:CheckingSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <operation name="CreateAccountChecking">
    <soap:operation soapAction="http://www.openuri.org/CreateAccountChecking" style="document"/>
    <input>
    <soap:body use="literal"/>
    </input>
    <output>
    <soap:body use="literal"/>
    </output>
    </operation>
    </binding>
    <service name="Checking">
    <port name="CheckingSoap" binding="s0:CheckingSoap">
    <soap:address location="http://localhost:7001/Checking.jws"/>
    </port>
    </service>
    </definitions>
    FOLLOWING IS THE PROXY CLASS THAT IS UNSUCCESSFUL
    import controls.CheckingService.anyType;
    import java.util.ArrayList;
    import java.util.List;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.rpc.handler.HandlerRegistry;
    import org.openuri.CreateAccountCheckingResponseDocument.CreateAccountCheckingResponse;
    import org.openuri.www.CustomerInfoAnonType;
    import org.openuri.www.FundingInfoAnonType;
    import weblogic.jws.proxies.*;
    import weblogic.webservice.context.WebServiceContext;
    import weblogic.webservice.context.WebServiceSession;
    import weblogic.webservice.core.handler.WSSEClientHandler;
    import weblogic.webservice.tools.pagegen.result;
    import weblogic.xml.security.UserInfo;
    import weblogic.xml.security.wsse.Security;
    import weblogic.xml.security.wsse.SecurityElementFactory;
    //import weblogic.jws.proxies.WebServiceB;
    //import weblogic.jws.proxies.WebServiceB_Impl;
    //import weblogic.jws.proxies.WebServiceBSoap;
    public class CheckingWSProxy
    public static void CallWS(Controller.CreateAccountCheckingForm form)
    String user;
    String pass;
    try{
    * Instantiate the main proxy class. The proxy class has the same name as the
    * web service, with "_Impl" appended.
    Checking myservice = new Checking_Impl("http://localhost:7001/ConsumerAccountApp/schemas/CheckingService.wsdl");
    WebServiceContext context = myservice.context();
    WebServiceSession session = context.getSession();
    * Registers a handler for the SOAP message traffic.
    HandlerRegistry registry = myservice.getHandlerRegistry();
    List list = new ArrayList();
    list.add(new HandlerInfo(WSSEClientHandler.class, null, null));
    registry.setHandlerChain(new QName("Checking"), list);
    * Set the username and password token for SOAP message sent from the client, through
    * the proxy, to the web service.
    user = form.getUsername();
    pass = form.getPassword();
    UserInfo ui = new UserInfo(user, pass);
    session.setAttribute(WSSEClientHandler.REQUEST_USERINFO, ui);
    * Adds the username / password token to the SOAP header.
    SecurityElementFactory factory = SecurityElementFactory.getDefaultFactory();
    Security security = factory.createSecurity(null);
    security.addToken(ui);
    session.setAttribute(WSSEClientHandler.REQUEST_SECURITY, security);
    * Get the protocol-specific proxy class.
    CheckingSoap msg=myservice.getCheckingSoap();
    * Invoke the web service method
    msg.createAccountChecking((CustomerInfoAnonType)form.getProxyCustomerInfo(), (FundingInfoAnonType)form.getProxyFundingInfo(), (Object)form.get_CommonHeader());
    catch (Exception ex)
    System.out.println("Caught Exception Calling the Web Service from the Proxy. The Exception is the following: " + ex.toString());
    FOLLOWING IS THE FORMBEAN IN THE CONTROLLER.JPF FILE
    * FormData get and set methods may be overwritten by the Form Bean editor.
    public static class CreateAccountCheckingForm extends FormData
    private anyType _CommonHeader;
    private controls.CheckingService.FundingInfo _FundingInfo;
    private controls.CheckingService.CustomerInfo _CustomerInfo;
    private java.util.Date dOut;
    private java.util.Calendar cOut;
    private CustomerInfo proxyCustomerInfo;
    private FundingInfo proxyFundingInfo;
    private String stringDate;
    private String currentDate;
    private String lastModifiedDate;
    private String creationDate;
    private String systemMessage;
    private String username;
    private String password;
    private String accountType;
    private String trashTransferAccount;
    private String trashAccountNumber;
    private boolean secureFlag;
    public void set_CustomerInfo(controls.CheckingService.CustomerInfo _CustomerInfo)
    _CustomerInfo.CreationDate = parseDate(getCreationDate());
    _CustomerInfo.LastModifiedDate = parseDate(getLastModifiedDate());
    this._CustomerInfo = _CustomerInfo;
    public controls.CheckingService.CustomerInfo get_CustomerInfo()
    if(this._CustomerInfo == null)
    this._CustomerInfo = new controls.CheckingService.CustomerInfo();
    _CustomerInfo.CreationDate = dateNow();
    _CustomerInfo.LastModifiedDate = dateNow();              
    return this._CustomerInfo;
    public CustomerInfo getProxyCustomerInfo()
    this.proxyCustomerInfo = (CustomerInfo)this._CustomerInfo;
    return this.proxyCustomerInfo;
    public void set_FundingInfo(controls.CheckingService.FundingInfo _FundingInfo)
    _FundingInfo.CurrentDate = parseDate(getCurrentDate());
    this._FundingInfo = _FundingInfo;
    public controls.CheckingService.FundingInfo get_FundingInfo()
    if(this._FundingInfo == null)
    this._FundingInfo = new controls.CheckingService.FundingInfo();
    _FundingInfo.CurrentDate = dateNow();
    return this._FundingInfo;
    public FundingInfo getProxyFundingInfo()
    this.proxyFundingInfo = (FundingInfo)this._FundingInfo;
    return this.proxyFundingInfo;
    public void set_CommonHeader(anyType _CommonHeader)
    this._CommonHeader = _CommonHeader;
    public anyType get_CommonHeader()
    if(this._CommonHeader == null)
    this._CommonHeader = new anyType();
    return this._CommonHeader;
    public java.util.Calendar dateNow()
    this.dOut = new Date();
    Calendar cOut = this.cOut.getInstance();
    cOut.setTime(this.dOut);
    this.cOut = cOut;
    return this.cOut;
    public java.util.Calendar parseDate( String strDate )
    SimpleDateFormat df4 = new SimpleDateFormat( "MM/dd/yyyy" );
    Calendar cOut = this.cOut;
    df4.setLenient( false );
    try
    this.dOut = df4.parse( strDate );
    } catch ( ParseException e )
    cOut.getInstance();
    cOut.setTime(dOut);
    this.cOut = cOut;
    return this.cOut;
    public void setStringDate( String stringDate )
    this.stringDate = stringDate;
    public String getStringDate()
    return this.stringDate;
    public void setCurrentDate( String currentDate )
    this.currentDate = currentDate;
    public String getCurrentDate()
    SimpleDateFormat df4 = new SimpleDateFormat( "MM/dd/yyyy" );
    this.currentDate = df4.format(_FundingInfo.CurrentDate.getTime());
    return this.currentDate;
    public void setLastModifiedDate( String lastModifiedDate )
    this.lastModifiedDate = lastModifiedDate;
    public String getLastModifiedDate()
    SimpleDateFormat df4 = new SimpleDateFormat( "MM/dd/yyyy" );
    this.lastModifiedDate = df4.format(_CustomerInfo.LastModifiedDate.getTime());
    return this.lastModifiedDate;
    public void setCreationDate( String creationDate )
    this.creationDate = creationDate;
    public String getCreationDate()
    SimpleDateFormat df4 = new SimpleDateFormat( "MM/dd/yyyy" );
    this.creationDate = df4.format(_CustomerInfo.CreationDate.getTime());
    return this.creationDate;
    public void setUsername( String username )
    this.username = username;
    public String getUsername()
    return this.username;
    public void setPassword( String password )
    this.password = password;
    public String getPassword()
    return this.password;
    public void setAccountType( String accountType )
    this.accountType = accountType;
    public String getAccountType()
    return this.accountType;
    public void setTrashTransferAccount( String trashTransferAccount )
    this.trashTransferAccount = trashTransferAccount;
    public String getTrashTransferAccount()
    return this.trashTransferAccount;
    public void setTrashAccountNumber( String trashAccountNumber )
    this.trashAccountNumber = trashAccountNumber;
    public String getTrashAccountNumber()
    return this.trashAccountNumber;
    public void setSystemMessage( String systemMessage )
    this.systemMessage = systemMessage;
    public String getSystemMessage()
    return this.systemMessage;
    public void setSecureFlag( boolean secureFlag )
    this.secureFlag = secureFlag;
    public boolean getSecureFlag()
    return this.secureFlag;
    }

    This exception means that xml namespaces are different.
    Etc. soap has xml element which doesn't belong to namespace of parent xml element and namespace is set without prefix.
    I had such problem.
    Try to set namespace prefix for this element.
    Example:
    <el1>
    <el2 xmlns="http://..."/>
    </el1>
    Should be
    <el1>
    <q:el2 xmlns:q="http://..."/>
    </el1>

Maybe you are looking for