[JBossWS] - SSL Client truststore
by zurchman
Is there any way to way to dynamically define a JBossWS client truststore?
I'm trying to run a standalone secure webservice client that was originally developed using a JAX-WS RI.
Using the RI, it was a simple matter to specify the truststore:
| System.setProperty("javax.net.ssl.trustStore", "path_to_my_store");
|
I've rebuilt the artifacts and application against the jbossesb-server-4.5.GA and do not seem to be able to get the client to connect to a secure endpoint.
http endpoints work fine.
Using JBossWS, I seem to get farther setting the "org.jboss.ws.wsse.trustStore" property.
The client was built from a WSDL file, and the endpoint is changed dynamically:
| BindingProvider bp = (BindingProvider) default_webservice;
| Map<String, Object> context = bp.getRequestContext();
| Object oldAddress = context.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
| System.out.println("new endpoint: " + endpoint);
|
The application fails parsing the Web service response, and I question if the request is actually connecting to service provider's SSL port.
| 2009-04-13 18:33:16,747 DEBUG [org.jboss.ws.core.EndpointInvocation] transformPayloadValue: com.autowares.ipotest.Quote -> com.autowares.ipotest.Quote
| 2009-04-13 18:33:16,785 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Create a handler executor: []
| 2009-04-13 18:33:16,785 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Create a handler executor: []
| 2009-04-13 18:33:16,785 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Create a handler executor: []
| 2009-04-13 18:33:16,836 DEBUG [org.jboss.ws.core.client.HTTPRemotingConnection] Get locator for: [addr=https://service-provider-url/service-name,etc
| name={javax.xml.ws.service.endpoint.address=https://service-provider-name/service}]
| 2009-04-13 18:33:16,933 DEBUG [org.jboss.remoting.security.SSLSocketBuilder] Could not find keystore url. Can not find store file for url because store url is null.
| 2009-04-13 18:33:16,965 DEBUG [org.jboss.remoting.MicroRemoteClientInvoker] org.jboss.remoting.transport.http.ssl.HTTPSClientInvoker@67f39 connecting
| 2009-04-13 18:33:16,965 DEBUG [org.jboss.remoting.MicroRemoteClientInvoker] org.jboss.remoting.transport.http.ssl.HTTPSClientInvoker@67f39 connected
| 2009-04-13 18:33:16,965 DEBUG [org.jboss.ws.core.client.HTTPRemotingConnection] Remoting metadata: {HEADER={SOAPAction="http://qname", Content-Type=text/xml; charset=UTF-8}, NoThrowOnError=true}
| 2009-04-13 18:33:16,977 DEBUG [org.jboss.ws.core.soap.SOAPContentElement]
| -----------------------------------
| 2009-04-13 18:33:16,977 DEBUG [org.jboss.ws.core.soap.SOAPContentElement] Transitioning from OBJECT_VALID to XML_VALID
| 2009-04-13 18:33:16,977 DEBUG [org.jboss.ws.core.soap.ObjectContent] getXMLFragment from Object [xmlType={http://qname},javaType=class ]
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4225495#4225495
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4225495
15 years, 8 months
[JBossWS] - WS Security - Identity propagation between web services.
by ravikb_jboss
Hi,
I have two WebServices with EJB Endpoints. (EJBWS1 and WJBWS2). Both are secure web services and the methods in those web services has restricted access by specifying the roles using &RolesAllowed annotation.
For example:
@RolesAllowed("Role1")
public String method1(){}
EJBWS1 is configured to receive the user credentials using WS-Security - User name token (using @EndpointConfig) and EJB2WS is configured to receive credentials using Basic authentication.
Both EJB's are in the same security Domain and also in the same JAR file.
I wrote a client to pass WS-Security credentials to EJBWS1 and it works. In EJBWS1, I called a method in EJBWS2 using EJB way (got a EJB object reference and invoke operation). Identity get propagated and the method call in EJBWS2 gets invoked.
But when i invoke the same using webservice way, i.e in EJBWS1 method, i get a webserviceref (static proxy) for EJJBWS2, get port and invoke operation, i am getting unauthorized error. Identity is not getting propagated from Webservice1 to web service 2
does identity propagation concept not exist in webservice invocations? or am i making any mistake here?
Appreciate your help.
I have included the code in the note:
Thanks in advance
Ravi.
NOTE:
My code for invoking webservice is as follows:
1) Invoking EJBWS 2:
@WebServiceRef
static TestBean1WSClient service3;
public void insert(Agent object) {
....
TestBean1Local tblocal = service3.getEndpointPort();
tblocal.insert(object);
}
2)
Created a WebService client using @WebServiceClient annotation:
@WebServiceClient(name = "TestBean1Service", targetNamespace = "http://service.ri.com/", wsdlLocation = "META-INF/wsdl/TestBean1Bean.wsdl")
public class TestBean1WSClient extends Service
{
private final static URL WSDL_LOCATION;
private final static QName TESTENDPOINTSERVICE = new QName("http://service.ri.com/", "TestBean1Service");
private final static QName TESTENDPOINTPORT = new QName("http://service.ri.com/", "TestBean1BeanPort");
static {
System.out.println("TestBean1WSClient static block");
URL url = null;
try {
URL baseUrl = com.hex.ffm.ri.service.TestBean1Local.class.getResource(".");
System.out.println(" baseURL "+baseUrl);
url = new URL("http://127.0.0.1:7000/Practice/TestBean1Bean?wsdl");
} catch (MalformedURLException e) {
e.printStackTrace();
}
WSDL_LOCATION = url;
}
public TestBean1WSClient(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public TestBean1WSClient() {
super(WSDL_LOCATION, TESTENDPOINTSERVICE);
}
@WebEndpoint(name = "TestBean1BeanPort")
public TestBean1Local getEndpointPort() {
return (TestBean1Local)super.getPort(TESTENDPOINTPORT, TestBean1Local.class);
}
}
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4225232#4225232
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4225232
15 years, 8 months
[JBossWS] - Caused by: org.jboss.remoting.CannotConnectException: Can no
by randhawag
We are running JBoss 4.3 EAP CP02, on Java 6u7 and running into a connectivity issue. Has anyone encountered this problem? We are using JAX WS 2.* libraries.
C:\wstest\wstest>java -Djava.endorsed.dirs="C:\servers\jboss-eap-4.3.0.GA_CP02\jboss-as\lib\endorsed
" -Dsun.lang.ClassLoader.allowArraySyntax=true com.owa.ws.client.WsTest
Exception in thread "main" java.rmi.RemoteException: Call invocation failed; nested exception is:
java.io.IOException: Could not transmit message
at org.jboss.ws.core.jaxrpc.client.CallImpl.invokeInternal(CallImpl.java:536)
at org.jboss.ws.core.jaxrpc.client.CallImpl.invoke(CallImpl.java:277)
at org.jboss.ws.core.jaxrpc.client.PortProxy.invoke(PortProxy.java:156)
at $Proxy0.sayHello(Unknown Source)
at com.owa.ws.client.WsTest.main(WsTest.java:33)
Caused by: java.io.IOException: Could not transmit message
at org.jboss.ws.core.client.RemotingConnectionImpl.invoke(RemotingConnectionImpl.java:210)
at org.jboss.ws.core.client.SOAPRemotingConnection.invoke(SOAPRemotingConnection.java:77)
at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:337)
at org.jboss.ws.core.jaxrpc.client.CallImpl.invokeInternal(CallImpl.java:517)
... 4 more
Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker. Connectio
n refused: connect.
at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoke
r.java:348)
at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:137)
at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
at org.jboss.remoting.Client.invoke(Client.java:1634)
at org.jboss.remoting.Client.invoke(Client.java:548)
at org.jboss.ws.core.client.RemotingConnectionImpl.invoke(RemotingConnectionImpl.java:189)
... 7 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.Socket.connect(Socket.java:519)
at sun.net.NetworkClient.doConnect(NetworkClient.java:152)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
at sun.net.www.http.HttpClient.(HttpClient.java:233)
at sun.net.www.http.HttpClient.New(HttpClient.java:306)
at sun.net.www.http.HttpClient.New(HttpClient.java:323)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:788)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:729)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:654)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:832)
at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoke
r.java:277)
... 12 more
C:\wstest\wstest>echo "Test completed"
"Test completed"
C:\wstest\wstest>
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4225204#4225204
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4225204
15 years, 8 months