Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » WS-Security problem with eclipse ide
WS-Security problem with eclipse ide [message #1106368] Wed, 11 September 2013 02:33
Eclipse UserFriend
I am struggling with jbossws-cxf-4.2.0.Final ws-security implementation with eclipse ide.
This is my service endpoint interface and service class code.

===== IHelloWorld Interface
@WebService(targetNamespace="http:/www.aaa.com/jbossws/ws-extensions/wssecurity" )
@PolicySets({"WS-Addressing","WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt"})
public interface IHelloWorld {

@WebMethod
@WebResult
public String sayHello(@WebParam String name);

}

=====HelloWorld.java
@WebService(
portName = "HelloWorldServicePort",
serviceName = "HelloWorldService",
targetNamespace = "http:/www.aaa.com/jbossws/ws-extensions/wssecurity",
endpointInterface = "com.aaa.ws.IHelloWorld"
)
@EndpointConfig(configFile = "WEB-INF/jaxws-endpoint-config.xml", configName = "Custom WS-Security Endpoint") // this line DOES NOT WORK!!!
public class HelloWorld implements IHelloWorld {
@Override
public String sayHello(String name) {
// TODO Auto-generated method stub
return "Hello " + name;
}
}

====== jaxws-endpoint-config.xml
<endpoint-config>
<config-name>Custom WS-Security Endpoint</config-name>
<property>
<property-name>ws-security.signature.properties</property-name>
<property-value>META-INF/server.properties</property-value>
</property>
<property>
<property-name>ws-security.encryption.properties</property-name>
<property-value>META-INF/server.properties</property-value>
</property>
<property>
<property-name>ws-security.signature.username</property-name>
<property-value>client</property-value>
</property>
<property>
<property-name>ws-security.encryption.username</property-name>
<property-value>server</property-value>

====== client
public class WSSClient {

private final String serviceURL="http:/localhost:8080/WSSHelloWorld/HelloWorld";
private IHelloWorld proxy;

public WSSClient() throws IOException {
QName serviceName = new QName("http:/www.aaa.com/jbossws/ws-extensions/wssecurity", "HelloWorldService");
URL wsdlURL = new URL(serviceURL + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
proxy = (IHelloWorld)service.getPort(IHelloWorld.class);

((BindingProvider)proxy).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/client.properties"));
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/client.properties"));
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SIGNATURE_USERNAME, "client");
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENCRYPT_USERNAME, "server");

} // the constructor throws no exception.
public String callMethd(String name) {
return proxy.sayHello(name); // this method throws exception
I try to jbossws-cxf ws-security in eclipse ide.But there is no document or reference site.
Pls, check this issue, https:/community.jboss.org/thread/232031
Your advice will be appreciated! Thanks in advance

[Updated on: Wed, 11 September 2013 02:34] by Moderator

Report message to a moderator

Previous Topic:debugging question
Next Topic:What should soap url be to intercept soap message with eclipse tcp/ip monitor?
Goto Forum:
  


Current Time: Wed Apr 24 23:37:54 GMT 2024

Powered by FUDForum. Page generated in 0.02639 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top