문제

Apache CXF를 사용하여 HTTPS를 통해 웹 서비스에 액세스하는 데 사용하려는 다음 코드가 있습니다. 그러나 내 메시지가 나올 때마다 코드가 시간이 내릴 때까지 아무것도 되돌릴 수 없습니다. 누군가 내 코드를 한 번만 줄 수 있고 내가 잘못하고 있는지 알려줄 수 있습니까? 나는 soapui를 통해 서비스에 액세스하려고 노력했는데 괜찮습니다. 그래서 그것은 내 CXF 코드에 있어야하지만 무엇을 모릅니다!

도움을 주셔서 감사합니다

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);
도움이 되었습니까?

해결책

soapui의 응답 시간은 얼마입니까?

모니터를 통해 올바른 장소로 전송되고 있음을 알 수 있습니까?

내 CXF 코드는 다음과 같습니다.

      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   

      }

이 서비스는 약 90 초가 걸리고 반환하고 잘 실행됩니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top