1

We have webservice deployed on weblogic that implements oasis wsse. Then I created the client using wsconsume from jboss (later tried metro) and called the web service. It always throws an error, I tried to create a test client in soapUI that is sent successfully and found out that the request produced by jboss doesn't match.

There are 2 difference that I've found: 1.) DateToken: Working:

<wsu:Created>2011-09-06T08:22:14.515Z</wsu:Created>

Not working:

<wsse:Created>2011-09-07T06:12:37.322Z</wsse:Created>

2.) Password Type: Working:

<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">OB7izBPcPE0sfJaAEdD1uIrlFT4=</wsse:Password>

Not working:

<wsse:Password Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#PasswordDigest'>trvFhf0ZCHQy4cBtNu984fs/nIg=</wsse:Password>

This is how I call the web service from client:

URL clientSideSecurityfile = new File("jboss-wsse-client.xml").toURI().toURL();
BindingProvider bp = (BindingProvider) port;
((StubExt) port).setSecurityConfig(clientSideSecurityfile.toExternalForm());
((StubExt) port).setConfigName("Standard WSSecurity Client");
bp.getRequestContext().put(StubExt.PROPERTY_AUTH_TYPE, StubExt.PROPERTY_AUTH_TYPE_BASIC);
bp.getRequestContext().put(StubExt.PROPERTY_CLIENT_TIMEOUT, 30000); 
bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "usernmae");
bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "password");
responseACK = port.callWebService();

I'm using jboss4.2.3, jbossws-client 3.0.1-native-2.0.4.GA.

Any idea how to resolve this? It seems jbossws is producing wrong wsse tag which should be wsu for datetoken and type for password :-?.

czetsuya
  • 4,773
  • 13
  • 53
  • 99

1 Answers1

1

According to the UsernameToken profile specification it should be,

<wsu:Created>

Where

wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-
1.0.xsd"

Also, as per the specification type should be,

Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest"

Both;

<wsse:Created>2011-09-07T06:12:37.322Z</wsse:Created>

And

<wsse:Password Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#PasswordDigest'>trvFhf0ZCHQy4cBtNu984fs/nIg=</wsse:Password>

are, not compliant with the specification...

Prabath Siriwardena
  • 5,891
  • 1
  • 27
  • 34
  • hi Thanks for the quick reply, but apparently jbossws native generated those 2 wrong tags as I have said. Any work around in this? Perhaps using other stack :-? – czetsuya Sep 08 '11 at 13:44
  • You can have your client generated using Apache Axis2.. It comes with tool called wsdl2java to generate client stubs from a given wsdl... – Prabath Siriwardena Sep 08 '11 at 13:53