Enable userName Token profile in Java client policy file

My stand-alone java client invokes a .Net web service which implements wse 3.0. userName Token. However, when I ran my client program with the policy file which I converted from .Net config policy. I got errors. How could I make this right?
[java] java.rmi.RemoteException: SOAPFaultException - FaultCode [{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security] FaultString [Header http://schemas.xmlsoap.org/ws/2004/08/addressing:Action for ultimate recipient is required but not present in the message.] FaultActor [http://192.168.254.102/TestImageserver2007/DLImageService.asmx]No Detail; nested exception is:
[java]      javax.xml.rpc.soap.SOAPFaultException: Header http://schemas.xmlsoap.org/ws/2004/08/addressing:Action for ultimate recipient is required but not present in the message.
[java] fetchMostRecent() Failed...
[java]      at digimarc.foto.webservice.clientstub.ImageServiceSoap_Stub.imagingFolioFetchMostRecent(ImageServiceSoap_Stub.java:137)
[java]      at digimarc.foto.webservice.Client.main(Client.java:40)
[java] Caused by: javax.xml.rpc.soap.SOAPFaultException: Header http://schemas.xmlsoap.org/ws/2004/08/addressing:Action for ultimate recipient is required but not present in the message.
[java]      at weblogic.wsee.codec.soap11.SoapCodec.decodeFault(SoapCodec.java:311)
[java]      at weblogic.wsee.ws.dispatch.client.CodecHandler.decodeFault(CodecHandler.java:114)
[java]      at weblogic.wsee.ws.dispatch.client.CodecHandler.decode(CodecHandler.java:99)
[java]      at weblogic.wsee.ws.dispatch.client.CodecHandler.handleFault(CodecHandler.java:87)
[java]      at weblogic.wsee.handler.HandlerIterator.handleFault(HandlerIterator.java:248)
[java]      at weblogic.wsee.handler.HandlerIterator.handleResponse(HandlerIterator.java:218)
[java]      at weblogic.wsee.ws.dispatch.client.ClientDispatcher.handleResponse(ClientDispatcher.java:159)
[java]      at weblogic.wsee.ws.dispatch.client.ClientDispatcher.dispatch(ClientDispatcher.java:114)
[java]      at weblogic.wsee.ws.WsStub.invoke(WsStub.java:89)
[java]      at weblogic.wsee.jaxrpc.StubImpl._invoke(StubImpl.java:331)
[java]      at digimarc.foto.webservice.clientstub.ImageServiceSoap_Stub.imagingFolioFetchMostRecent(ImageServiceSoap_Stub.java:132)
Policy file used:
<?xml version="1.0" ?>
<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wssp="http://www.bea.com/wls90/security/policy"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wls="http://www.bea.com/wls90/security/policy/wsee#part">
<!-- Accompany outgoing SOAP messages with a username and password before sending them
out on the wire. -->
<wssp:Security>
<wssp:userNameToken>
<wssp:userName>weblogic</wssp:userName>
<wssp:password type="TEXT">weblogic</wssp:password>
</wssp:userNameToken>
</wssp:Security>
</wsp:Policy>
.Net config policy file:
<policies xmlns="http://schemas.microsoft.com/wse/2005/06/policy">
<extensions>
<extension name="kerberosSecurity" type="Microsoft.Web.Services3.Design.KerberosAssertion, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension name="kerberos" type="Microsoft.Web.Services3.Design.KerberosTokenProvider, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension name="usernameForCertificateSecurity" type="Microsoft.Web.Services3.Design.UsernameForCertificateAssertion, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension name="x509" type="Microsoft.Web.Services3.Design.X509TokenProvider, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension name="requireActionHeader" type="Microsoft.Web.Services3.Design.RequireActionHeaderAssertion, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension name="usernameOverTransportSecurity" type="Microsoft.Web.Services3.Design.UsernameOverTransportAssertion, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</extensions>
<policy name="AuthorizationPolicy">
<kerberosSecurity establishSecurityContext="false" requireSignatureConfirmation="false" messageProtectionOrder="SignBeforeEncrypt" requireDerivedKeys="false" ttlInSeconds="300">
<token>
<kerberos targetPrincipal="host/nbcis1" impersonationLevel="Identification" />
</token>
<protection>
<request signatureOptions="IncludeAddressing, IncludeTimestamp, IncludeSoapBody" encryptBody="true" />
<response signatureOptions="IncludeAddressing, IncludeTimestamp, IncludeSoapBody" encryptBody="true" />
<fault signatureOptions="IncludeAddressing, IncludeTimestamp, IncludeSoapBody" encryptBody="false" />
</protection>
</kerberosSecurity>
<requireActionHeader />
</policy>
<policy name="InteropPolicy">
<usernameOverTransportSecurity />
<requireActionHeader />
</policy>
<policy name="NamePolicy">
<usernameOverTransportSecurity >
<clientToken>
<username username="nbdls\joejoe" password="ImAGe!" />
</clientToken>
</usernameOverTransportSecurity>
<requireActionHeader />
</policy>
</policies>

Thanks Carlo for the suggestion. That helps to overcome my huge hurdle. The username and password were sent successfully in the SOAP header to .Net web service.
However, there is still some errors on the java client side. I am getting:
[java] java.rmi.RemoteException: SOAPFaultException - FaultCode [{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security] FaultString [Header http://schemas.xmlsoap.org/ws/2004/08/addressing:Action for ultimate recipient is required but not present in the message.] FaultActor [http://192.168.254.102/TestImageserver2007/DLImageService.asmx]No Detail; nested exception is:
[java]      javax.xml.rpc.soap.SOAPFaultException: Header http://schemas.xmlsoap.org/ws/2004/08/addressing:Action for ultimate recipient is required but not present in the message.
[java]      at digimarc.foto.webservice.clientstub.ImageServiceSoap_Stub.imagingFolioFetchMostRecent(ImageServiceSoap_Stub.java:137)
[java]      at digimarc.foto.webservice.Client.main(Client.java:58)
[java] Caused by: javax.xml.rpc.soap.SOAPFaultException: Header http://schemas.xmlsoap.org/ws/2004/08/addressing:Action for ultimate recipient is required but not present in the message.
[java]      at weblogic.wsee.codec.soap11.SoapCodec.decodeFault(SoapCodec.java:311)
[java]      at weblogic.wsee.ws.dispatch.client.CodecHandler.decodeFault(CodecHandler.java:114)
[java]      at weblogic.wsee.ws.dispatch.client.CodecHandler.decode(CodecHandler.java:99)
[java]      at weblogic.wsee.ws.dispatch.client.CodecHandler.handleFault(CodecHandler.java:87)
[java]      at weblogic.wsee.handler.HandlerIterator.handleFault(HandlerIterator.java:248)
[java]      at weblogic.wsee.handler.HandlerIterator.handleResponse(HandlerIterator.java:218)
[java]      at weblogic.wsee.ws.dispatch.client.ClientDispatcher.handleResponse(ClientDispatcher.java:159)
[java]      at weblogic.wsee.ws.dispatch.client.ClientDispatcher.dispatch(ClientDispatcher.java:114)
[java]      at weblogic.wsee.ws.WsStub.invoke(WsStub.java:89)
[java]      at weblogic.wsee.jaxrpc.StubImpl._invoke(StubImpl.java:331)
[java]      at digimarc.foto.webservice.clientstub.ImageServiceSoap_Stub.imagingFolioFetchMostRecent(ImageServiceSoap_Stub.java:132)
[java]      ... 1 more
The statement:
"Action for ultimate recipient is required but not present in message". What is missing?
This is what I have in my java client:
FileInputStream [] inbound_policy_array = new FileInputStream[1];
inbound_policy_array[0] = new FileInputStream("Auth.xml");
FileInputStream [] outbound_policy_array = new FileInputStream[1];
outbound_policy_array[0] = new FileInputStream("Auth.xml");
//create service and port
ImageService imageService = new ImageService_Impl(args[0]);
//specify an array of policy files for the request and response of a
//particular operation
ImageServiceSoap array_of_policy_port = imageService.getImageServiceSoap("ImagingFolioFetchMostRecent", inbound_policy_array, outbound_policy_array);
//create credential provider and set it to the Stub
List credProviders = new ArrayList();
//client side UsernameToken credential provider
CredentialProvider cp = new ClientUNTCredentialProvider("nsbbdl\\joejoe", "ImAGes!");
credProviders.add(cp);
Stub stub = (Stub)array_of_policy_port;
stub._setProperty(WSSecurityContext.CREDENTIAL_PROVIDER_LIST, credProviders);
try {
ApplicantDataFolio adf = array_of_policy_port.imagingFolioFetchMostRecent("1001917");
} catch (Throwable e) {
}

Similar Messages

  • How to set WS Username token programmatically in java?

    Hi,
    Jdev Version: 11.1.1.4.0.
    I have created a webservice proxy using Jdev from a wsdl.
    I need to invoke a service from the client. But for this I need to set the username token in SOAP header to access the service.
    The username token is not exposed or generated in the client.
    When I run it from SOAP ui, I manually enetered,
    <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <wsse:UsernameToken wsu:Id="UsernameToken-7" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <wsse:Username>1234</wsse:Username>
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">1111111111</wsse:Password>
    <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">XXXXXXXXXXXXXXXXXXXXXXXXXXX</wsse:Nonce>
    <wsu:Created>2012-03-02T23:41:44.511Z</wsu:Created>
    </wsse:UsernameToken>
    </wsse:Security>
    Without the username token I cannot invoke the service from my client code.
    How do I add the username token to the generated clients in ADF?
    Thanks in advance!!

    I tried it by setting the credentials in requestContext and got the error:
    Exception in thread "main" javax.xml.ws.WebServiceException: No Content-type in the header!
    at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:268)
         at com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:124)
         at com.sun.xml.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:121)
         at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:866)
         at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:815)
         at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:778)
         at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:680)
         at com.sun.xml.ws.client.Stub.process(Stub.java:272)
         at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:153)
         at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:115)
         at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:95)
         at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:136)
         at $Proxy35.ping(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at weblogic.wsee.jaxws.spi.ClientInstanceInvocationHandler.invoke(ClientInstanceInvocationHandler.java:84)
         at $Proxy36.ping(Unknown Source)
    Is there something else I need to do?
    Thanks!
    Edited by: 953940 on Oct 11, 2012 7:34 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;
         }

  • Problem configuring Username token profile on ALSB

    Hi All !!
    First of all, thanks for your support!!
    I'm facing a problem configuring an active intermediary Proxy service with username token profile. This proxy service has a security policy referencing Auth.xml file to implement Username token profile. That proxy calls a business service which calls a web service.
    On test page, username and password is requested (already created in the security domain), then an error is returned "Unable to add security token for identity".
    Below you can find the Invocation Trace:
    Invocation Trace
    (receiving request)
    Initial Message Context
    added $body
    <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <per:getPersona xmlns:per="http://com/indra/persona">
    <per:nombre>string</per:nombre>
    <per:apellidos>string</per:apellidos>
    </per:getPersona>
    </soapenv:Body>
    added $header
    <soapenv:Header xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    </soapenv:Header>
    added $inbound
    <con:endpoint name="ProxyService$PruebaWSsecurity$PersonaProxy92" xmlns:con="http://www.bea.com/wli/sb/context">
    <con:service>
    <con:operation>getPersona</con:operation>
    </con:service>
    <con:transport>
    <con:uri>/PersonaProxy92</con:uri>
    <con:mode>request-response</con:mode>
    <con:qualityOfService>best-effort</con:qualityOfService>
    <con:request xsi:type="http:HttpRequestMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <tran:headers xsi:type="http:HttpRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
    <http:Content-Type>text/xml; charset=utf-8</http:Content-Type>
    <http:SOAPAction>""</http:SOAPAction>
    </tran:headers>
    <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
    </con:request>
    <con:response xsi:type="http:HttpResponseMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <tran:headers xsi:type="http:HttpResponseHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
    <http:Content-Type>text/xml</http:Content-Type>
    </tran:headers>
    <tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports">0</tran:response-code>
    </con:response>
    </con:transport>
    *<con:security>*
    *<con:transportClient>*
    *<con:username><anonymous></con:username>*
    *</con:transportClient>*
    *<con:messageLevelClient>*
    *<con:username>securityUser</con:username>*
    *<con:principals>*
    *<con:group>Administrators</con:group>*
    *<con:group>IntegrationAdministrators</con:group>*
    *</con:principals>*
    *</con:messageLevelClient>*
    *</con:security>* </con:endpoint>
    added $messageID
    2741921765813726088-1b0fcf1c.12204e4868c.-8f3
    RouteNode1
    Routed Service
    Route to: "PersonaBusiness92"
    $outbound:
    <con:endpoint name="BusinessService$PruebaWSsecurity$PersonaBusiness92" xmlns:con="http://www.bea.com/wli/sb/context">
    <con:service>
    <con:operation>getPersona</con:operation>
    </con:service>
    <con:transport>
    <con:mode>request-response</con:mode>
    <con:qualityOfService>best-effort</con:qualityOfService>
    <con:request xsi:type="http:HttpRequestMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <tran:headers xsi:type="http:HttpRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
    <http:Content-Type>text/xml</http:Content-Type>
    <http:SOAPAction>""</http:SOAPAction>
    </tran:headers>
    </con:request>
    </con:transport>
    <con:security>
    <con:doOutboundWss>false</con:doOutboundWss>
    </con:security>
    </con:endpoint>
    $body (request):
    <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <per:getPersona xmlns:per="http://com/indra/persona">
    <per:nombre>string</per:nombre>
    <per:apellidos>string</per:apellidos>
    </per:getPersona>
    </soapenv:Body>
    $header (request):
    <soapenv:Header xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    </soapenv:Header>
    $attachments (request):
    <con:attachments xmlns:con="http://www.bea.com/wli/sb/context"/>
    Message Context Changes
    added $outbound
    <con:endpoint name="BusinessService$PruebaWSsecurity$PersonaBusiness92" xmlns:con="http://www.bea.com/wli/sb/context">
    <con:service>
    <con:operation>getPersona</con:operation>
    </con:service>
    <con:transport>
    <con:uri>http://esmadaix01:9103/WSPersona/Persona</con:uri>
    <con:mode>request-response</con:mode>
    <con:qualityOfService>best-effort</con:qualityOfService>
    <con:request xsi:type="http:HttpRequestMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <tran:headers xsi:type="http:HttpRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
    <http:Content-Type>text/xml; charset=utf-8</http:Content-Type>
    <http:SOAPAction>""</http:SOAPAction>
    </tran:headers>
    <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
    </con:request>
    <con:response xsi:type="http:HttpResponseMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <tran:headers xsi:type="http:HttpResponseHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
    <tran:user-header name="SOAPAction" value="&quot;&quot;"/>
    <tran:user-header name="X-Powered-By" value="Servlet/2.4 JSP/2.0"/>
    <http:Content-Type>text/xml; charset="utf-8"</http:Content-Type>
    <http:Date>Mon, 22 Jun 2009 10:34:18 GMT</http:Date>
    <http:Transfer-Encoding>chunked</http:Transfer-Encoding>
    </tran:headers>
    <tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports">0</tran:response-code>
    <tran:response-message xmlns:tran="http://www.bea.com/wli/sb/transports">OK</tran:response-message>
    <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
    <http:http-response-code>200</http:http-response-code>
    </con:response>
    </con:transport>
    <con:security>
    <con:doOutboundWss>false</con:doOutboundWss>
    </con:security>
    </con:endpoint>
    changed $header
    <soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>
    changed $inbound
    <con:endpoint name="ProxyService$PruebaWSsecurity$PersonaProxy92" xmlns:con="http://www.bea.com/wli/sb/context">
    <con:service>
    <con:operation>getPersona</con:operation>
    </con:service>
    <con:transport>
    <con:uri>/PersonaProxy92</con:uri>
    <con:mode>request-response</con:mode>
    <con:qualityOfService>best-effort</con:qualityOfService>
    <con:request xsi:type="http:HttpRequestMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <tran:headers xsi:type="http:HttpRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
    <http:Content-Type>text/xml; charset=utf-8</http:Content-Type>
    <http:SOAPAction>""</http:SOAPAction>
    </tran:headers>
    <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
    </con:request>
    <con:response xsi:type="http:HttpResponseMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <tran:headers xsi:type="http:HttpResponseHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
    <http:Content-Type>text/xml</http:Content-Type>
    </tran:headers>
    <tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports">0</tran:response-code>
    </con:response>
    </con:transport>
    <con:security>
    <con:transportClient>
    <con:username><anonymous></con:username>
    </con:transportClient>
    <con:messageLevelClient>
    <con:username>securityUser</con:username>
    <con:principals>
    <con:group>Administrators</con:group>
    <con:group>IntegrationAdministrators</con:group>
    </con:principals>
    </con:messageLevelClient>
    </con:security>
    </con:endpoint>
    changed $attachments
    <con:attachments xmlns:con="http://www.bea.com/wli/sb/context"/>
    changed $body
    <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <m:getPersonaResponse xmlns:m="http://com/indra/persona">
    <persona>
    <correo>[email protected]</correo>
    <telefono>91546789</telefono>
    </persona>
    </m:getPersonaResponse>
    </soapenv:Body>
    System Error Handler
    $fault: <con:fault xmlns:con="http://www.bea.com/wli/sb/context">
    <con:errorCode>BEA-386201</con:errorCode>
    *<con:reason>*
    *A web service security fault occurred[{http://schemas.xmlsoap.org/soap/envelope/}Server][Unable to add security token for identity]*
    *</con:reason>*
    <con:details>
    <err:WebServiceSecurityFault xmlns:err="http://www.bea.com/wli/sb/errors">
    <err:faultcode xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">soapenv:Server</err:faultcode>
    <err:faultstring>
    Unable to add security token for identity
    </err:faultstring>
    </err:WebServiceSecurityFault>
    </con:details>
    <con:location>
    <con:path>response-pipeline</con:path>
    </con:location>
    </con:fault>

    We have the same problem.
    Have you the reposne?
    Request Document
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    </soap:Header>
    <soapenv:Body>
    <t17:pais_getByDesc xmlns:t17="http://www.ejie.es/webServiceEJB/t17iApiWSWar">
    <t17:value>bul</t17:value>
    <t17:responseWithParents>false</t17:responseWithParents>
    </t17:pais_getByDesc>
    </soapenv:Body>
    </soapenv:Envelope>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <wsse:Security soap:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <wsse:UsernameToken wsu:Id="unt_ZqnW7MTAb7P77cPL" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <wsse:Username>weblogic10</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:UsernameToken>
    </wsse:Security>
    </soap:Header>
    <soapenv:Body>
    <t17:pais_getByDesc xmlns:t17="http://www.ejie.es/webServiceEJB/t17iApiWSWar">
    <t17:value>bul</t17:value>
    <t17:responseWithParents>false</t17:responseWithParents>
    </t17:pais_getByDesc>
    </soapenv:Body>
    </soapenv:Envelope>
    Response Document
    The invocation resulted in an error: .
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header/>
    <env:Body>
    <env:Fault>
    <faultcode>env:Server</faultcode>
    <faultstring>
    Unable to add security token for identity
    </faultstring>
    </env:Fault>
    </env:Body>
    </env:Envelope>
    Response Metadata
    <con:metadata xmlns:con="http://www.bea.com/wli/sb/test/config">
    <tran:headers xsi:type="http:HttpResponseHeaders" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <http:Content-Type>text/xml; charset=utf-8</http:Content-Type>
    </tran:headers>
    <tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports">1</tran:response-code>
    <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
    </con:metadata>
    Invocation Trace
    (receiving request)
    Initial Message Context
    added $body
    <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <t17:pais_getByDesc xmlns:t17="http://www.ejie.es/webServiceEJB/t17iApiWSWar">
    <t17:value>bul</t17:value>
    <t17:responseWithParents>false</t17:responseWithParents>
    </t17:pais_getByDesc>
    </soapenv:Body>
    added $header
    <soapenv:Header xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    </soapenv:Header>
    added $inbound
    <con:endpoint name="ProxyService$ctxweb$t17i_wss-1" xmlns:con="http://www.bea.com/wli/sb/context">
    <con:service>
    <con:operation>pais_getByDesc</con:operation>
    </con:service>
    <con:transport>
    <con:uri>/ctxweb/t17i_wss_1</con:uri>
    <con:mode>request-response</con:mode>
    <con:qualityOfService>best-effort</con:qualityOfService>
    <con:request xsi:type="http:HttpRequestMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <tran:headers xsi:type="http:HttpRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
    <http:Content-Type>text/xml; charset=utf-8</http:Content-Type>
    <http:SOAPAction>""</http:SOAPAction>
    </tran:headers>
    <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
    </con:request>
    <con:response xsi:type="http:HttpResponseMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <tran:headers xsi:type="http:HttpResponseHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
    <http:Content-Type>text/xml</http:Content-Type>
    </tran:headers>
    <tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports">0</tran:response-code>
    </con:response>
    </con:transport>
    <con:security>
    <con:transportClient>
    <con:username><anonymous></con:username>
    </con:transportClient>
    <con:messageLevelClient>
    <con:username>weblogic10</con:username>
    <con:principals>
    <con:group>AdminChannelUsers</con:group>
    <con:group>Administrators</con:group>
    <con:group>IntegrationAdministrators</con:group>
    </con:principals>
    </con:messageLevelClient>
    </con:security>
    </con:endpoint>
    added $messageID
    6412299231164769748--466a8253.12535a4d4fe.-7f29
    RouteTo_NORA-bs
    Routed Service
    Route to: "NORA-bs"
    $outbound:
    <con:endpoint name="BusinessService$business$NORA-bs" xmlns:con="http://www.bea.com/wli/sb/context">
    <con:service>
    <con:operation>pais_getByDesc</con:operation>
    </con:service>
    <con:transport>
    <con:mode>request-response</con:mode>
    <con:qualityOfService>best-effort</con:qualityOfService>
    <con:request xsi:type="http:HttpRequestMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <tran:headers xsi:type="http:HttpRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
    <http:Content-Type>text/xml</http:Content-Type>
    <http:SOAPAction>""</http:SOAPAction>
    </tran:headers>
    </con:request>
    </con:transport>
    <con:security>
    <con:doOutboundWss>false</con:doOutboundWss>
    </con:security>
    </con:endpoint>
    $body (request):
    <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <t17:pais_getByDesc xmlns:t17="http://www.ejie.es/webServiceEJB/t17iApiWSWar">
    <t17:value>bul</t17:value>
    <t17:responseWithParents>false</t17:responseWithParents>
    </t17:pais_getByDesc>
    </soapenv:Body>
    $header (request):
    <soapenv:Header xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    </soapenv:Header>
    $attachments (request):
    <con:attachments xmlns:con="http://www.bea.com/wli/sb/context"/>
    Message Context Changes
    added $outbound
    <con:endpoint name="BusinessService$business$NORA-bs" xmlns:con="http://www.bea.com/wli/sb/context">
    <con:service>
    <con:operation>pais_getByDesc</con:operation>
    </con:service>
    <con:transport>
    <con:uri>
    http://www.integracion.jakina.ejiedes.net/t17iApiWSWar/t17iApiWS
    </con:uri>
    <con:mode>request-response</con:mode>
    <con:qualityOfService>best-effort</con:qualityOfService>
    <con:request xsi:type="http:HttpRequestMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <tran:headers xsi:type="http:HttpRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
    <http:Content-Type>text/xml; charset=utf-8</http:Content-Type>
    <http:SOAPAction>""</http:SOAPAction>
    </tran:headers>
    <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
    </con:request>
    <con:response xsi:type="http:HttpResponseMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <tran:headers xsi:type="http:HttpResponseHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
    <tran:user-header name="Set-Cookie" value="JSESSIONID=Q02mLVvKw8hRcvYm7nwmyJyCQHC2FJknpGbltNPnsqp2gstzHy0M!-1566668667!734317392; path=/"/>
    <http:Connection>close</http:Connection>
    <http:Content-Length>666</http:Content-Length>
    <http:Content-Type>text/xml; charset=utf-8</http:Content-Type>
    <http:Date>Tue, 01 Dec 2009 14:59:22 GMT</http:Date>
    <http:Server>
    Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.7a
    </http:Server>
    </tran:headers>
    <tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports">0</tran:response-code>
    <tran:response-message xmlns:tran="http://www.bea.com/wli/sb/transports">OK</tran:response-message>
    <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
    <http:http-response-code>200</http:http-response-code>
    </con:response>
    </con:transport>
    <con:security>
    <con:doOutboundWss>false</con:doOutboundWss>
    </con:security>
    </con:endpoint>
    changed $body
    <env:Body xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <m:pais_getByDescResponse xmlns:m="http://www.ejie.es/webServiceEJB/t17iApiWSWar">
    <n1:result xsi:type="n2:ArrayOfPais" xmlns:n1="http://www.ejie.es/webServiceEJB/t17iApiWSWar" xmlns:n2="java:t17i.vo">
    <n2:Pais xsi:type="n2:Pais">
    <n2:descripcionOficial>Bulgaria</n2:descripcionOficial>
    <n2:id>104</n2:id>
    </n2:Pais>
    </n1:result>
    </m:pais_getByDescResponse>
    </env:Body>
    changed $attachments
    <con:attachments xmlns:con="http://www.bea.com/wli/sb/context"/>
    changed $inbound
    <con:endpoint name="ProxyService$ctxweb$t17i_wss-1" xmlns:con="http://www.bea.com/wli/sb/context">
    <con:service>
    <con:operation>pais_getByDesc</con:operation>
    </con:service>
    <con:transport>
    <con:uri>/ctxweb/t17i_wss_1</con:uri>
    <con:mode>request-response</con:mode>
    <con:qualityOfService>best-effort</con:qualityOfService>
    <con:request xsi:type="http:HttpRequestMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <tran:headers xsi:type="http:HttpRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
    <http:Content-Type>text/xml; charset=utf-8</http:Content-Type>
    <http:SOAPAction>""</http:SOAPAction>
    </tran:headers>
    <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
    </con:request>
    <con:response xsi:type="http:HttpResponseMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <tran:headers xsi:type="http:HttpResponseHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
    <http:Content-Type>text/xml</http:Content-Type>
    </tran:headers>
    <tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports">0</tran:response-code>
    </con:response>
    </con:transport>
    <con:security>
    <con:transportClient>
    <con:username><anonymous></con:username>
    </con:transportClient>
    <con:messageLevelClient>
    <con:username>weblogic10</con:username>
    <con:principals>
    <con:group>AdminChannelUsers</con:group>
    <con:group>Administrators</con:group>
    <con:group>IntegrationAdministrators</con:group>
    </con:principals>
    </con:messageLevelClient>
    </con:security>
    </con:endpoint>
    changed $header
    <soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>
    System Error Handler
    $fault: <con:fault xmlns:con="http://www.bea.com/wli/sb/context">
    <con:errorCode>BEA-386201</con:errorCode>
    <con:reason>
    A web service security fault occurred[{http://schemas.xmlsoap.org/soap/envelope/}Server][Unable to add security token for identity]
    </con:reason>
    <con:details>
    <err:WebServiceSecurityFault xmlns:err="http://www.bea.com/wli/sb/errors">
    <err:faultcode xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">soapenv:Server</err:faultcode>
    <err:faultstring>
    Unable to add security token for identity
    </err:faultstring>
    </err:WebServiceSecurityFault>
    </con:details>
    <con:location>
    <con:path>response-pipeline</con:path>
    </con:location>
    </con:fault>

  • What needs to configured to support UserName Token Profile for WS Security

    Hi,
    Using Weblogic 8.1. Have a bunch of web services. Want to support a UserName Token Profile thru Identity assertion. If we use the default authenticator and defaut Identity assertor will it work ? We'll configure the username / pwd thru WebLogic console for the realm.
    Thanks

    This implies that ODP.NET does NOT need to be installed on a client. However, I cannot find OraOPs9.dll on a machine with Client Release 9.2 installed. Should OraOps?.dll automatically come with a Client installation of 9.2 or higher?
    ODP.NET needs to be installed on the client. OraOps9.dll is part of ODP.NET, not the Oracle Client.
    Also, if an application is built with the 10g ODP.NET, can it be run from a machine with OraOps9.dll?
    If an application is built with 10g ODP.NET, it can be run with 9.2 ODP.NET as long as you do not use any 10g APIs. The new features in 10g ODP.NET are included in the doc and the ODP.NET FAQ for your reference.

  • Oracle Service Registry - UserName Token profile

    Hi,
    My web services use UserName Token profile for authentication. It also supports encryption. Is there a way to publish these information along with the wsdl?
    Steve

    Thank you for your helpful reply!
    Although the installation appears to fail, the db schema is actually created.
    Thus, when I run installation the next time, having selected an existing db schema, all appears to go well.
    NA
    http://nickaiva.blogspot.com
    Edited by: Nick Aiva on Dec 29, 2010 10:20 AM

  • Pass Username token in Web Service Client

    I am totally new to Java....I work primarily with .Net. I am trying to send a Username token to a web service. I looked at the examples...can't get them to run.
    My question is, without using config files, can I specify username token in the class. You can do this in .Net.
    I am working with .NetBeans IDE 5.0.

    I looked at this example....didn't get to far because I couldn't setup the samples.
    http://java.sun.com/webservices/docs/1.6/tutorial/doc/XWS-SecuritySamples5.html#wp569635
    Here is the guide I followed to setup the samples.
    http://java.sun.com/webservices/docs/1.6/tutorial/doc/XWS-SecuritySamples2.html
    I didn't do the part about the keystore. I got stuck on the "Setting Build Properties", and I don't know how to run the samples.
    Are you saying there is no way of creating a java application, creating the web service client with JWSDP 2.0 and then modifying either the generated code or my main.class to set the username and token properties?
    Thanks, Mike L.

  • Set username/password using in Java client proxy for a JAX-WS webservice

    Hi, i am invoking one deployed EBS webservice , while trying to run that client program me
    i am getting error WSSE security, where can i set Uname pwd , through java program me
    ++Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Missing <wsse:Security> in SOAP Header
    Thanks Regards
    Raj
    Edited by: 952094 on Jan 23, 2013 1:42 PM

    import java.util.ArrayList;
    import java.util.List;
    import java.util.Map;
    import javax.xml.ws.BindingProvider;
    import weblogic.wsee.security.unt.ClientUNTCredentialProvider;
    import weblogic.xml.crypto.wss.WSSecurityContext;
    import weblogic.xml.crypto.wss.provider.CredentialProvider;
    you can add username for weblogic client using
    // Create list of credential providers
    List credProviders = new ArrayList();
    // Create user name token provider
    ClientUNTCredentialProvider unt = new ClientUNTCredentialProvider("weblogic", "weblogic");
    credProviders.add(unt);
    credProviders.add(cp);
    // Finally add the credential providers to the request context
    Map<string, object=""> requestContext = ((BindingProvider)brokerService).getRequestContext();
    requestContext.put(WSSecurityContext.CREDENTIAL_PROVIDER_LIST, credProviders);

  • How do you use .wsse policy file from Java Client?

    I'd like to call a WSSE enabled web service from my Java client but setup my encryption/signing requirements with a .wsse policy file.
    I know how to call a web service by programmatically setting up the security headers as described in:
    http://e-docs.bea.com/workshop/docs81/doc/en/core/index.html
    But how can I do the same thing by simply using a .wsse file?

    import java.awt.*;
    import java.applet.Applet;
    import java.awt.event.*;
    import java.net.*;
    public class links extends java.applet.Applet {
       Panel panel = new Panel();
       public links(){
          super();
          add(panel);
          Link link = new Link(this,"Answers for programmers;- ","http://forum.java.sun.com");
          panel.add(link);
       public void init(){
          setVisible(true);
       public class Link extends Label implements MouseListener {
          Applet applet;
          Color fcolor = Color.blue;
          Color lcolor = Color.pink;
          String text;
          String word;
       public Link(Applet ap, String s, String s1){
          super(s);
             this.applet = ap;
             this.text = s;
             this.word = s1;
             addMouseListener(this);
          setForeground(fcolor);
       public void paint(Graphics g){
       super.paint(g);
          if (getForeground() == lcolor){
             Dimension d = getSize();
             g.fillRect(1,d.height-5,d.width,1);
       public void update(Graphics g){paint(g);}
       public void mouseClicked(MouseEvent e){
          try{
             URL url = new URL(word);
             applet.getAppletContext().showDocument(url,"_self");
          catch(MalformedURLException er){ }
       public void mouseEntered(MouseEvent e){
          setForeground(lcolor);
          setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
          repaint();
       public void mouseExited(MouseEvent e){
          setForeground(fcolor);
          setCursor(Cursor.getDefaultCursor());
          repaint();
    public void mousePressed(MouseEvent e){}
    public void mouseReleased(MouseEvent e){}
       public static void main (String[] args){
          new links(); 
    }

  • URGENT ::: How to add UserName Token to SOAP Message Header.

    Hi,
    I created a webservice client using CLIENTGEN utility of weblogic from the WSDL file. When I am trying to call a webservice which is hosted on TOMCAT server, I am getting the following exception::
    5/12/2008 06:09:02 com.sun.xml.wss.impl.filter.DumpFilter process
    INFO: ==== Sending Message Start ====
    <?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://settlementService.au.db.com/types">
    <env:Body>
    <env:Fault>
    <faultcode xmlns:ans1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">ans1:FailedAuthentication</faultcode>
    <faultstring>Message does not conform to configured policy [ AuthenticationTokenPolicy  ]: No Security Header found</faultstring>
    </env:Fault>
    </env:Body>
    </env:Envelope>
    ==== Sending Message End ====
    The webservice ic configured as secured webservice, there is some certificate file which was provided to me from client. Useing java KEYTOOL command I have created the keystore from that certificate and configure it in the weblogic server console.
    Issue is the SOAP message header is blank I need to add the USERNAME TOken profile to this header, in order to access this webservice. The current CLIENT code snippet is shown below:
              try{
                   String WSDLUrl = "https://shappzu2.au.db.com:8297/settlementService-ws/settlementService?WSDL";
                   String wsUserName = "tracer-us";
                   String wsPassword = "R0na!do#11";
                   InputStream[] policies = new InputStream[]{Client.class.getResourceAsStream("/wl-unt-policy.xml")};
                   SettlementService_Impl settlementServiceObj = new SettlementService_Impl(WSDLUrl);
                   SettlementServiceFacade port = settlementServiceObj.getSettlementServiceFacadePort(policies, policies);               
                   List credProviders = new ArrayList();
                   CredentialProvider cp = new ClientUNTCredentialProvider(wsUserName.getBytes(), wsPassword.getBytes());
              credProviders.add(cp);
              Stub stub = (Stub)port;
              // Set stub property to point to list of credential providers
              stub._setProperty(WSSecurityContext.CREDENTIAL_PROVIDER_LIST, credProviders);
                   if(sharesXMLString != null && sharesXMLString.length() > 0) {
                        port.loadEquityTrade(sharesXMLString);
              }catch(Exception e){
                   //throw new SystemException(e.getMessage());
                   e.printStackTrace();
    Can any one help me in this?

    1) Use something like TCPmon https://tcpmon.dev.java.net/ or verbose logging to see the actual message content on the wire that the client is sending
    2) Inside the WLS samples there is a UNT sample in the INSTALL_DIR/wlserver_10.0(or equivalent)/samples/server/examples/src/examples/webservices/security_jws
    If that works correctly and puts the UNT in the header, then I would compare that code with yours.

  • Call OSB from java client

    Hi',
    I am trying to call OSB from java client,
    The OSB proxy Service type is "WSDL Web Service", I am able to get response from SOAP UI with below request, Please help me with Java code,
    I have been Googling a lot for this however didnt got enough.
    Thanks
    Yatan
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://core.xxx.com/schema/ServiceHeader/V1.0" xmlns:v11="http://core.xxx.com/schema/Customer/V1.0" xmlns:v12="http://core.xxx.com/schema/Customer/V1.0">
    <soapenv:Header>
    <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <wsse:UsernameToken wsu:Id="UsernameToken-2" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <wsse:Username>weblogic</wsse:Username>
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">welcome1</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    <v1:GMWSHeader>
    <v1:SourceId>String</v1:SourceId>
    <v1:TransactionId>String</v1:TransactionId>
    <v1:TransactionTimeStamp>1967-08-13</v1:TransactionTimeStamp>
    <v1:ServiceVersion>LATEST</v1:ServiceVersion>
    </v1:GMWSHeader>
    </soapenv:Header>
    <soapenv:Body>
    <v11:GetDetailsRequest>
    <v11:Condition>
    <v12:SellingSource>?</v12:SellingSource>
    <v12:FulfillingFCNNbr>?</v12:FulfillingFCNNbr>
    </v11:Condition>
    </v11:GetDetailsRequest>
    </soapenv:Body>
    </soapenv:Envelope>

    Thanks Guys, I tried the ways you mentioned I am getting below error, this error is coming in both weblogic clientgen and webservice proxy from jdeveloper,
    I understand that this error has something to do with my process however not sure why is it coming, I will really appreciate if you can provide me some pointers.
    error:
    Buildfile: C:\JDeveloper\OSBClient\TestOSBClient\build.xml
    javaFromWSDL:
    [clientgen]
    *********** jax-ws clientgen attribute settings ***************
    wsdlURI: http://localhost:8001/xx/som/contracts/CustomerContract?wsdl
    packageName : com.osb.client
    destDir : C:\OSB
    *********** jax-ws clientgen attribute settings end ***************
    [clientgen] Consider using <depends>/<produces> so that wsimport won't do unnecessary compilation
    [clientgen] parsing WSDL...
    [clientgen]
    [clientgen]
    [clientgen] [ERROR] A class/interface with the same name "com.osb.client.SOMMessage" is already in use. Use a class customization to resolve this conflict.
    [clientgen] line 89 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
    [clientgen]
    [clientgen] [ERROR] (Relevant to above error) another "SOMMessage" is generated from here.
    [clientgen] line 51 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
    [clientgen]
    [clientgen] [ERROR] A class/interface with the same name "com.osb.client.TaskCompletionMessage" is already in use. Use a class customization to resolve this conflict.
    [clientgen] line 82 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
    [clientgen]
    [clientgen] [ERROR] (Relevant to above error) another "TaskCompletionMessage" is generated from here.
    [clientgen] line 76 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
    [clientgen]
    [clientgen] [ERROR] Two declarations cause a collision in the ObjectFactory class.
    [clientgen] line 89 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
    [clientgen]
    [clientgen] [ERROR] (Related to above error) This is the other declaration.
    [clientgen] line 51 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
    [clientgen]
    [clientgen] [ERROR] Two declarations cause a collision in the ObjectFactory class.
    [clientgen] line 82 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
    [clientgen]
    [clientgen] [ERROR] (Related to above error) This is the other declaration.
    [clientgen] line 76 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
    [clientgen]
    BUILD FAILED
    weblogic.wsee.tools.WsBuildException: Error running JAX-WS clientgen: null
         at weblogic.wsee.tools.clientgen.jaxws.ClientGenImpl.execute(ClientGenImpl.java:175)
         at weblogic.wsee.tools.anttasks.ClientGenFacadeTask.execute(ClientGenFacadeTask.java:244)
         at weblogic.wsee.tools.anttasks.ClientGenTask.execute(ClientGenTask.java:365)
         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatinxxethodAccessorImpl.invoke(DelegatinxxethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
         at org.apache.tools.ant.Task.perform(Task.java:348)
         at org.apache.tools.ant.Target.execute(Target.java:357)
         at org.apache.tools.ant.Target.performTasks(Target.java:385)
         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
         at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
         at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
         at org.apache.tools.ant.Main.runBuild(Main.java:758)
         at org.apache.tools.ant.Main.startAnt(Main.java:217)
         at org.apache.tools.ant.Main.start(Main.java:179)
         at org.apache.tools.ant.Main.main(Main.java:268)
    Caused by: Error starting wsimport:
         at com.sun.tools.ws.ant.WsImport2.execute(WsImport2.java:757)
         at weblogic.wsee.tools.clientgen.jaxws.ClientGenImpl.execute(ClientGenImpl.java:169)
         ... 19 more
    Caused by: com.sun.tools.ws.wscompile.AbortException
         at com.sun.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:136)
         at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2255)
         at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:194)
         at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:140)
         at com.sun.tools.ws.wscompile.WsimportTool.buildWsdlModel(WsimportTool.java:261)
         at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:203)
         at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:188)
         at com.sun.tools.ws.ant.WsImport2.execute(WsImport2.java:738)
         ... 20 more
    Total time: 3 seconds

  • How to pass username/password through WebService proxy client to E-BS.

    Hi
    We are using ADF Webservice proxy client to integrate E-Business suite with ADF. It asks for username/password to access details from E-BS. In the generated webservice XSD file, a method is available with 2 parameters.
    1) SOAP header( Contains Username, responsibility and 2 more fields)
    2) Class object(Nested Object)
    However i didn't find "*Password*" field anywhere in it. Then how can I pass "*Password*" along with username to invoke this method?
    When i checked SOAP, the password is defined like this
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">XXXX</wsse:Password>a
    Thanks
    Raja

    hi Dario
    Thank you for your post. It is really helpful. Now I got stuck with a doubt, in this piece of code
    final Binding binding = ((BindingProvider) servicePort).getBinding();
    List<Handler> handlerList = binding.getHandlerChain();
    if (handlerList == null)
    handlerList = new ArrayList<Handler>();
    They didn't mention properly about "*servicePort*". What object is this?
    I checked in Oracle document, even in that I was not clear with that piece of code.
    public class HandlerWS{ 
    @Resource WebServiceContext ctx;
    @WebMethod()
    public String getProperty(String propertyName) {  
    return (String) ctx.getMessageContext().get(propertyName);
    public class Main {
    public static void main(String[] args) {
    HandlerWS test;
    try {
    test = new HandlerWS(new URL(args[0] + "?WSDL"), new
    QName("http://example.org", "HandlerWS") );
    } catch (MalformedURLException murl) { throw new RuntimeException(murl); }
    HandlerWSPortType port = test.*getHandlerWSPortTypePort*();
    What is this HandlerWSPortType object???. Can you give me little more explanation about it?
    Thanks

  • Catching SOAPException at Java Client

    We have a 3 tier application where in Front End is in Java , Middle layer is in SOAP deployed using Systinet Server for c++ and backend is in DCE( Distributed Computing Environment ) .
    We are calling DCE specific RPC through a SOAP Services, now when a specific DCERPC fails, SOAP Server binary crashes and on Front end Java , only Temporary delays error message gets displayed.
    SOAP Java Client code files are generated using WSDL , now at SOAPServer CPP exception is written using inbuilt Systinet Exception handling mechanism
    and the same has to be caught at the Java side.
    In CPP side , the code for Trims
         if (ret_status != rpc_s_ok) {
              dce_ret = 0;
         WASP_GenericFaultException * gen_exc = new WASP_GenericFaultException("DCE ERROR - calling WF_ListWuClnt() RPC");
              WASP_VString reason = "RPC Failure, return status = " + ret_status;
    gen_exc->setReason(reason, "en");
    throw gen_exc;
    Now for Java Client , we have written a custom exception class as below
    public class TrimsCustomException extends javax.xml.soap.SOAPException
         public String msgId;
         public     String msgText;
         public TrimsCustomException()
                   //Default Constructor
         public TrimsCustomException(String Id,String Txt)
                   this.msgId=Id;
                   this.msgText=Txt;
         public String getMsgId()
                   return msgId;
         public String getMessage()
                   return msgText;
    Still is there any better way to catch the exception ?

    here is the following code :
         public byte[] marshall()
              StringBuffer payload = new StringBuffer("<?xml version=\'1.0\' encoding=\'UTF-8\'?>");
              payload.append("<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">");
              payload.append("<soap:Body>");
              payload.append("<Bonjour xmlns=\"http://tempuri.org/\">");
              payload.append("<strName>elise</strName>");
              payload.append("</Bonjour>");
              payload.append("</soap:Body>");
              payload.append("</soap:Envelope>\r\n");
              System.out.println(payload.toString());
              return payload.toString().getBytes();
    AND FOR THE CONNECTION :
    URL endpoint = new URL("http://biztalk:8080/PCS_Integration/SynchronizeProfiles.asmx");
              URLConnection con = endpoint.openConnection ();
              con.setDoInput (true);
              con.setDoOutput (true);
              con.setUseCaches (false);
              con.setAllowUserInteraction(false);
              con.setRequestProperty ("Content-Length", Integer.toString (request.length));
              con.setRequestProperty ("Content-Type", "text/xml; charset=utf-8");
              con.setRequestProperty ("SOAPAction", "\"http://tempuri.org/WS_UpdateProfileAgency\"");
              OutputStream out = con.getOutputStream ();
              out.write (request);
              out.flush ();
              out.close();
                   InputStream in = con.getInputStream();
    //then parse the xml result
    hope it can help you

  • Access denied security policy file

    All i a simple client which is trying to talk to a remote EJB. When i try and startup the client i get the following error.
    java.security.AccessControlException: access denied (java.util.PropertyPermission java.security.policy write)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
         at java.security.AccessController.checkPermission(AccessController.java:427)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         at java.lang.System.setProperty(System.java:699)
         at com.db.abmonitor.client.Client.example(Client.java:51)And i am calling it like
    System.setProperty("java.security.policy", "client.policy");
           if (System.getSecurityManager() == null)
           System.setSecurityManager(new RMISecurityManager());  And i have defined a client.policy file in the src directory of the project under eclipse, with the following entries
    grant {
         permission java.security.AllPermission;
    };Anyone got any ideas ?

    Ah RMI headaches...
    here is what i blogged for my own self when i was starting with the RMI security stuff:
    Since i havent figured out how to do SecurityManager stuff properly, i can override 2 checkPermission methods in SecurityManager with empty method bodies, thats a quick and dirty fix.
    - Alternativly, you can set your policy file located in /lib/security/java.policy to: http://java.sun.com/docs/books/tutorial/rmi/example-1dot2/java.policy
    - or pass the property to the policy location: -Djava.security.policy=./policy.all
    maybe that will help...
    i think that maybe your policy file isnt being found where it should be

  • How to create a custom java client Security Policy File?

    I have a stand-alone java client which invokes a .NET WSE 3.0 enabled web service. The web service SOAP header requires username token to be passed from my java client.
    Could some one kindly provide a sample of a client-side Security Policy File?
    Your help is very much appreciated.
    Mike

    This is still a workaround...
    But if you put checks on all your forms to see if the user has accepted the terms (assumes there is an attribute tracking this) then you can redirect the user to the terms/conditions forms. Still not spoof-proof, but it would be bookmark proof. (and a pain if you have too many forms)

Maybe you are looking for

  • The dreaded 3F0, "hard disk not exist" problem

    Okay, I have a degree in EE with a minor in comp sci.  I understand how bios' work, etc.  This is why the "answers" HP "tech support" gave me make absolutely no sense.   Could someone please shed some light on this bizarre problem?   I am trying to i

  • How do i install the Motion2 content?

    Sorry for the lame post, but I have RTFM and tried installing Final Cut Studio all afternoon and it just wont install the Motion content or Live Type content. The apps themselves seem to be fine and i have even registered and got the new free filters

  • Adf uix and blaf

    Hello I've known The Browser Look and Feel (BLAF). I'd like to use that to do a form printable page (in a new window) without the navigation buttons . In next link there's an explanation but really I can't understand how I must use BLAF in my uix pag

  • HT200117 i Mac OS X 10.5.8 upgrade to Mountain Lion or Snow leopard?

    I have i Mac OS X 10.5.8. Is there anyway to upgrade to Mountain Lion or Snow leopard?

  • Anyone else have issues with no push notifications for ScoreCenter and CNBC RT?

    Ever since updating to the iPhone 5, I have been unable to recieve push notifcations for my team alerts in ScoreCenter, but breaking news alerts work fine. I have tried deleting and reinstalling with no sucess. The same goes for CNB RT. No push notif