简体   繁体   中英

What is the easiest way (and ws-stack) to implement stand alone client to consume web service with security?

I need to consume a webservice with ws-security using a stand alone java client, I can't use the metro stack as I need to change the wsdl to include policies, any idea on which stack to use ? I prefer to avoid scrap (stacks which I will need to spend a quarter trying to configure it)... for example, I downloaded jboss 6 to use its wsrunclient.bat, but it didn't work and I had Spring exception (WHAT IS THE RELATION BETWEEN JBOSS AND SPRING!!!!) they didn't bother testing that..

Are you talking about wsHttpBindings? I don't believe that java can consume a web service with anything but basicHttpBindings. But I may be wrong

I don't know what you mean by http bindings, I don't use http basic security.

I have thos code:

   ((StubExt) tmp).setConfigName("Standard WSSecurity Client");
            ((BindingProvider) tmp).getRequestContext().put(StubExt.PROPERTY_AUTH_TYPE, StubExt.PROPERTY_AUTH_TYPE_WSSE);
            ((BindingProvider) tmp).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "user");
            ((BindingProvider) tmp).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "pwd");

which should tell the jboss stack to send security headers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM