Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » WS-Security problem with eclipse ide
WS-Security problem with eclipse ide [message #1105863] Tue, 10 September 2013 11:24 Go to next message
Joseph Hwang is currently offline Joseph HwangFriend
Messages: 9
Registered: September 2013
Junior Member
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
Re: WS-Security problem with eclipse ide [message #1105979 is a reply to message #1105863] Tue, 10 September 2013 14:21 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 9/10/2013 5:26 AM, Joseph Hwang wrote:
> I am struggling with jbossws-cxf-4.2.0.Final ws-security implementation
> with eclipse ide.
> [snip]
> 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

This would be more a topic to take up in the Eclipse web tools platform
forum.
Previous Topic:Issue with Plugin devlopment.
Next Topic:Problem with keybinding shift+8 (Kepler)
Goto Forum:
  


Current Time: Sun Feb 28 14:01:09 GMT 2021

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

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

Back to the top