Incapable de sendViaPost url Read timed out

Je suis en train de travailler sur java web service clients d'aujourd'hui. Mais je suis confronté à un gros problème pour moi. Mon problème est que:
Je suis généré client de service web avec Eclipse par l'intermédiaire de son client de service web générateur. Il génère service web via Apache Axis2. Mon web service java code est généré et je l'utilise avec succès avec un wsdl qui n'est pas besoin en-tête de sécurité. Mais je ne peux pas l'utiliser avec un service web qui a besoin d'un en-tête de sécurité.

J'essaie d'obtenir ma demande avec fiddler2. mais fiddler pas capturer tous les paquets liés à ma demande. mais quand j'ai l'impression de mes créé la demande et de l'utilisation de ce xml avec soapui, de l'opération est de réaliser avec succès.

l'augmentation de paramètre de délai d'expiration de ne pas fonctionner.

que puis-je faire?

mon xml et java erreur est donnée ci-dessous:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
   <soapenv:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" mustUnderstand="1">
         <wsse:UsernameToken>
            <wsse:Username>username</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
      <wsse:ReplyTo xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:Address>http://www.w3.org/2005/08/addressing/anonymous</wsse:Address>
      </wsse:ReplyTo>
      <wsse:MessageID xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">urn:uuid:123</wsse:MessageID>
      <wsse:Action xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" mustUnderstand="1">http://www.saglik.gov.tr/KPS/2011/KPSServices/TcKimlikNoIleKisiSorgula</wsse:Action>
   </soapenv:Header>
   <soapenv:Body>
      <ns1:TcKimlikNoIleKisiSorgula xmlns:ns1="http://www.saglik.gov.tr/KPS/2011">
         <ns1:tcNo>155***58</ns1:tcNo>
      </ns1:TcKimlikNoIleKisiSorgula>
   </soapenv:Body>
</soapenv:Envelope>

et message d'erreur:

[INFO] Unable to sendViaPost to url[https://kps.saglik.gov.tr/services/kpsservices.svc]
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:150)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:442)
at sun.security.ssl.InputRecord.read(InputRecord.java:480)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:927)
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:884)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:102)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)
at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:621)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:404)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:231)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)
at org.apache.axis2.description.OutInAxisOperationClient$NonBlockingInvocationWorker.run(OutInAxisOperation.java:446)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

et mon code est ci-dessous

public static void main(String[] args){
ServiceStub stub = new ServiceStub();
ServiceClient client = stub._getServiceClient();
client.addHeader(createSecurityHeader("username", "password"));
OMNamespaceImpl wsseNS = new OMNamespaceImpl(WSConstants.WSSE_NS, WSConstants.WSSE_PREFIX);
OMFactory factory = new SOAP11Factory();
OMElementImpl replyToElement;
OMElementImpl addressElement;
OMElementImpl messageIDElement;       OMElementImpl actionElement;
replyToElement = new OMElementImpl("ReplyTo", wsseNS, factory);
addressElement = new OMElementImpl("Address", wsseNS, replyToElement, factory);
addressElement.setText("http://www.w3.org/2005/08/addressing/anonymous");
client.addHeader(replyToElement);
messageIDElement = new OMElementImpl("MessageID", wsseNS, factory);
messageIDElement.setText("urn:uuid:"+123);
client.addHeader(messageIDElement);
actionElement = new OMElementImpl("Action", wsseNS, factory);
actionElement.addAttribute("mustUnderstand", "1", null);
actionElement.setText("http://www.saglik.gov.tr/KPS/2011/KPSServices/TcKimlikNoIleKisiSorgula");
client.addHeader(actionElement);
Options options = client.getOptions();
options.setProperty(HTTPConstants.CHUNKED, "false");
options.setProperty(HTTPConstants.HTTP_PROTOCOL_VERSION, HTTPConstants.HEADER_PROTOCOL_11);
TcKimlikNoIleKisiSorgula kisi = new TcKimlikNoIleKisiSorgula();
kisi.setTcNo(155*****58L);//require an long
stub.starttcKimlikNoIleKisiSorgula(kisi, callback);
}
public static OMElement createSecurityHeader(String username, String password)
{
OMNamespaceImpl wsseNS = new OMNamespaceImpl(WSConstants.WSSE_NS, WSConstants.WSSE_PREFIX);
OMFactory factory = new SOAP11Factory();
OMElementImpl securityHeader;
OMElementImpl usernameTokenElement;
OMElementImpl usernameElement;
OMElementImpl passwordElement;
//create the Security header block
securityHeader = new OMElementImpl("Security", wsseNS, factory);
securityHeader.addAttribute("mustUnderstand", "1", null);
//nest the UsernameToken in the Security header
usernameTokenElement = new OMElementImpl(WSConstants.USERNAME_TOKEN_LN, wsseNS, securityHeader, factory);
//nest the Username and Password elements
usernameElement = new OMElementImpl(WSConstants.USERNAME_LN, wsseNS, usernameTokenElement, factory);
usernameElement.setText(username);
passwordElement = new OMElementImpl(WSConstants.PASSWORD_LN, wsseNS, usernameTokenElement, factory);
passwordElement.setText(password);
passwordElement.addAttribute(WSConstants.PASSWORD_TYPE_ATTR,
WSConstants.PASSWORD_TEXT, null);
return securityHeader;
}
Vous êtes l'obtention d'un socket de lecture erreur de délai. Êtes-vous sûr que vous pouvez accéder au service à partir de votre client?
J'en suis sûr. via soapui avec xml généré à partir de java, il fonctionne parfaitement. Mais java n'a pas pu obtenir de réponse de client.

OriginalL'auteur AlexiWilius | 2013-08-14