Note that there are some explanatory texts on larger screens.

plurals
  1. POSoapFault - faultcode: 'S:Client' faultstring: 'Cannot find dispatch method in Android calling JAX-WS
    primarykey
    data
    text
    <p>I am trying to call a java webservice deployed in my localhost in glassfish server from Android using KSoap2 API.I am getting the following exception in logcat:</p> <p><strong>04-22 02:24:53.251: W/System.err(251): SoapFault - faultcode: 'S:Client' faultstring: 'Cannot find dispatch method for {http://abc/}ResponseFromDB' faultactor: 'null' detail: null</strong> Please help. i am using the following code :</p> <pre><code>public class TestLocalWebserviceActivity extends Activity { /** Called when the activity is first created. */ private static final String SOAP_ACTION = "http://abc/ResponseFromDB"; private static final String OPERATION_NAME = "ResponseFromDB"; private static final String WSDL_TARGET_NAMESPACE = "http://abc/"; private static final String SOAP_ADDRESS = "http://116.202.210.193:8086/CalculatorWS/ResponseFromDB?wsdl"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); class fetchprojectdetails extends AsyncTask&lt;String, Void, String&gt; { ProgressDialog dialog; String SOAPresponse; @Override protected void onPreExecute() { // progress.show(); dialog = ProgressDialog.show(TestLocalWebserviceActivity.this, "", "Retrieving Data....", true); // progressDialog.setCancelable(true); dialog.show(); dialog.setCancelable(true); } @Override protected String doInBackground(String... params) { // setContentView(textView); SoapObject result; SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE, OPERATION_NAME); PropertyInfo propInfo=new PropertyInfo(); propInfo.name="name"; propInfo.type=PropertyInfo.STRING_CLASS; request.addProperty("name", "John Smith"); //request.addProperty("name", "ggg"); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); //envelope.dotNet = true; //envelope.encodingStyle = SoapSerializationEnvelope.XSD; envelope.setOutputSoapObject(request); HttpTransportSE httpTransport = new HttpTransportSE( SOAP_ADDRESS); try { httpTransport.call(SOAP_ACTION, envelope); } catch (IOException e1) { Log.d("io", ""+e1.getMessage()); // TODO Auto-generated catch block e1.printStackTrace(); } catch (XmlPullParserException e1) { // TODO Auto-generated catch block Log.d("xmlpullparser", ""+e1.getMessage()); e1.printStackTrace(); } try { SoapPrimitive resultsRequestSOAP = (SoapPrimitive) envelope.getResponse(); } catch (SoapFault e) { // TODO Auto-generated catch block e.printStackTrace(); Log.d("ee", ""+e.getMessage()); } //httpTransport.debug = true; try { //List&lt;HeaderProperty&gt; headerList = new ArrayList&lt;HeaderProperty&gt;(); // headerList.add(new HeaderProperty("Authorization", "Basic "+ org.kobjects.base64.Base64.encode(raw))); // httpTransport.call(SOAP_ACTION, envelope, headerList); //String gr = httpTransport.requestDump; // Object response = envelope.getResponse(); //SOAPresponse = httpTransport.responseDump; String resultsString = (String) envelope.getResponse(); String gg = resultsString; // i = obj.execute(LearningScore.this); // i.putExtra("LearningCredit", LearningCredit); // startActivity(i); } catch (Exception exception) { System.out.print(exception.getLocalizedMessage()); Log.d("eeeeee",""+exception.getLocalizedMessage()+exception.getMessage()); // Toast.makeText(LearningScore.this,"Successfully Authenticated", // Toast.LENGTH_LONG).show(); } return SOAPresponse; } @Override protected void onPostExecute(String result) { String gg = result; Log.d("message: ", result+""); //Intent i = new Intent(ViewPHSActivity.this, ViewProjects.class); //projectxml = result; // .putExtra("response", result); //startActivity(i); dialog.dismiss(); finish(); } } new fetchprojectdetails().execute(); } } </code></pre> <p>WSDL:</p> <pre><code> &lt;?xml version="1.0" encoding="UTF-8" ?&gt; - &lt;!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Metro/2.1.1-b09 (branches/2.1-6834; 2011-07-16T17:14:48+0000) JAXWS-RI/2.2.5-promoted-b04 JAXWS/2.2. --&gt; - &lt;!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Metro/2.1.1-b09 (branches/2.1-6834; 2011-07-16T17:14:48+0000) JAXWS-RI/2.2.5-promoted-b04 JAXWS/2.2. --&gt; - &lt;definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://abc/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://abc/" name="ResponseFromDB"&gt; - &lt;types&gt; - &lt;xsd:schema&gt; &lt;xsd:import namespace="http://responseFromDb/" schemaLocation="http://localhost:8086/CalculatorWS/ResponseFromDB?xsd=1" /&gt; &lt;/xsd:schema&gt; - &lt;xsd:schema&gt; &lt;xsd:import namespace="http://abc/" schemaLocation="http://localhost:8086/CalculatorWS/ResponseFromDB?xsd=2" /&gt; &lt;/xsd:schema&gt; &lt;/types&gt; - &lt;message name="hello"&gt; &lt;part name="parameters" element="tns:hello" /&gt; &lt;/message&gt; - &lt;message name="helloResponse"&gt; &lt;part name="parameters" element="tns:helloResponse" /&gt; &lt;/message&gt; - &lt;portType name="ResponseFromDB"&gt; - &lt;operation name="hello"&gt; &lt;input wsam:Action="http://abc/ResponseFromDB/helloRequest" message="tns:hello" /&gt; &lt;output wsam:Action="http://abc/ResponseFromDB/helloResponse" message="tns:helloResponse" /&gt; &lt;/operation&gt; &lt;/portType&gt; - &lt;binding name="ResponseFromDBPortBinding" type="tns:ResponseFromDB"&gt; &lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /&gt; - &lt;operation name="hello"&gt; &lt;soap:operation soapAction="" /&gt; - &lt;input&gt; &lt;soap:body use="literal" /&gt; &lt;/input&gt; - &lt;output&gt; &lt;soap:body use="literal" /&gt; &lt;/output&gt; &lt;/operation&gt; &lt;/binding&gt; - &lt;service name="ResponseFromDB"&gt; - &lt;port name="ResponseFromDBPort" binding="tns:ResponseFromDBPortBinding"&gt; &lt;soap:address location="http://localhost:8086/CalculatorWS/ResponseFromDB" /&gt; &lt;/port&gt; &lt;/service&gt; &lt;/definitions&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload