janitheshan
janitheshan

Reputation: 325

Android with WCF web service using ksoap2 - error SoapFault – faultcode: ‘a:ActionNotSupported’

I have done a simple project to call wcf web service using ksoap2. But when it calls envelope.getResponse(); it gives error saying ————–

“SoapFault – faultcode: ‘a:ActionNotSupported’ faultstring: ‘The message with Action ‘GetString’ cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).’ faultactor: ‘null’ detail: null”

I’m running web service in localhost.

please help me some one

is this values correct that I have assigned,

private static final String SOAP_ACTION = “GetString”;
private static final String OPERATION_NAME = “GetString”;
private static final String WSDL_TARGET_NAMESPACE = “http://tempuri.org/”;
private static final String SOAP_ADDRESS = “http://10.0.2.2:14089/Service1.svc?wsdl”;

Upvotes: 6

Views: 11124

Answers (2)

K. Gol
K. Gol

Reputation: 1616

You can also check the actionName using SoapUI. First generate example request by providing wsdl address and then find your request. When you find it, select the "Raw" tab on the left side of window with request. You can find there http headers. One of the header position is "SOAPAction". It is the name which we are looking for.

Upvotes: 2

Ladislav Mrnka
Ladislav Mrnka

Reputation: 364269

We don't know if these values are correct - WSDL should tell you what is correct SOAP action for calling the GetString operation.

Open WSDL in web browser (that is the address you are assigning in SOAP_ADDRESS) and find something like:

<wsdl:binding name="..." type="...">
  ...
  <wsdl:operation name="GetString">
     <soap:operation soapAction="HERE_IS_CORRECT_ACTION" />
     <wsdl:input>...</wsdl:input>
     <wsdl:output>...</wsdl:output>
  </wsdl>
  ...
</wsdl:binding>

Btw. when you call the service you should use URL without ?wsdl query string.

Upvotes: 12

Related Questions