Hi ,
Unable to get the response for the services which use wsHttpBinding.The services which use basicHttpBinding are working fine.
The content type for basicHttpbinding services is 'text/xml' but for wsHttpbinding services is 'application/soap+xml'.
@ptrthomas To help you with what exactly the service looks like and the issue is all about ,please go thru the link below
https://github.com/savonrb/savon/issues/391
Posted the issue on StackOverFlow.
here is the link
https://stackoverflow.com/questions/46951004/wshttpbinding-issue-with-karate-framework
@raveendaranugu in the meantime, do you think your team can try an experiment where you try to do a * method post instead of * soap action 'foo' - so you set the header correctly. the special XML element and attributes, you anyway need to do as part of the payload.
if you can do this and confirm that it works, send me the sample feature / log, it can help me make the fix correctly. do let me know.
Hurray 💯 👍
Thanks a lot @ptrthomas
This almost solved our query . Though we tried this earlier but we missed some combinations along with this.
First Attempt :
In first attempt,we tried modifying the feature file as per your suggestion. So we got the below error..
java.lang.IllegalArgumentException: MIME type may not contain reserved characters
java.lang.IllegalArgumentException: MIME type may not contain reserved characters at org.apache.http.util.Args.check(Args.java:36) at org.apache.http.entity.ContentType.create(ContentType.java:206) at org.apache.http.entity.ContentType.create(ContentType.java:218) at com.intuit.karate.http.apache.ApacheHttpClient.getEntity(ApacheHttpClient.java:287) at com.intuit.karate.http.apache.ApacheHttpClient.getEntity(ApacheHttpClient.java:82) at com.intuit.karate.http.HttpClient.getEntityInternal(HttpClient.java:108) at com.intuit.karate.http.HttpClient.buildRequestInternal(HttpClient.java:190) at com.intuit.karate.http.HttpClient.invoke(HttpClient.java:204) at com.intuit.karate.StepDefs.method(StepDefs.java:312) at ✽.When method
Second Attempt :
In the Second attempt, We tried modifying the content-type to application/soap+xml along with when method post
Still we got error as below
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/soap/fault</a:Action></s:Header><s:Body><s:Fault><s:Code><s:Value>s:Sender</s:Value><s:Subcode><s:Value>a:DestinationUnreachable</s:Value></s:Subcode></s:Code><s:Reason><s:Text xml:lang="en-US">The message with To '' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree.</s:Text></s:Reason></s:Fault></s:Body></s:Envelope>
So finally we added an extra line in the soap request which is soap header
<soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:Action>http://www.xyz.com/serviceurl</wsa:Action><wsa:To>http://yyyyy/xxxxxxxxxxxxxxxxx</wsa:To></soap:Header>
This works like a charm. Your StackoverFlow answer is perfect.
@raveendaranugu awesome ! thanks for the very detailed analysis, this is going to help a lot of other folks as well.
Most helpful comment
@raveendaranugu awesome ! thanks for the very detailed analysis, this is going to help a lot of other folks as well.