views:

465

answers:

1

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);
A: 

What is the response time from SoapUI ?

Have you run this through a monitor to see that it is sending to the right place ?

My CXF code looks like this :

      PService phsService = new PService(url, SERVICE_NAME);
      P p = phsService.getPHSPort();
      LOG.info("Calling Web Service : getHs");

      StringArray ar = p.getHs();

      for (String hn: ar.getItem()) {
         LOG.info("Calling : getHName : " + hn);
         Dto nDto = p. getHName (hn);

         // process the result   

      }

This service takes about 90secs to return and runs fine

LenW
The response time was almost instant. Good idea on the monitoring tool - I'll see what that tells me.
Lee Theobald