wso2 ESB request is truncated - soap

i'm using fresh installation of wso2 esb 4.8.1 with stanalone default configuration.
when i send soap request to my backend (perl service with soap lite), the body of POST request is truncated like this according to tcpdump:
SOAPAction: ""
Content-Type: text/xml
Content-Length: 511
Host: 192.168.11.234:8181
Connection: Keep-Alive
User-Agent: Synapse-PT-HttpComponents-NIO
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="htt
p://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<deleteAccountForHost xmlns="AbcdeHostingPhysicalHostManagerCPanelService">
<host xsi:type="xsd:string">zs000.abcde.net</host>
<user xsi:type="xsd:string">tstauto</user>
</deleteAccountForHost>
</soap:Body>
</soap:Envel
You can see that closing tag '</soap:Envel' is truncated.
But when i enable SOAP-tracer the request body becomes valid.
i use PT transport. I tried to switch transport to the nhttp and this problem seems to be disappeared.
So the question is: how to configure PT transport to avoid such strange behavior?
UPD1:
it seems that the problem occurs only when set the property FORCE_HTTP_1.0 and transport is PT

I got the same problem, but I set DISABLE_CHUNKING.
After many tries I tested that disabling chunking or forcing HTTP 1.0 results in truncated request.
I use WSO2 ESB version 4.8.1, client is SoapUI 5.0.0 or SoapClient from PHP 5.5.11.
When I use "Try this service" in ESB, then request is not truncated.
After switching from HTTP PassThrough Transport to HTTP-NIO Transport service behind endpoint receives complete request, but then I can't download WSDL of tenant.

Related

Soap UI mock Missing operation for soapAction

