[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 7488
  • Last Modified:

Server was unable to process request. ---> Object reference not set to an instance of an object.

I have a simple web service I am trying to consume, but I am getting the error in the subject line.

The results from:
 var_dump($client->__getFunctions());

IS:

array(4) {
[0]=>  string(71) "SEServiceCheckResponse SEServiceCheck(SEServiceCheck $parameters)"
[1]=>  string(62) "ReturnFYDatesResponse ReturnFYDates(ReturnFYDates $parameters)"
[2]=>  string(71) "SEServiceCheckResponse SEServiceCheck(SEServiceCheck $parameters)"
[3]=>  string(62) "ReturnFYDatesResponse ReturnFYDates(ReturnFYDates $parameters)" }

<?php
 
try {    
 
 
	$client = new SoapClient("SEService.wsdl",
      array('trace' => true));
 
    var_dump($client->__getFunctions());
    $return = $client->ReturnFYDates('2008'); 
		 
} catch (SoapFault $exception) 
{
echo $exception; 
 
}
?>
 
 
////WSDL FILE
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://mydomain.com/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://mydomain.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> 
  <wsdl:types> 
    <s:schema elementFormDefault="qualified" targetNamespace="http://mydomain.com/"> 
      <s:element name="SEServiceCheck"> 
        <s:complexType /> 
      </s:element> 
      <s:element name="SEServiceCheckResponse"> 
        <s:complexType> 
          <s:sequence> 
            <s:element minOccurs="0" maxOccurs="1" name="SEServiceCheckResult" type="s:string" /> 
          </s:sequence> 
        </s:complexType> 
      </s:element> 
      <s:element name="ReturnFYDates"> 
        <s:complexType> 
          <s:sequence> 
            <s:element minOccurs="0" maxOccurs="1" name="fiscalyear" type="s:string" /> 
          </s:sequence> 
        </s:complexType> 
      </s:element> 
      <s:element name="ReturnFYDatesResponse"> 
        <s:complexType> 
          <s:sequence> 
            <s:element minOccurs="0" maxOccurs="1" name="ReturnFYDatesResult"> 
              <s:complexType> 
                <s:sequence> 
                  <s:element ref="s:schema" /> 
                  <s:any /> 
                </s:sequence> 
              </s:complexType> 
            </s:element> 
          </s:sequence> 
        </s:complexType> 
      </s:element> 
    </s:schema> 
  </wsdl:types> 
  <wsdl:message name="SEServiceCheckSoapIn"> 
    <wsdl:part name="parameters" element="tns:SEServiceCheck" /> 
  </wsdl:message> 
  <wsdl:message name="SEServiceCheckSoapOut"> 
    <wsdl:part name="parameters" element="tns:SEServiceCheckResponse" /> 
  </wsdl:message> 
  <wsdl:message name="ReturnFYDatesSoapIn"> 
    <wsdl:part name="parameters" element="tns:ReturnFYDates" /> 
  </wsdl:message> 
  <wsdl:message name="ReturnFYDatesSoapOut"> 
    <wsdl:part name="parameters" element="tns:ReturnFYDatesResponse" /> 
  </wsdl:message> 
  <wsdl:portType name="SEService_pxySoap"> 
    <wsdl:operation name="SEServiceCheck"> 
      <wsdl:input message="tns:SEServiceCheckSoapIn" /> 
      <wsdl:output message="tns:SEServiceCheckSoapOut" /> 
    </wsdl:operation> 
    <wsdl:operation name="ReturnFYDates"> 
      <wsdl:input message="tns:ReturnFYDatesSoapIn" /> 
      <wsdl:output message="tns:ReturnFYDatesSoapOut" /> 
    </wsdl:operation> 
  </wsdl:portType> 
  <wsdl:binding name="SEService_pxySoap" type="tns:SEService_pxySoap"> 
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" /> 
    <wsdl:operation name="SEServiceCheck"> 
      <soap:operation soapAction="http://mydomain.com/SEServiceCheck" style="document" /> 
      <wsdl:input> 
        <soap:body use="literal" /> 
      </wsdl:input> 
      <wsdl:output> 
        <soap:body use="literal" /> 
      </wsdl:output> 
    </wsdl:operation> 
    <wsdl:operation name="ReturnFYDates"> 
      <soap:operation soapAction="http://mydomain.com/ReturnFYDates" style="document" /> 
      <wsdl:input> 
        <soap:body use="literal" /> 
      </wsdl:input> 
      <wsdl:output> 
        <soap:body use="literal" /> 
      </wsdl:output> 
    </wsdl:operation> 
  </wsdl:binding> 
  <wsdl:binding name="SEService_pxySoap12" type="tns:SEService_pxySoap"> 
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /> 
    <wsdl:operation name="SEServiceCheck"> 
      <soap12:operation soapAction="http://mydomain.com/SEServiceCheck" style="document" /> 
      <wsdl:input> 
        <soap12:body use="literal" /> 
      </wsdl:input> 
      <wsdl:output> 
        <soap12:body use="literal" /> 
      </wsdl:output> 
    </wsdl:operation> 
    <wsdl:operation name="ReturnFYDates"> 
      <soap12:operation soapAction="http://mydomain.com/ReturnFYDates" style="document" /> 
      <wsdl:input> 
        <soap12:body use="literal" /> 
      </wsdl:input> 
      <wsdl:output> 
        <soap12:body use="literal" /> 
      </wsdl:output> 
    </wsdl:operation> 
  </wsdl:binding> 
  <wsdl:service name="SEService_pxy"> 
    <wsdl:port name="SEService_pxySoap" binding="tns:SEService_pxySoap"> 
      <soap:address location="http://mydomain.com/SEService/SEService_pxy.asmx" /> 
    </wsdl:port> 
    <wsdl:port name="SEService_pxySoap12" binding="tns:SEService_pxySoap12"> 
      <soap12:address location="http://mydomain.com/SEService/SEService_pxy.asmx" /> 
    </wsdl:port> 
  </wsdl:service> 
</wsdl:definitions>

Open in new window

0
hallikpapa
Asked:
hallikpapa
1 Solution
 
hallikpapaAuthor Commented:
I wasn't passing the parameters correctly it seems. I added the following, and it worked.
$params   = array(
    'fiscalyear' => "2008",
);
 
$response = $client->ReturnFYDates($params);

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now