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

janitheshan picture janitheshan · Jun 29, 2011 · Viewed 10.9k times · Source

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”;

Answer

Ladislav Mrnka picture Ladislav Mrnka · Jun 29, 2011

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.