cancel
Showing results for 
Search instead for 
Did you mean: 

SoapSecurityException: WSEC5509E- UsernameToken is required

Former Member
0 Kudos

Dear All,

I am consuming a secure 3rd party webservice using stateless session bean in EJB DC in CE 7.1 SP11.

I have imported the wsdl file and generated the client proxy.

I have webservices reference @WebServiceRef(name = "ABCService")

I am setting user credentials as shown below:

context.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "https://<host>:<port>/services/ABCService/v1");

context.put(BindingProvider.USERNAME_PROPERTY,"abcd");

context.put(BindingProvider.PASSWORD_PROPERTY,"xxxx");

In Web service administration (SOA Management-> Business Admin), I could see my proxy under Proxy definition name.

With the default Logical Port, I have assigned HTTP Authentication as X.509 client certificate and Messaging as "Transfer via SOAP Header".

I have created a Destination Template (SOA Management->Technical Configuration->Destination Template Mgmt) with the same name as my default logical port.

When I try to execute my service, I am getting below error message:

javax.xml.ws.soap.SOAPFaultException: com.ibm.wsspi.wssecurity.SoapSecurityException: WSEC5509E: A security token whose type is [http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken] is required.

at com.sap.engine.services.webservices.espbase.client.bindings.impl.JAXWSUtil.processFault(JAXWSUtil.java:341)

Please suggest me

Regards,

Patana

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello!

Try to get the XML request: switch on log and trace (full) in SOAMANAGER, restart Your application and invoke the webservice:

Transaction SOAMANAGER, tab 'Logs and Traces'
- 'Logs Configuration': create a new entry with Your interface name and username, log level: all entries
- 'Trace Configuration': create a new entry with Your interface name and username, trace level: full trace

Restart and invoke Your interface (the webservice consumer). Back to the SOAMANGER, go to 'Logs/Trace Viewer'; search for the last 30 minutes and select Your line (probably marked with a red icon). Then select the tab 'Payload Trace' and inspect the XML request:
- verify the UsernameToken - element,

- verify username/password

Inspect also the XML response, maybe the server requires the password type, which is usually NOT provided by SAP. If this is the case, please reply.

After the test, remove Your log/trace settings (for performance and disk space saving).

It is always a good idea to test the webservice with SOAPUI (which will surely succeed) and to compare both requests.