Hi all,
I've got the following code that I am trying to use to access a webservice via HTTPS using Apache CXF. But whenever my message goes out, I get nothing back until my code times out. Can someone give my code a once over and let me know if I'm doing anything wrong. I've tried to access the service via SoapUI and that's fine, so it must be something in my CXF code but I just don't know what!
Thanks for any help
DepositImplService ss = new DepositImplService(WSDL_LOCATION,
SERVICE_NAME);
PortType port = ss.getPortTypePort();
Client client = ClientProxy.getClient(port);
HTTPConduit conduit = (HTTPConduit) client.getConduit();
HTTPClientPolicy httpClientPolicy = conduit.getClient();
httpClientPolicy.setConnectionTimeout(30000);
httpClientPolicy.setReceiveTimeout(30000);
conduit.setClient(httpClientPolicy);
AuthorizationPolicy authPolicy = new AuthorizationPolicy();
authPolicy.setUserName("foo");
authPolicy.setPassword("bar");
conduit.setAuthorization(authPolicy);
TLSClientParameters parameters = new TLSClientParameters();
parameters.setSecureSocketProtocol("SSL");
conduit.setTlsClientParameters(parameters);
client.getInInterceptors().add(new LoggingInInterceptor());
client.getOutInterceptors().add(new LoggingOutInterceptor());
UploadRequestT doc = new UploadRequestT();
BufferedReader reader = new BufferedReader(new FileReader(new File(
"C:\\rawmessage.txt")));
String documentStr = "";
String currLine = "";
while ((currLine = reader.readLine()) != null) {
documentStr += currLine;
}
doc.setDoc(documentStr);
doc.setOwner("43");
port.upload(doc);