title: How to consume this WebService in Android?
body: <p>I am developing a application to consume the web service, how to consume the following web-service? http method or ksoap2? I tried Ksoap2, seems can not extract this web service properly, anybody can help on this? thanks in advance.</p>
  
  <p>Here is the wsdl: <a href="http://www.restfulwebservices.net/wcf/StockQuoteService.svc?wsdl" rel="nofollow">http://www.restfulwebservices.net/wcf/StockQuoteService.svc?wsdl</a></p>
  
  <p>Is that the NAME_SPACE is: <a href="http://www.restfulwebservices.net/ServiceContracts/2008/01" rel="nofollow">http://www.restfulwebservices.net/ServiceContracts/2008/01</a>? method is GetStockQuote? and the SOAP_ACTION is GetStockQuote?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;wsdl:definitions name="StockQuoteService"
  targetNamespace="http://www.restfulwebservices.net/ServiceContracts/2008/01"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
  xmlns:tns="http://www.restfulwebservices.net/ServiceContracts/2008/01"
  xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
  xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
  xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract"
  xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
  xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
  xmlns:wsa10="http://www.w3.org/2005/08/addressing"
  xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"&gt;
    &lt;wsdl:types&gt;
      &lt;xsd:schema targetNamespace="http://www.restfulwebservices.net/ServiceContracts/2008/01/Imports"&gt;
  
        &lt;xsd:import schemaLocation="http://www.restfulwebservices.net/wcf/StockQuoteService.svc?xsd=xsd0"
        namespace="http://www.restfulwebservices.net/ServiceContracts/2008/01" /&gt;
        &lt;xsd:import schemaLocation="http://www.restfulwebservices.net/wcf/StockQuoteService.svc?xsd=xsd3"
        namespace="http://GOTLServices.FaultContracts/2008/01" /&gt;
        &lt;xsd:import schemaLocation="http://www.restfulwebservices.net/wcf/StockQuoteService.svc?xsd=xsd1"
        namespace="http://schemas.microsoft.com/2003/10/Serialization/" /&gt;
        &lt;xsd:import schemaLocation="http://www.restfulwebservices.net/wcf/StockQuoteService.svc?xsd=xsd2"
        namespace="http://www.restfulwebservices.net/DataContracts/2008/01" /&gt;
      &lt;/xsd:schema&gt;
    &lt;/wsdl:types&gt;
    &lt;wsdl:message name="IStockQuoteService_GetStockQuote_InputMessage"&gt;
  
      &lt;wsdl:part name="parameters" element="tns:GetStockQuote" /&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="IStockQuoteService_GetStockQuote_OutputMessage"&gt;
  
      &lt;wsdl:part name="parameters"
      element="tns:GetStockQuoteResponse" /&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="IStockQuoteService_GetStockQuote_DefaultFaultContractFault_FaultMessage"&gt;
  
      &lt;wsdl:part name="detail" element="q1:DefaultFaultContract"
      xmlns:q1="http://GOTLServices.FaultContracts/2008/01" /&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="IStockQuoteService_GetWorldMajorIndices_InputMessage"&gt;
  
      &lt;wsdl:part name="parameters"
      element="tns:GetWorldMajorIndices" /&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="IStockQuoteService_GetWorldMajorIndices_OutputMessage"&gt;
  
      &lt;wsdl:part name="parameters"
      element="tns:GetWorldMajorIndicesResponse" /&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="IStockQuoteService_GetWorldMajorIndices_DefaultFaultContractFault_FaultMessage"&gt;
  
      &lt;wsdl:part name="detail" element="q2:DefaultFaultContract"
      xmlns:q2="http://GOTLServices.FaultContracts/2008/01" /&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:portType name="IStockQuoteService"&gt;
      &lt;wsdl:operation name="GetStockQuote"&gt;
        &lt;wsdl:input wsaw:Action="GetStockQuote"
        message="tns:IStockQuoteService_GetStockQuote_InputMessage" /&gt;
        &lt;wsdl:output wsaw:Action="http://www.restfulwebservices.net/ServiceContracts/2008/01/IStockQuoteService/GetStockQuoteResponse"
        message="tns:IStockQuoteService_GetStockQuote_OutputMessage" /&gt;
        &lt;wsdl:fault wsaw:Action="http://www.restfulwebservices.net/ServiceContracts/2008/01/IStockQuoteService/GetStockQuoteDefaultFaultContractFault"
        name="DefaultFaultContractFault"
        message="tns:IStockQuoteService_GetStockQuote_DefaultFaultContractFault_FaultMessage" /&gt;
      &lt;/wsdl:operation&gt;
      &lt;wsdl:operation name="GetWorldMajorIndices"&gt;
        &lt;wsdl:input wsaw:Action="GetWorldMajorIndices"
        message="tns:IStockQuoteService_GetWorldMajorIndices_InputMessage" /&gt;
        &lt;wsdl:output wsaw:Action="http://www.restfulwebservices.net/ServiceContracts/2008/01/IStockQuoteService/GetWorldMajorIndicesResponse"
        message="tns:IStockQuoteService_GetWorldMajorIndices_OutputMessage" /&gt;
        &lt;wsdl:fault wsaw:Action="http://www.restfulwebservices.net/ServiceContracts/2008/01/IStockQuoteService/GetWorldMajorIndicesDefaultFaultContractFault"
        name="DefaultFaultContractFault"
        message="tns:IStockQuoteService_GetWorldMajorIndices_DefaultFaultContractFault_FaultMessage" /&gt;
      &lt;/wsdl:operation&gt;
    &lt;/wsdl:portType&gt;
    &lt;wsdl:binding name="BasicHttpBinding_IStockQuoteService"
    type="tns:IStockQuoteService"&gt;
      &lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http" /&gt;
      &lt;wsdl:operation name="GetStockQuote"&gt;
        &lt;soap:operation soapAction="GetStockQuote"
        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:fault name="DefaultFaultContractFault"&gt;
          &lt;soap:fault name="DefaultFaultContractFault"
          use="literal" /&gt;
        &lt;/wsdl:fault&gt;
      &lt;/wsdl:operation&gt;
      &lt;wsdl:operation name="GetWorldMajorIndices"&gt;
        &lt;soap:operation soapAction="GetWorldMajorIndices"
        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:fault name="DefaultFaultContractFault"&gt;
          &lt;soap:fault name="DefaultFaultContractFault"
          use="literal" /&gt;
        &lt;/wsdl:fault&gt;
      &lt;/wsdl:operation&gt;
    &lt;/wsdl:binding&gt;
    &lt;wsdl:service name="StockQuoteService"&gt;
      &lt;wsdl:port name="BasicHttpBinding_IStockQuoteService"
      binding="tns:BasicHttpBinding_IStockQuoteService"&gt;
        &lt;soap:address location="http://www.restfulwebservices.net/wcf/StockQuoteService.svc" /&gt;
      &lt;/wsdl:port&gt;
    &lt;/wsdl:service&gt;
  &lt;/wsdl:definitions&gt;
  </code></pre>
  
  <p>Here is the requestDump:</p>
  
  <pre><code>    &lt;v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:d="http://www.w3.org/2001/XMLSchema"
      xmlns:c="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:v="http://schemas.xmlsoap.org/soap/envelope/"&gt;
        &lt;v:Header /&gt;
        &lt;v:Body&gt;
          &lt;GetStockQuote xmlns="http://www.restfulwebservices.net/ServiceContracts/2008/01"
          id="o0" c:root="1"&gt;
            &lt;parameters i:type="d:string"&gt;IBM&lt;/parameters&gt;
          &lt;/GetStockQuote&gt;
        &lt;/v:Body&gt;
      &lt;/v:Envelope&gt;
  </code></pre>
  
  <p>responseDump:</p>
  
  <pre><code>    &lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;
        &lt;s:Body&gt;
          &lt;s:Fault&gt;
            &lt;faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher"&gt;
            a:InternalServiceFault&lt;/faultcode&gt;
            &lt;faultstring xml:lang="en-US"&gt;Object reference not set to an
            instance of an object.&lt;/faultstring&gt;
            &lt;detail&gt;
              &lt;ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel"
              xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;
                &lt;HelpLink i:nil="true" /&gt;
                &lt;InnerException i:nil="true" /&gt;
                &lt;Message&gt;Object reference not set to an instance of an
                object.&lt;/Message&gt;
                &lt;StackTrace&gt;at
                GOTLServices.ServiceImplementation.StockQuoteService.GetStockQuote(String
                symbol)
      &lt;/StackTrace&gt;
              &lt;/ExceptionDetail&gt;
            &lt;/detail&gt;
          &lt;/s:Fault&gt;
        &lt;/s:Body&gt;
      &lt;/s:Envelope&gt;
  </code></pre>