Note that there are some explanatory texts on larger screens.

plurals
  1. PORuntime Error When getResponse using Android KSOAP
    primarykey
    data
    text
    <p>My Android get a runtime error in SoapObject result = (SoapObject) envelope.getResponse(); The webservice is in my notebook (192.168.15.13), the notebook and the Android connected via LAN. I created the web service using Axis2 in Knopflerfish OSGi. Here is my code:</p> <pre><code>package test.msani.aksessoap; import java.io.IOException; import org.ksoap2.SoapEnvelope; import org.ksoap2.SoapFault; import org.ksoap2.serialization.PropertyInfo; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.HttpTransportSE; import org.xmlpull.v1.XmlPullParserException; import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.widget.TextView; public class TesAksesSOAP extends Activity { private static final String SOAP_ACTION = "SOAPObjectSani.SOAPObjectSani/SOAPObjectSani/getKeterangan"; private static final String METHOD_NAME = "getKeterangan"; private static final String NAMESPACE = "SOAPObjectSani.SOAPObjectSani/SOAPObjectSani"; private static final String URL = "http://192.168.15.13:8080/axis2/services/SOAPObjectSani"; TextView tv; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); //set parameter PropertyInfo pi = new PropertyInfo(); pi.setName("angka"); pi.setValue(2); pi.setType(int.class); request.addProperty(pi); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.setOutputSoapObject(request); HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); Log.i("Sani", "coming 1"); try { Log.i("Sani", "coming 2"); androidHttpTransport.call(SOAP_ACTION, envelope); Log.i("Sani", "coming 3"); } catch (IOException e) { tv.setText("IOException"); } catch (XmlPullParserException e) { tv.setText("XmlPullParserException"); } SoapObject result = null; try { Log.i("Sani", "coming 4"); result = (SoapObject)envelope.getResponse(); //I get the error here Log.i("Sani", "coming 5"); } catch (SoapFault e) { tv.setText("SoapFault"); } //to get the data String resultData = result.getProperty(0).toString(); tv.setText("" + resultData); setContentView(tv); } } </code></pre> <p>and here is the WSDL</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns0="SOAPObjectSani.SOAPObjectSani/SOAPObjectSani" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="SOAPObjectSani.SOAPObjectSani/SOAPObjectSani"&gt; &lt;wsdl:types&gt; &lt;xs:schema xmlns:ns="SOAPObjectSani.SOAPObjectSani/SOAPObjectSani" attributeFormDefault="qualified" elementFormDefault="unqualified" targetNamespace="SOAPObjectSani.SOAPObjectSani/SOAPObjectSani"&gt; &lt;xs:element name="getTanggalSpesial"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element minOccurs="0" name="peristiwa" nillable="true" type="xs:string"/&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="getTanggalSpesialResponse"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element maxOccurs="unbounded" minOccurs="0" name="return" type="xs:int"/&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="getKeterangan"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element minOccurs="0" name="angka" type="xs:int"/&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="getKeteranganResponse"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;/xs:schema&gt; &lt;/wsdl:types&gt; &lt;wsdl:message name="getKeteranganRequest"&gt; &lt;wsdl:part name="parameters" element="ns0:getKeterangan"/&gt; &lt;/wsdl:message&gt; &lt;wsdl:message name="getKeteranganResponse"&gt; &lt;wsdl:part name="parameters" element="ns0:getKeteranganResponse"/&gt; &lt;/wsdl:message&gt; &lt;wsdl:message name="getTanggalSpesialRequest"&gt; &lt;wsdl:part name="parameters" element="ns0:getTanggalSpesial"/&gt; &lt;/wsdl:message&gt; &lt;wsdl:message name="getTanggalSpesialResponse"&gt; &lt;wsdl:part name="parameters" element="ns0:getTanggalSpesialResponse"/&gt; &lt;/wsdl:message&gt; &lt;wsdl:portType name="SOAPObjectSaniPortType"&gt; &lt;wsdl:operation name="getKeterangan"&gt; &lt;wsdl:input message="ns0:getKeteranganRequest" wsaw:Action="urn:getKeterangan"/&gt; &lt;wsdl:output message="ns0:getKeteranganResponse" wsaw:Action="urn:getKeteranganResponse"/&gt; &lt;/wsdl:operation&gt; &lt;wsdl:operation name="getTanggalSpesial"&gt; &lt;wsdl:input message="ns0:getTanggalSpesialRequest" wsaw:Action="urn:getTanggalSpesial"/&gt; &lt;wsdl:output message="ns0:getTanggalSpesialResponse" wsaw:Action="urn:getTanggalSpesialResponse"/&gt; &lt;/wsdl:operation&gt; &lt;/wsdl:portType&gt; &lt;wsdl:binding name="SOAPObjectSaniSOAP11Binding" type="ns0:SOAPObjectSaniPortType"&gt; &lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/&gt; &lt;wsdl:operation name="getKeterangan"&gt; &lt;soap:operation soapAction="urn:getKeterangan" style="document"/&gt; &lt;wsdl:input&gt; &lt;soap:body use="literal"/&gt; &lt;/wsdl:input&gt; &lt;wsdl:output&gt; &lt;soap:body use="literal"/&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; &lt;wsdl:operation name="getTanggalSpesial"&gt; &lt;soap:operation soapAction="urn:getTanggalSpesial" style="document"/&gt; &lt;wsdl:input&gt; &lt;soap:body use="literal"/&gt; &lt;/wsdl:input&gt; &lt;wsdl:output&gt; &lt;soap:body use="literal"/&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; &lt;/wsdl:binding&gt; &lt;wsdl:binding name="SOAPObjectSaniSOAP12Binding" type="ns0:SOAPObjectSaniPortType"&gt; &lt;soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/&gt; &lt;wsdl:operation name="getKeterangan"&gt; &lt;soap12:operation soapAction="urn:getKeterangan" style="document"/&gt; &lt;wsdl:input&gt; &lt;soap12:body use="literal"/&gt; &lt;/wsdl:input&gt; &lt;wsdl:output&gt; &lt;soap12:body use="literal"/&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; &lt;wsdl:operation name="getTanggalSpesial"&gt; &lt;soap12:operation soapAction="urn:getTanggalSpesial" style="document"/&gt; &lt;wsdl:input&gt; &lt;soap12:body use="literal"/&gt; &lt;/wsdl:input&gt; &lt;wsdl:output&gt; &lt;soap12:body use="literal"/&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; &lt;/wsdl:binding&gt; &lt;wsdl:binding name="SOAPObjectSaniHttpBinding" type="ns0:SOAPObjectSaniPortType"&gt; &lt;http:binding verb="POST"/&gt; &lt;wsdl:operation name="getKeterangan"&gt; &lt;http:operation location="SOAPObjectSani/getKeterangan"/&gt; &lt;wsdl:input&gt; &lt;mime:content type="text/xml" part="getKeterangan"/&gt; &lt;/wsdl:input&gt; &lt;wsdl:output&gt; &lt;mime:content type="text/xml" part="getKeterangan"/&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; &lt;wsdl:operation name="getTanggalSpesial"&gt; &lt;http:operation location="SOAPObjectSani/getTanggalSpesial"/&gt; &lt;wsdl:input&gt; &lt;mime:content type="text/xml" part="getTanggalSpesial"/&gt; &lt;/wsdl:input&gt; &lt;wsdl:output&gt; &lt;mime:content type="text/xml" part="getTanggalSpesial"/&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; &lt;/wsdl:binding&gt; &lt;wsdl:service name="SOAPObjectSani"&gt; &lt;wsdl:port name="SOAPObjectSaniSOAP11port_http" binding="ns0:SOAPObjectSaniSOAP11Binding"&gt; &lt;soap:address location="http://0.0.0.0:8080/axis2/services/SOAPObjectSani"/&gt; &lt;/wsdl:port&gt; &lt;wsdl:port name="SOAPObjectSaniSOAP12port_http" binding="ns0:SOAPObjectSaniSOAP12Binding"&gt; &lt;soap12:address location="http://0.0.0.0:8080/axis2/services/SOAPObjectSani"/&gt; &lt;/wsdl:port&gt; &lt;wsdl:port name="SOAPObjectSaniHttpport" binding="ns0:SOAPObjectSaniHttpBinding"&gt; &lt;http:address location="http://0.0.0.0:8080/axis2/services/SOAPObjectSani"/&gt; &lt;/wsdl:port&gt; &lt;/wsdl:service&gt; &lt;/wsdl:definitions&gt; </code></pre> <p>help me please...</p>
    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.
 

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