2 Replies Latest reply: Jan 23, 2013 10:54 PM by raj_in RSS

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

    raj_in
      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
        • 1. Re: Set username/password using in Java client proxy for a JAX-WS webservice
          User696-Oracle
          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);
          • 2. Re: Set username/password using in Java client proxy for a JAX-WS webservice
            raj_in
            You are not got my point
            this is my security header , i have include this By handlers or something like that into header part of my soap Request Headerpart

            <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" mustUnderstand="1">
            <wsse:UsernameToken>
            <wsse:Username>sysadmin</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">sysadmin</wsse:Password>
            </wsse:UsernameToken>
            </wsse:Security>

            Thanks Regards
            Raj