2016-03-04 47 views
2

我開發了一個用於文件上傳的SOAP Web服務和客戶端(一個base64binary字符串,我想寫在我的數據庫上)並且一直運行正常。我使用Wso2 ESB和Rest Client編寫了REST api接口,以便使用我的SOAP服務以及由Wso2提供的JSON到XML的轉換,並且在大多數情況下我都成功了。 當我嘗試上傳一個base64binary字符串時,會發生問題,通過REST API接口從一個比16385字節(小文件工作正常)的文件獲得的字符串。 幾秒鐘後,連接被服務器重新設置(Wso2我認爲,因爲我的應用程序服務器沒有得到請求)並且沒有顯示連接超時之外的錯誤。 我使用Apache cxf2進行Web服務和客戶端生成,使用Tomcat 8作爲apllication服務器,使用Wso2 ESB與Tomcat進行通信。Wso2文件上傳。連接重置

這裏是REST客戶端,我的Socket異常

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}&amp;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> 

回答

2

WSO2 ESB具有緩衝的默認大小通過數據通過。 此默認值是16384字節。

轉到WSO2_HOME /庫/ conf目錄/ passthru-http.properties,並根據需要調整io_buffer_size財產。

+0

它的工作原理!感謝幫助 –

相關問題