Hi,
We are attempting to make webservice calls using ssl (https) and getting the following error:
Caused by: org.apache.cxf.interceptor.Fault: Could not send Message.
org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:48)
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207)
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
... 67 more
Caused by: java.io.IOException: Illegal Protocol https for HTTP URLConnection Factory.
org.apache.cxf.transport.http.HttpURLConnectionFactoryImpl.createConnection(HttpURLConnectionFactoryImpl.java:44)
org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:474)
org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:46)
... 72 more
If we change to http everything works fine. We are using Clearspace 2.0.3 (custom). Do we need to do anything specific for https? All the Clearspace webservice documentation (for version 2.0.x) has examples using https (see link below)
Your prompt response appreciated.
Thank you,
Atul
Hi Atul,
What code are you using that throws this error? Are you using the client Jars or did you generate your own client?
-Todd
Hi Todd,
I am working with Atul on this problem. We have our own application that is calling Clearspace web services using the client jars provided with Clearspace. Specifically Jive built us a jar called jive-clearspace_community-webservices.jar, we are using that jar as well as its dependent jars. We are trying to follow the examples given at
Specifically our code looks something like this:
ServiceLocator locator = new ServiceLocator(getCollaborationURL(), COLLABORATION_LOGIN, COLLABORATION_PASSWORD);
UserService userService = locator.getUserService();
WSUser clearspaceUser = userService.getUser(getClearspaceUserId());
clearspaceUser.setEmail(getEmail());
clearspaceUser.setName(getFullName());
userService.updateUser(clearspaceUser);
getCollaborationURL() either returns https://ourserver/ or http://ourserver. This works fine with http and we get the exception with https.
Thanks,
Aaron
Does your server have HTTPS support enabled? I believe that if your application server does not have support for HTTPS enabled then webservices will not be able to authenticate and it will revert to HTTP. If you are running tomcat here are instructions to set this up:
http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html
Please let me know if that works for you. Thanks.
-Todd
Thanks for the suggestion, but the server is already configured to support HTTPS. I can log in (as an admin or standard user) and use the site over HTTPS without problems. It is only when connecting through webservice that we have a problem.
Hi,
Well I haven't been able to get this to work either so what I would suggest is building your own client jars instead of using the ones that come bundled with the application. In fact, we do not provide client jars any more and it is the responsibility of the developer to generate the code themselves. You can do this automatically with tools like WSDL 2 Java and you can find more information about this here:
http://www.jivesoftware.com/builds/docs/clearspace/latest/ClearspaceWebServicesDevGuide.html
Thanks.
-Todd
Hi Todd,
I am not sure I quite understand your response. Are you suggesting that I need to upgrade to 2.5, or that I should be able to generate the necessary client jars for 2.0.3 myself using WSDL 2 Java? I am a little surprised that you were also not able to get the webservice to work over SSL, as the documentation suggests that it should work and that it is actually the recommended and default behavior. I will attempt to build my own client jars and see how that goes, probably on Monday. Can you provide any more concrete examples of this than the link above? I am new to WSDL2Java tools, so any time you can save me with more specific instruction would be valuable.
Thanks,
Aaron
Hi Aaron,
I apogize for the late reply. Were you able to test out WSDL2Java at all this week? I am hoping to get more time to test out these webservices over SSL again. I was unable to get it to work initially after quite a lot of testing but I think there is a setting or piece of code that I am missing somewhere. I hope to hear back from you soon. Thanks Aaron.
-Todd
Hi Todd,
I did a bunch of experiments and finally did get things working. Building my own client jar did not work for me, as the client code generated did not match the signiture of the bundled client jar. Switching over would have required me to rewrite a large amount of my own application code.
I went back to using the bundled client jar and started playing with my invocations. The following code (simplified) was enough to get it working over SSL:
// webServiceURL looks like either "http://server/clearspace" or "https://server/clearspace"
ServiceLocator locator = new ServiceLocator(webServiceURL, login, password);
CommunityService service = locator.getCommunityService();
if (webServiceURL.toUpperCase().startsWith("HTTPS")) {
Client cxfClient = ClientProxy.getClient(service);
HTTPConduit http = (HTTPConduit)cxfClient.getConduit();
TLSClientParameters tlsParams = new TLSClientParameters();
tlsParams.setSecureSocketProtocol("SSL");
http.setTlsClientParameters(tlsParams);
}
I still do not know why I had to do this, given the documentation indicated that it should work out of the box. However, it all seems to be working just fine for me with this code.
-Aaron
Hi Aaron,
Thank you for your reply. I am not sure why this was not working out of the box as well. I will do some further investigation on my end to see if there is anything that we need to fix here. Thanks again.
-Todd
Jive combines the most powerful features of collaboration software, community software,
social networking software & social media monitoring into the leading SBS solution.
© Copyright 2000–2010 Jive Software. All rights reserved.
915 SW Stark St., Suite 400, Portland, OR 97205
Sales: 877-495-3700 | General: 503-295-3700
Privacy Policy | Sitemap | Jobs | Contact Us