Sending a SOAP request to a published service on WSO2 API (1.6.0), in this case a 5 MB XML text, the server does not respond correctly. We expect a normal SOAP response. If we send the request directly to the backend server, the message is processed succesfully. What could be wrong.
The log files of WSO2 AM, wso2carbon.log, shows the following message:
TID: [0] [AM] [2014-05-05 16:01:35,007] WARN {org.apache.synapse.transport.passthru.SourceHandler} - Illegal incoming connection state: REQUEST_DONE . Possibly two send backs are happening for the same request {org.apache.synapse.transport.passthru.SourceHandler}
TID: [0] [AM] [2014-05-05 16:01:35,012] WARN {org.apache.synapse.transport.passthru.SourceHandler} - Trying to write response body while the handler is in an inconsistent state REQUEST_DONE {org.apache.synapse.transport.passthru.SourceHandler}
TID: [0] [AM] [2014-05-05 16:01:35,013] ERROR {org.apache.synapse.transport.passthru.SourceHandler} - Unexpected I/O error: java.nio.channels.ClosedChannelException {org.apache.synapse.transport.passthru.SourceHandler}
java.nio.channels.ClosedChannelException
at sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:265)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:474)
at org.apache.http.nio.reactor.ssl.SSLIOSession.sendEncryptedData(SSLIOSession.java:339)
at org.apache.http.nio.reactor.ssl.SSLIOSession.outboundTransport(SSLIOSession.java:419)
at org.apache.http.impl.nio.reactor.AbstractIODispatch.outputReady(AbstractIODispatch.java:150)
at org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:181)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:346)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:320)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:280)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:604)
at java.lang.Thread.run(Thread.java:744)
TID: [0] [AM] [2014-05-05 16:01:35,040] WARN {org.apache.synapse.transport.passthru.SourceHandler} - Illegal incoming connection state: REQUEST_DONE . Possibly two send backs are happening for the same request {org.apache.synapse.transport.passthru.SourceHandler}
TID: [0] [AM] [2014-05-05 16:01:35,042] WARN {org.apache.synapse.transport.passthru.SourceHandler} - Trying to write response body while the handler is in an inconsistent state REQUEST_DONE {org.apache.synapse.transport.passthru.SourceHandler}
TID: [0] [AM] [2014-05-05 16:01:35,042] ERROR {org.apache.synapse.transport.passthru.SourceHandler} - Unexpected I/O error: java.nio.channels.ClosedChannelException {org.apache.synapse.transport.passthru.SourceHandler}
The request is as follows:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/> <soapenv:Body>
<leesAanvraag>
<aanvraagNummer>123</aanvraagNummer>
</leesAanvraag> ... repeat until size of message is 5M
<leesAanvraag>
<aanvraagNummer>123</aanvraagNummer>
</leesAanvraag>
<leesAanvraag>
<aanvraagNummer>123</aanvraagNummer>
</leesAanvraag>
</soapenv:Body> </soapenv:Envelope>
Update: I tried a payload with 32KB, after several times sending this payload, the error occurs and WSO2 API manager does not give a correct response.
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode
xmlns:axis2ns1="http://schemas.xmlsoap.org/soap/envelope/">axis2ns1:Server</faultcode><faultstring>Error
in
Sender</faultstring></soapenv:Fault></soapenv:Body></soapenv:Envelope>
Could it be related to this issue or this?
Please ingress the timeout value in /repository/conf/passthru-http.properties
http.socket.timeout=120000 (default value is 60000, 120000 is the value we use for load test)
Related
I am using web service consumer(1.6.9) in Mule4 and triggering the external soap service, the external service is returning SOAP FAULT and below is the SOAP fault which I am getting as below
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<soapenv:Body>
<soapenv:Fault>
<faultcode>Internal Server Error</faultcode>
<faultstring>Unexpected close tag
</urn:UniqueName>; expected
</urn:UniqueNam>
at [row,col {unknown-source}]: [40,54]
</faultstring>
<Detail>Invalid incoming request /Buyer/soap/C133/X-T/testPull?null</Detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
but Web service consumer in mule is returning the below error:
Caused by: com.ctc.wstx.exc.WstxParsingException: Received non-all-whitespace CHARACTERS or CDATA event in nextTag()
Please let me know what is the issue, it seems web service consumer is throwing the above error while parsing the above soap fault.
It seems to be complaining that the SOAP fault response is not valid XML because of this line:
</urn:UniqueNam>
at [row,col {unknown-source}]: [40,54]...
</faultstring>
Note how the text is between </urn:UniqueNam> and </faultstring>. That's not valid in XML. There should be an XML tag or nothing there instead of plain text.
I have used IBM MobileFirst Studio V7.1 - Service Discovery wizard option and created a SOAP adapter from a application WSDL file. The Service Discovery procedure correctly creates the MobileFirst adapter in the MFP Studio.
The sample message payload is as follows.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fet="http://siebel.com/asi/Fetch Account Info">
<soapenv:Body>
<fet:ExecuteFetchAccountInfo_Input>
<fet:Object_spcId>1-6U8KAR</fet:Object_spcId>
</fet:ExecuteFetchAccountInfo_Input>
</soapenv:Body>
</soapenv:Envelope>
Now, using the adapter testing option in the MobileFirst Studio, the following JSON payload are being passed in the dialog window
params:
{"ExecuteFetchAccountInfo_Input":{"Object_spcId":"1-6U8KAR"}}
But I get the following error when I call the adapter
{
"errors": [
"Runtime: Failed to read the HTTP response to: \/eai_enu\/start.swe?SWEExtSource=WebService&SWEExtCmd=Execute \njava.io.EOFException: Unexpected end of ZLIB input stream"
],
"info": [
],
"isSuccessful": false,
"warnings": [
]
}
Also when I tried to check the log files. I was able to capture the request and response.
Request:
[2/16/16 11:27:10:997 IST] 000001ce com.worklight.integration.model.ProcedureInvoker I FWLSE0318I: request:
/eai_enu/start.swe?SWEExtSource=WebService&SWEExtCmd=Execute
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<tns:ExecuteFetchAccountInfo_Input xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://siebel.com/asi/Fetch Account Info" xmlns:xsdLocal1="http://www.siebel.com/xml/Account%20IO" >
<tns:Object_spcId>1-6U8KAR</tns:Object_spcId>
</tns:ExecuteFetchAccountInfo_Input>
</soap:Body>
</soap:Envelope>
Response:
response:
OK
Date=Tue, 16 Feb 2016 05:34:35 GMT
Server=Microsoft-IIS/6.0
X-Powered-By=ASP.NET
_charset=UTF-8
cache-control=no-cache, must-revalidate, max-age=0
pragma=no-cache
transfer-encoding=Chunked
content-type=text/xml;charset=UTF-8
[project IBMBankProject]
[2/16/16 11:27:11:000 IST] 000001ce om.worklight.integration.services.impl.DataAccessServiceImpl E FWLSE0099E: An error occurred while invoking procedure [project IBMBankProject]SoapAdapter1/HttpRequestFWLSE0100E: parameters: [project IBMBankProject]
Failed to read the HTTP response to: /eai_enu/start.swe?SWEExtSource=WebService&SWEExtCmd=Execute
java.io.EOFException: Unexpected end of ZLIB input stream
FWLSE0101E: Caused by: [project IBMBankProject]java.lang.RuntimeException: java.io.EOFException: Unexpected end of ZLIB input streamjava.lang.RuntimeException: Failed to read the HTTP response to: /eai_enu/start.swe?SWEExtSource=WebService&SWEExtCmd=Execute
java.io.EOFException: Unexpected end of ZLIB input stream
By looking at the response it says the response if Ok but it is unable to read it. Please help if I need to set-up something extra to read the response.
It turns out that there was a defect here that needed to be fixed. The APAR number is PI67417 and it can be downloaded from Fix Central.
Once you've applied the iFix, you'll also need to add "Accept-Encoding: identity" to your adapter call. That should resolve your issue. If it doesn't please let me know.
Since this is working in SOAP UI but fails in the adapter, it may indicate a product defect. Please open an IBM PMR and provide your files for reproduction by the development team.
I'm trying to do various REST requests to a piece of equipment using the Requests package.
It is working, but on some requests, like PUTs, I'm getting a SSLError, instead of a timeout that I'm specifying.
I have the code set up to retry, up to 5 times, doubling the timeout each time (1,2,4,8, 16, 32), and if I treat the SSLError as a timeout, then it will eventually pass. Here's an example, and you can see the SSLError is occurring at the pace of the timeout interval:
2013-12-10 19:41:13.208 22294 DEBUG client [-] PUT: Request for https://192.168.200.20/api/v1/global/host-name headers {'content-type': 'application/json', 'Accept': 'application/json', 'X-auth-token': u'...omitted...'} payload {'host-name': 'TestHost'}
2013-12-10 19:41:13.209 22294 INFO requests.packages.urllib3.connectionpool [-] Starting new HTTPS connection (1): 192.168.200.20
2013-12-10 19:41:14.253 22294 ERROR client [-] EXCEPTION The read operation timed out <<< SSL Error
2013-12-10 19:41:14.255 22294 INFO requests.packages.urllib3.connectionpool [-] Starting new HTTPS connection (1): 192.168.200.20
2013-12-10 19:41:16.301 22294 ERROR client [-] EXCEPTION The read operation timed out
2013-12-10 19:41:16.302 22294 INFO requests.packages.urllib3.connectionpool [-] Starting new HTTPS connection (1): 192.168.200.20
2013-12-10 19:41:20.346 22294 ERROR client [-] EXCEPTION The read operation timed out
2013-12-10 19:41:20.348 22294 INFO requests.packages.urllib3.connectionpool [-] Starting new HTTPS connection (1): 192.168.200.20
2013-12-10 19:41:25.845 22294 DEBUG requests.packages.urllib3.connectionpool [-] "PUT /api/v1/global/host-name HTTP/1.1" 204 0 _make_request /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py:289
2013-12-10 19:41:25.846 22294 DEBUG client [-] PUT: Completed [204]
As you can see the EXCEPTION log messages are the SSLError errors, but they are timeouts as they map to the timeout I specify.
In python, I'm doing this for the calls (it's spread out so here is the gist of it):
url = ('https://%(host)s/api/v1/%(resource)s' %
{'host': self.host, 'resource': resource})
...
response = self._request(method, url, try_num, timeout=timeout,
headers=headers, data=payload)
...
def _request(self, method, url, attempt, **kwargs):
...
try:
response = requests.request(method, url, verify=False, **kwargs)
except Timeout:
self.status = wexc.HTTPRequestTimeout.code
LOG.debug(_("%(method)s: Request timeout" ...)
except SSLError as se:
LOG.error("EXCEPTION %s", se)
self.status = wexc.HTTPRequestTimeout.code
If I don't handle the SSL error, then it gets caught as a ConnectionError. Any idea what I may be doing wrong?
I have this hack in place, but would like to know why I get the SSL error.
Thanks Lukasa! You're question prompted me to investigate the version. I installed requests 2.1.0 and now I see Timeout exceptions, instead of SSLError exceptions, which is what I expected to see.
I have created an API in wso2 ESB as:
<api xmlns="http://ws.apache.org/ns/synapse" name="getUUIDAPI" context="/getUUID">
<resource methods="GET" uri-template="?Name={searchValue}" inSequence="getUUIDIN" outSequence="CommonJsonOut"/>
</api>
and it gives me an API Invocation URL as http://10.224.64.97:8280/getUUID. Now when i try this rest service in my browser as :
http://10.224.64.97:8280/getUUID?Name=uvu
, In the esb i get error as :
TID: [0] [ESB] [2013-06-26 10:25:50,796] ERROR {org.apache.axis2.description.ClientUtils} - The system cannot infer the transport information from the
/getUUID?Name=uvu?Name=uvu URL. {org.apache.axis2.description.ClientUtils}
TID: [0] [ESB] [2013-06-26 10:25:50,796] ERROR {org.apache.synapse.core.axis2.Axis2Sender} - Unexpected error during sending message out {org.apache.synapse.core.axis2.Axis2Sender}
org.apache.axis2.AxisFault: The system cannot infer the transport information from the /getUUID?Name=uvu?Name=uvu URL.
at org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:81)
at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl(DynamicAxisOperation.java:115)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:456)
at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:57)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:316)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:329)
at org.apache.synapse.endpoints.WSDLEndpoint.send(WSDLEndpoint.java:69)
at org.apache.synapse.endpoints.IndirectEndpoint.send(IndirectEndpoint.java:54)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:95)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
at org.apache.synapse.rest.Resource.process(Resource.java:306)
at org.apache.synapse.rest.API.process(API.java:308)
at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:76)
at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:63)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:182)
at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:83)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:367)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:204)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
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:722)
As you can see in the above error the url it is hitting is /getUUID?Name=uvu?Name=uvu but i am sending /getUUID?Name=uvu.
Why i am getting this strange error? If i copy the api file, sequences associated with api to other server's esb and then i hit with above url i get the response.
Please help me on this. Thanks in advance
define something like this;
uri-template="/{searchValue}"
I have this message
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>LOGIN-ERR:Incorrect password - user could not be logged in.</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Schema validated fine, but the SOAP UI tool, when click on "Check WS-I Compliance", it gives a failed status with BP1305 assertion fail. I can't find what 1305 is and this is the detailed message
Result
failed
Failure Detail Message
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Date: Thu, 22 Jul 2010 20:41:43 GMT
Set-Cookie: JSESSIONID=C9D19FE6AAD89DFCB6BA9FE196E08D40; Path=/
Content-Type: text/xml;charset=utf-8
Server: Apache-Coyote/1.1
Element Location:
lineNumber=26
The problem seems to be that you are returning a SOAP Fault message, but with a HTTP status code of 200, SOAP Faults are required to be sent with a HTTP status code of 500.
You are missing the detail element in your fault message. It is a required element if the wsdl fault is produced as a results of the contents of the body element in the request
The message should be like this (detail element should contain application specific info. But it is acceptable to be empty. Not acceptable to be missing):
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>LOGIN-ERR:Incorrect password - user could not be logged in.</faultstring>
<detail></detail>
</soapenv:Fault>