I created SoapUI 5.7.0 mock with SSL and I am getting below exception. I set Require SOAP action to false in general mock properties, but I believe it only affects non - https mocks. HTTPs mock i created automatically when I mark SoapUI -> Preferences -> SSL Settings -> Enable SSL for mock services. But there seems not to be an option for marking Require SOAP action in SSL settins. Unfortunatelly I cannot change the Java code which is invoking this mock service.
Is there any way to make it working ?
javax.xml.ws.soap.SOAPFaultException: Response was of unexpected text/html ContentType. Incoming portion of HTML stream: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>Server</faultcode>
<faultstring>Missing operation for soapAction [http://xxxxx/v1/wsdl/aaa/bbb] and body element [{http://www.w3.org/2001/04/xmlenc#}EncryptedData] with SOAP Version [SOAP 1.1]</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

gSOAP: How to use SOAP instead of POST for specific service/schema

First off, let me apologize, because I don't know much about SOAP and most of what I'm saying is probably nonsense.
I upgraded some client-side code that was generated using gSoap 2.8.4 to gSoap 2.8.93
As far as I can tell, the program only sends one request to the server. Previously this request was wrapped in
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="bmf.gv.at:pkt/PKTSoap" xmlns:ns1="bmf.gv.at:pkt" xmlns:ns3="bmf.gv.at:pkt/PKTSoap12">
<SOAP-ENV:Body>
...
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
However with the code generated by the new version this envelope is missing. I understand that this is because the request is generated as a REST request instead of a SOAP one. I've found threads that talk about the //gsoap directive for the service setting the method-protocol to SOAP instead of POST, but I can only find these directives for requests to the sub-services /PKTSoap and /PKTSoap12, not to the root service bmf.gv.at:pkt, to which the request is sent. In fact that is not even called a service in the code, it's called a schema. And the requests to it are called top-level root elements of the schema. They are all automatically generated as REST requests.
My question is how can I instruct gSoap to generate all requests as SOAP1.1 requests? Any help whatsoever is greatly appreciated.
WSDL: https://pastebin.com/bmC8Hx6M
typemap.dat is the default one with the following appended:
ns1 = "bmf.gv.at:pkt"
ns2 = "bmf.gv.at:pkt/PKTSoap"
ns3 = "bmf.gv.at:pkt/PKTSoap12"
And I use the following commands to generate:
wsdl2h.exe -c -g -N ns %1.wsdl
soapcpp2.exe -c -C -I./import -1 %1.h
It is not clear from your question which request messages do not include the envelope.
Here is a quick way to test the generated source code, to verify that the SOAP1.1 envelope and body are included (I've used C++ here):
wsdl2h -L -g -N ns service.wsdl
soapcpp2 -1 -C -I import service.h
A small demo client, to test the request message:
#include "soapH.h"
#include "PKTSoap.nsmap"
int main()
{
struct soap *soap = soap_new1(SOAP_XML_INDENT);
_ns1__DatenpoolkontoErzeugen req;
_ns1__Verarbeitung res;
req.soap_default(soap);
soap_call___ns2__PKTDatenpoolkontoErzeugen(soap, "http://", NULL, &req, res);
}
Compiled with:
c++ -o service service.cpp soapC.cpp soapClient.cpp stdsoap2.cpp
Then run:
$ ./service
POST / HTTP/1.1
Host:
User-Agent: gSOAP/2.8
Content-Type: text/xml; charset=utf-8
Content-Length: 526
Connection: close
SOAPAction: "bmf.gv.at:pkt/PKTDatenpoolkontoErzeugen"
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="bmf.gv.at:pkt/PKTSoap" xmlns:ns1="bmf.gv.at:pkt" xmlns:ns3="bmf.gv.at:pkt/PKTSoap12">
<SOAP-ENV:Body>
<ns1:DatenpoolkontoErzeugen>
<ns1:Absender xsi:nil="true"/>
</ns1:DatenpoolkontoErzeugen>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
This shows that bmf.gv.at:pkt requests are sent exactly as specified in the WSDL.

JMeter changing my namespace

I'm trying to use JMeter to invoke a RPC/SOAP Web service and when I invoke the service my namespaces are mangled from the actual values to NS1.
<?xml version="1.0" encoding="UTF-8"?>
<wpc:invoke xmlns:wpc="http://wpc.ibm.com">
<wpc:envelope communicationVersion="5.3">
<wpc:WPCResponseType>asynchronous</wpc:WPCResponseType>
<wpc:wpcHeader>
<wpc:companyName>mycompany</wpc:companyName>
<wpc:wpsUserID>me</wpc:wpsUserID>
<wpc:wpcUserID>wpcUsername</wpc:wpcUserID>
<wpc:password />
<wpc:messageIdentifier>9E2FA100-BE54-11E5-8A91-BF48E24665E0</wpc:messageIdentifier>
<wpc:timestamp>2016-01-18</wpc:timestamp>
<wpc:supplierId><![CDATA[0Z188]]></wpc:supplierId>
<wpc:localeForDisplay>en_US</wpc:localeForDisplay>
<wpc:localeRestriction>en_US</wpc:localeRestriction>
</wpc:wpcHeader>
<wpc:wpcBody>
<wpc:wpcCommand mode="ASYNC" type="UPLOAD">
<wpc:wpcCatalogName>Item Transaction Catalog</wpc:wpcCatalogName>
<wpc:wpcFileDocStorePath>test_data/upload/0003_items.csv</wpc:wpcFileDocStorePath>
<wpc:wpcUpdateOnly>false</wpc:wpcUpdateOnly>
</wpc:wpcCommand>
</wpc:wpcBody>
</wpc:envelope>
</wpc:invoke>
Changes to:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:invoke xmlns:ns1="http://wpc.ibm.com">
<ns1:envelope communicationVersion="5.3">
<ns1:WPCResponseType>asynchronous</ns1:WPCResponseType>
<ns1:wpcHeader>
<ns1:companyName>mycompany</ns1:companyName>
<ns1:wpsUserID>me</ns1:wpsUserID>
<ns1:wpcUserID>wpcUsername</ns1:wpcUserID>
<ns1:password/>
<ns1:messageIdentifier>9E2FA100-BE54-11E5-8A91-BF48E24665E0</ns1:messageIdentifier>
<ns1:timestamp>2016-01-18</ns1:timestamp>
<ns1:supplierId><![CDATA[0Z188]]></ns1:supplierId>
<ns1:localeForDisplay>en_US</ns1:localeForDisplay>
<ns1:localeRestriction>en_US</ns1:localeRestriction>
</ns1:wpcHeader>
<ns1:wpcBody>
<ns1:wpcCommand mode="ASYNC" type="UPLOAD">
<ns1:wpcCatalogName>Item Transaction Catalog</ns1:wpcCatalogName>
<ns1:wpcFileDocStorePath>test_data/upload/0003_items.csv</ns1:wpcFileDocStorePath>
<ns1:wpcUpdateOnly>false</ns1:wpcUpdateOnly>
</ns1:wpcCommand>
</ns1:wpcBody>
</ns1:envelope>
</ns1:invoke>
There must be a setting in JMeter to keep the message from being transformed from my original meaningful namespace to this arbitrary namespace called NS1? When the message is received at the target endpoint it cannot parse the request because of this semantic error.
Any/all replies are appreciated!
MG
JMeter should not change anything in the request body, maybe it is an issues with your web service? Double check the request which is being sent by JMeter using a sniffer tool like Wireshark
In any case try switching to HTTP Request sampler, this is recommended way of sending web service requests (just don't forget to add HTTP Header Manager to send Content-Type and SOAPAction headers).
References:
JMeter User's Manual: Building a SOAP WebService Test Plan
Testing SOAP/REST Web Services Using JMeter

ServiceStack: Incorrect metadata for SOAP?

I followed the Create your first webservice tutorial. When I go to the Hello Service Soap11 metadata page, I see the following:
POST /xml/reply/Hello HTTP/1.1
Host: localhost
Content-Type: application/xml
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...
</soap:Envelope>
The line POST /xml/reply/Hello HTTP/1.1 seems incorrect. When I use the Postman Rest Client and post to /xml/reply/hello to test the SOAP endpoint. It doesn't work. The response is a 400 Bad Request with a message "Could not deserialize 'application/xml' request..."
Then I change the URL to make the request post to /soap11 instead, it works with status code 200 OK.
This problem happens for the Soap12 metadata page too.
Seems like something is not right with the metadata page generation?
By looking at the code, this does look like a bug.
I have fixed the problem and submitted a pull request to ServiceStack, pending for acceptance.
Pull request: https://github.com/ServiceStack/ServiceStack/pull/389
Update: Pull request has been merged into ServiceStack master branch. Problem solved!

Invoking external web methods with BPEL + Apache Ode (calling .Net asmx) problems

Pre-info:
I'm learning to use orchestration of web methods(WM). I've sucessfully completed lessons with assings, invoking web methods, some parallel processing in BPEL. I'm using Eclipse Indigo 3.7.1 with BPEL plugins, Tomcat7 server with Apache Ode as orchestration base. At other side I need to learn calling secured WMs written on Mono .Net platform.
Having now:
Now I'm having problem calling ANY web methods. I've made:
1) Web Method running by Mono .Net - works, can be tested with browser (http://localhost:8081/hwws.asmx ) and with Eclipse tool "Web Services Explorer", it works fine.
2) my BPEL that only invokes this .Net web method throught SOAP port.
3) at other work stantion I've made .Net service with Visual Studio. Having errors either, if need I'll post it text later.
Problem: I'm getting errors at invoking.
Screens:
1) browser test of .net WS HW(helloWorld) http :// photo -hosting.winsoftmagic .com/ 1/ s4nbwdsqib.jpg
2) Eclipse test of .net WS HW http://photo-hosting.winsoftmagic.com/1/zywnl2wtgu.jpg
3) Error I get http://photo-hosting.winsoftmagic.com/1/ltbexoxcdl.jpg
Error listing:
18:15:25,294 WARN ExternalService Fault response: faultType=(unkown)
soap:ClientCould not deserialize Soap message
18:15:25,376 ERROR INVOKE Failure during invoke:
18:15:25,382 INFO BpelRuntimeContextImpl ActivityRecovery: Registering activity 11, failure reason: on channel 21
And it's give timeout error later. I've spent a week around this problems already, searched with all ways I could think up.
EDIT 12.03.2012:
Now test with mono WS worked for some reason.
I've tryed call WS from the internet and it gave the same error as I had at work spot:
14:25:16,177 ERROR [INVOKE] Failure during invoke: Error sending message (mex={PartnerRoleMex#hqejbhcnphr747jefui9ic [PID {http://wsaspx.tns/}inetWS-24] calling org.apache.ode.bpel.epr.WSAEndpoint#1e3a4c7.checkText(...) Status ASYNC}): The input stream for an incoming message is null.
14:25:16,178 INFO [BpelRuntimeContextImpl] ActivityRecovery: Registering activity 11, failure reason: Error sending message (mex={PartnerRoleMex#hqejbhcnphr747jefui9ic [PID {http://wsaspx.tns/}inetWS-24] calling org.apache.ode.bpel.epr.WSAEndpoint#1e3a4c7.checkText(...) Status ASYNC}): The input stream for an incoming message is null. on channel 21
In same time this service works from all test forms.
Edit: 16.03.2012
My mono method stopped work same as it started without my understanding. TcpMon-1.1.jar shows such message again:
POST /hwws.asmx HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: "http://hwws.tps/HelloWorld"
User-Agent: Axis2
Host: localhost:8092
Transfer-Encoding: chunked <--- EDITED: REASON OF NOT WORKING ----
31c
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<addr:To xmlns:addr="http://www.w3.org/2005/08/addressing">http://localhost:8092/hwws.asmx</addr:To>
<addr:Action xmlns:addr="http://www.w3.org/2005/08/addressing">http://hwws.tps/HelloWorld</addr:Action>
<addr:ReplyTo xmlns:addr="http://www.w3.org/2005/08/addressing"><addr:Address>http://www.w3.org/2005/08/addressing/anonymous</addr:Address></addr:ReplyTo>
<addr:MessageID xmlns:addr="http://www.w3.org/2005/08/addressing">uuid:hqejbhcnphr74k7fapcntd</addr:MessageID>
</soapenv:Header>
<soapenv:Body><HelloWorld xmlns="http://hwws.tps/">
<s0:st xmlns:s0="http://hwws.tps/">My test message</s0:st>
</HelloWorld></soapenv:Body></soapenv:Envelope>
0
HTTP/1.0 500 Internal Server Error
Date: Fri, 16 Mar 2012 08:01:50 GMT
Server: Mono.WebServer2/0.4.0.0 Unix
Connection: close
X-AspNet-Version: 4.0.30319
Content-Length: 366
Cache-Control: private
Content-Type: text/xml; charset=utf-8
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body><soap:Fault><faultcode>soap:Client</faultcode>
<faultstring>Could not deserialize Soap message</faultstring>
</soap:Fault></soap:Body></soap:Envelope>
Actually I get one of 3 errors: couldn't deserialise, The input stream for an incoming message is null or even error 411 yesterday:) P.s. had 4th error with no socket connecting also, but all them vanished.
My main goal is ssl+authorisation .net services - would be gratefull if you have examples.
Thanks a lot to everyone! It's real pleasure to see your help:)
Thanks to all, testing soap-body shown that it was good and problem was in headers part which had some strange "Chunked" and numbers before xml (length of xml text) and 0 after xml end. I just set http.request.chunk=false and now it work at all my tests yet. For that purpose download sample.endpoint from http://ode.apache.org/endpoint-configuration.html , renamed it as bpel name (MonoCaller.bpel => MonoCaller.endpoint). It has string for chunked already commented. And also added something like http.default-headers.authorization=Basic <64b code of "login:password" made in any coder> for authorization purpose and it also works now! :-]
The same error has occured with me, the problem was with the web service itself, I had an empty constructor plus the methodes wich causes a problem, the solution is to delete the constructor.