title: Server was unable to process request. ---> Object reference not set to an instance of an object using Worklight 6.1.0?
body: <p>I have WSDL stored on my local machine provided by Client, since its Sensitive data to publish in public i am posting modified version of it below.</p>
  
  <pre><code>&lt;wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.Client.in/StoreLocator" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.Client.in/StoreLocator"&gt;
  &lt;wsdl:types&gt;
  &lt;s:schema elementFormDefault="qualified" targetNamespace="http://www.Client.in/StoreLocator"&gt;
  &lt;s:element name="GetClientStore"&gt;
  &lt;s:complexType&gt;
  &lt;s:sequence&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="fromLongitude" type="s:string"/&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="fromLatitude" type="s:string"/&gt;
  &lt;/s:sequence&gt;
  &lt;/s:complexType&gt;
  &lt;/s:element&gt;
  &lt;s:element name="GetClientStoreResponse"&gt;
  &lt;s:complexType&gt;
  &lt;s:sequence&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="GetClientStoreResult" type="s:string"/&gt;
  &lt;/s:sequence&gt;
  &lt;/s:complexType&gt;
  &lt;/s:element&gt;
  &lt;s:element name="AuthsoapHead" type="tns:AuthsoapHead"/&gt;
  &lt;s:complexType name="AuthsoapHead"&gt;
  &lt;s:sequence&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="FirstKey" type="s:string"/&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="SecondKey" type="s:string"/&gt;
  &lt;/s:sequence&gt;
  &lt;s:anyAttribute/&gt;
  &lt;/s:complexType&gt;
  &lt;/s:schema&gt;
  &lt;/wsdl:types&gt;
  &lt;wsdl:message name="GetClientStoreSoapIn"&gt;
  &lt;wsdl:part name="parameters" element="tns:GetClientStore"/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:message name="GetClientStoreSoapOut"&gt;
  &lt;wsdl:part name="parameters" element="tns:GetClientStoreResponse"/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:message name="GetClientStoreAuthsoapHead"&gt;
  &lt;wsdl:part name="AuthsoapHead" element="tns:AuthsoapHead"/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:portType name="NearestStoreSoap"&gt;
  &lt;wsdl:operation name="GetClientStore"&gt;
  &lt;wsdl:input message="tns:GetClientStoreSoapIn"/&gt;
  &lt;wsdl:output message="tns:GetClientStoreSoapOut"/&gt;
  &lt;/wsdl:operation&gt;
  &lt;/wsdl:portType&gt;
  &lt;wsdl:binding name="NearestStoreSoap" type="tns:NearestStoreSoap"&gt;
  &lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http"/&gt;
  &lt;wsdl:operation name="GetClientStore"&gt;
  &lt;soap:operation soapAction="http://www.Client.in/StoreLocator/GetClientStore" style="document"/&gt;
  &lt;wsdl:input&gt;
  &lt;soap:body use="literal"/&gt;
  &lt;soap:header message="tns:GetClientStoreAuthsoapHead" part="AuthsoapHead" 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="NearestStoreSoap12" type="tns:NearestStoreSoap"&gt;
  &lt;soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/&gt;
  &lt;wsdl:operation name="GetClientStore"&gt;
  &lt;soap12:operation soapAction="http://www.Client.in/StoreLocator/GetClientStore" style="document"/&gt;
  &lt;wsdl:input&gt;
  &lt;soap12:body use="literal"/&gt;
  &lt;soap12:header message="tns:GetClientStoreAuthsoapHead" part="AuthsoapHead" 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:service name="NearestStore"&gt;
  &lt;wsdl:port name="NearestStoreSoap" binding="tns:NearestStoreSoap"&gt;
  &lt;soap:address location="https://www.Client.in/StoreLocator/neareststore.asmx"/&gt;
  &lt;/wsdl:port&gt;
  &lt;wsdl:port name="NearestStoreSoap12" binding="tns:NearestStoreSoap12"&gt;
  &lt;soap12:address location="https://www.Client.in/StoreLocator/neareststore.asmx"/&gt;
  &lt;/wsdl:port&gt;
  &lt;/wsdl:service&gt;
  &lt;/wsdl:definitions&gt;
  </code></pre>
  
  <p>I am using Worklight Back-end Service to get results from this SOAP.
  Find below the Store Locator Service URL to fetch the nearest stores based on latitude(fromLatitude) and longitude(fromLongitude) i.e. <a href="https://www.Client.in/StoreLocator/neareststore.asmx" rel="nofollow">https://www.Client.in/StoreLocator/neareststore.asmx</a> and Also look the test keys for Client Store Locator Service URL(Pass values in Request header) i.e. FirstKey:FTG8F535DFGDFGER8GFDGG4FG8DGS, SecondKey:password.</p>
  
  <p>---------------------------------SoapAdapter1-impl.js--------------------------------------</p>
  
  <pre><code>function NearestStore_GetClientStore(params, headers){
      var soapEnvNS;
  
      soapEnvNS = 'http://www.w3.org/2003/05/soap-envelope';
      var request = buildBody(params, 'xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:tns="http://www.Client.in/StoreLocator" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" ', soapEnvNS);
      return invokeWebService(request, headers);
  }
  function invokeWebService(body, headers){
      var input = {
          method : 'post',
          returnedContentType : 'xml',
          path : '/StoreLocator/neareststore.asmx',
          body: {
              content : body.toString(),
              contentType : 'text/xml; charset=utf-8'
          }
      };
  
      //Adding custom HTTP headers if they were provided as parameter to the procedure call 
      headers &amp;&amp; (input['headers'] = headers);
  
      return WL.Server.invokeHttp(input);
  }
  </code></pre>
  
  <p>Now, i am directly Invoking Procedure from eclipse with below detail:</p>
  
  <pre><code>{
             "GetClientStore": {
                    "fromLatitude": "18.9750",
                    "fromLongitude": "72.8258"
                 }
              },{"soapAction": "http://www.Client.in/StoreLocator/GetClientStore","FirstKey":"FTG8F535DFGDFGER8GFDGG4FG8DGS","SecondKey":"password"}
  </code></pre>
  
  <p>And i am getting error now as below:</p>
  
  <pre><code>{
     "Envelope": {
        "Body": {
           "Fault": {
              "Code": {
                 "Value": "soap:Receiver"
              },
              "Detail": "",
              "Reason": {
                 "Text": {
                    "CDATA": "Server was unable to process request. ---&gt; Object reference not set to an instance of an object.",
                    "lang": "en"
                 }
              }
           }
        },
        "soap": "http:\/\/www.w3.org\/2003\/05\/soap-envelope",
        "xsd": "http:\/\/www.w3.org\/2001\/XMLSchema",
        "xsi": "http:\/\/www.w3.org\/2001\/XMLSchema-instance"
     },
     "errors": [
     ],
     "info": [
     ],
     "isSuccessful": true,
     "responseHeaders": {
        "Cache-Control": "private",
        "Connection": "Keep-Alive",
        "Content-Length": "508",
        "Content-Type": "application\/soap+xml; charset=utf-8",
        "Date": "Wed, 09 Jul 2014 11:57:13 GMT",
        "X-Frame-Options": "SAMEORIGIN",
        "X-MS-InvokeApp": "1; RequireReadOnly"
     },
     "responseTime": 158,
     "statusCode": 500,
     "statusReason": "Internal Server Error",
     "totalTime": 159,
     "warnings": [
     ]
  }
  </code></pre>