我开发了一个用于文件上传的SOAP Web服务和客户端(我希望在我的数据库上编写的base64binary字符串)并且可以正常工作。我用Wso2 ESB和Rest Client编写了REST api接口,将我的SOAP服务与Wso2提供的JSON到XML转换一起使用,在大多数情况下我成功了。 当我尝试上传一个base64binary字符串时,会出现问题,该字符串是通过REST API接口从文件大于16385字节(较小的文件工作正常)获得的。 几秒钟之后,服务器重置连接(我认为Wso2,因为我的应用程序服务器没有收到请求)并且除了连接超时之外没有显示任何错误。 我使用Apache cxf2进行Web服务和客户端生成,使用Tomcat 8作为应用服务器,使用Wso2 ESB与Tomcat进行通信。
这是我在Rest Client中的套接字异常
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:196)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
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 org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:139)
at org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:155)
at org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:284)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:140)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:261)
at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:165)
at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:167)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:272)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:124)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:271)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at rest.RestClient.main(RestClient.java:190)
和Rest API接口有一些谴责:
<resource methods="POST"
protocol="https"
uri-template="/loadDoc?user={user}&pwd={pwd}">
<inSequence>
<header name="Action" value="loadDoc"/>
<payloadFactory media-type="xml">
<format>
<m0:loadDoc xmlns:m0="my service location">
<username xmlns="">$1</username><password xmlns="">$2</password>$3
</m0:loadDoc>
</format>
<args>
<arg evaluator="xml" expression="get-property('uri.var.user')"/>
<arg evaluator="xml" expression="get-property('uri.var.pwd')"/>
<arg evaluator="json" expression="$."/>
</args>
</payloadFactory>
<send>
<endpoint>
<address uri="my wsdl location uri"
format="soap12"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<property name="messageType" value="application/json" scope="axis2"/>
<send/>
</outSequence>
答案 0 :(得分:2)
WSO2 ESB具有数据通过的缓冲区的默认大小。 此默认值为16384字节。
转到WSO2_HOME / repository / conf / passthru-http.properties 并根据需要调整 io_buffer_size 属性。