2012-02-03 150 views
3

我試圖通過存根調用web服務。 這是wsdl網絡服務Web服務調用超時問題

但我在調用它時遇到以下錯誤。

 
AxisFault 
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException 
faultSubcode: 
faultString: java.net.SocketTimeoutException: Read timed out 
faultActor: 
faultNode: 
faultDetail: 
    {http://xml.apache.org/axis/}stackTrace:java.net.SocketTimeoutException: Read timed out 
    at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222) 
    at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129) 
    at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087) 
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633) 
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719) 
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685) 
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368) 
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834) 
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) 
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148) 
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242) 
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:375) 
    at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) 
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) 
    at org.apache.axis.Message.getSOAPEnvelope(Message.java:435) 
    at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62) 
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206) 
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784) 
    at org.apache.axis.client.Call.invoke(Call.java:2767) 
    at org.apache.axis.client.Call.invoke(Call.java:2443) 
    at org.apache.axis.client.Call.invoke(Call.java:2366) 
    at org.apache.axis.client.Call.invoke(Call.java:1812) 
    at com.vtech.external.implementation.qantas.QantasServices.DistributorPortSoapBindingStub.getAccommodationAvailability(DistributorPortSoapBindingStub.java:1675) 
    at com.vtech.external.implementation.tripAdvisor.bizaction.Test.main(Test.java:68) 

    {http://xml.apache.org/axis/}hostname:vibpj160 
+1

服務是否真的可用,如果是,它是否接受您的請求?服務面前是否有一些網關阻止了您的電話到達Web服務? – Gaurav 2012-02-03 12:46:04

+1

是Web服務可用... – 2012-02-03 12:46:52

+1

如果我嘗試通過xml請求調用相同的服務它給了我期望的迴應。 – 2012-02-03 12:47:40

回答

2

由於

at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) 

說明你的請求沒有得到您的網絡服務提供商側反序列化。

只需檢查請求協議類型。

1

您的Web服務調用時出現隨時間了,你必須增加超時與下面的代碼:

((Stub) [your-port or service]).setTimeout(timeout); 

這個代碼設定的時間出去Web服務調用。