The input stream for an incoming message is null 和SAXParseException; lineNumber 1: 文件提前结束

今天在做·webservice服务调用时,请求经过网关转发之后,无返回数据,报异常,记录一下解决办法

异常

org.apache.axis2.AxisFault: The input stream for an incoming message is null.
 at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:92)
 at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:67)
 at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:354)
 at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
 at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
 at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)

异常

org.apache.axis2.AxisFault: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; 文件提前结束。
	at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:508)
	at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:368)
	at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:414)
	at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
	at org.apache.axis2.client.OperationClient.execute(OperationClient.java:150)
	at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:533)
	at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:509)

解决方法

            ServiceClient sender = new ServiceClient();
            sender.setOptions(options);
            sender.getOptions().setProperty(HTTPConstants.CHUNKED,"false");

分析

设置Client不使用Chunked Encoding。
原因是.NET Development Server可能不支持HTTP 1.1的Chunked Encoding。因此,将这个开关置为FALSE。

参考

异常处理方法:The input stream for an incoming message is null.

你可能感兴趣的:(The input stream for an incoming message is null 和SAXParseException; lineNumber 1: 文件提前结束)