title: SOAP response Error using WSDL in php
body: <p>I am using SOAP call with WSDL file, I am getting below Error..
  the below is my error </p>
  
  <p><strong>SoapFault exception: [a:InternalServiceFault] Object reference not set to an instance of an object. in /opt/projects/PHP/Dev1/sopadatatest.php:40 Stack trace: #0 /opt/projects/PHP/Dev1/sopadatatest.php(40): SoapClient->__call('AccountSignUp', Array) #1 /opt/projects/PHP/Dev1/sopadatatest.php(40): SoapClient->AccountSignUp(Array) #2 {main}</strong></p>
  
  <pre><code>$url = "Signup.wsdl";
  
  $data = array(
  "SignUpInformation" =&gt; array("AccountName" =&gt; "secret", 
                          "AffiliateID" =&gt; "secret",
                          "Comment" =&gt; "secret",
                          "CurrencyCode" =&gt; "secret",
                          "DBA" =&gt; "secret"
                          ),
  "PrimaryBankAccountInformation" =&gt; array("AccountName" =&gt; "EXTERNAL",
                           "AccountNumber" =&gt; "2012-10-20T00:04:34.479Z",
                           "AccountOwnershipType" =&gt; "2012-10-20T00:04:34.479Z",
                           "AccountType" =&gt; "Ext-id-00502",
                           "BankName" =&gt; "test ",
                           "CountryCode" =&gt; "customer Contact",
                           "RoutingNumber" =&gt; "123456789"
                      )
  );
  
  try {
      $soapClient = new SoapClient($url, array('soap_version' =&gt; SOAP_1_1, 'trace' =&gt; 1, 'exceptions' =&gt; 0 
      // for debugging, disable in production
          //"connection_timeout" =&gt; 1
      ));
  
      // List types to get an idea how to call methods, since it looks like
      // there are no help pages as in .asmx services
       //var_dump($soapClient-&gt;__getTypes());
  
      $response = $soapClient-&gt;AccountSignUp($data);
      echo $response;
  } catch (Exception $e) {
      trigger_error("SOAP error: ".$e-&gt;getMessage(), E_USER_WARNING);
  }
  print_r($e);
  </code></pre>
  
  <p>And below is my WSDL file I am trying but unable to get any solution by doing above code and and getting above error message while printing the response ..can any one tell me where i did wrong that might more helpful for me ..</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;wsdl:definitions name="Signup" targetNamespace="https://ClickAndPledge.com/ApplicationService/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:i0="https://ClickAndPledge.com/Signup/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 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:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="https://ClickAndPledge.com/ApplicationService/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"&gt;
      &lt;wsdl:types&gt;
          &lt;xs:schema elementFormDefault="qualified" targetNamespace="https://ClickAndPledge.com/ApplicationService/" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
              &lt;xs:import namespace="http://schemas.datacontract.org/2004/07/ApplicationService" /&gt;
              &lt;xs:element name="AccountSignUp"&gt;
                  &lt;xs:complexType&gt;
                      &lt;xs:sequence&gt;
                          &lt;xs:element minOccurs="0" name="key1" nillable="true" type="xs:string" /&gt;
                          &lt;xs:element minOccurs="0" name="key2" nillable="true" type="xs:string" /&gt;
                          &lt;xs:element minOccurs="0" name="signUpInformation" nillable="true" type="q1:SignUpInformation" xmlns:q1="http://schemas.datacontract.org/2004/07/ApplicationService" /&gt;
                          &lt;xs:element minOccurs="0" name="primaryAccount" nillable="true" type="q2:PrimaryBankAccountInformation" xmlns:q2="http://schemas.datacontract.org/2004/07/ApplicationService" /&gt;
                      &lt;/xs:sequence&gt;
                  &lt;/xs:complexType&gt;
              &lt;/xs:element&gt;
              &lt;xs:element name="AccountSignUpResponse"&gt;
                  &lt;xs:complexType&gt;
                      &lt;xs:sequence&gt;
                          &lt;xs:element minOccurs="0" name="AccountSignUpResult" nillable="true" type="q3:SignupResult" xmlns:q3="http://schemas.datacontract.org/2004/07/ApplicationService" /&gt;
                      &lt;/xs:sequence&gt;
                  &lt;/xs:complexType&gt;
              &lt;/xs:element&gt;
          &lt;/xs:schema&gt;
          &lt;xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/"&gt;
              &lt;xs:element name="anyType" nillable="true" type="xs:anyType" /&gt;
              &lt;xs:element name="anyURI" nillable="true" type="xs:anyURI" /&gt;
              &lt;xs:element name="base64Binary" nillable="true" type="xs:base64Binary" /&gt;
              &lt;xs:element name="boolean" nillable="true" type="xs:boolean" /&gt;
              &lt;xs:element name="byte" nillable="true" type="xs:byte" /&gt;
              &lt;xs:element name="dateTime" nillable="true" type="xs:dateTime" /&gt;
              &lt;xs:element name="decimal" nillable="true" type="xs:decimal" /&gt;
              &lt;xs:element name="double" nillable="true" type="xs:double" /&gt;
              &lt;xs:element name="float" nillable="true" type="xs:float" /&gt;
              &lt;xs:element name="int" nillable="true" type="xs:int" /&gt;
              &lt;xs:element name="long" nillable="true" type="xs:long" /&gt;
              &lt;xs:element name="QName" nillable="true" type="xs:QName" /&gt;
              &lt;xs:element name="short" nillable="true" type="xs:short" /&gt;
              &lt;xs:element name="string" nillable="true" type="xs:string" /&gt;
              &lt;xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte" /&gt;
              &lt;xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt" /&gt;
              &lt;xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong" /&gt;
              &lt;xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort" /&gt;
              &lt;xs:element name="char" nillable="true" type="tns:char" /&gt;
              &lt;xs:simpleType name="char"&gt;
                  &lt;xs:restriction base="xs:int" /&gt;
              &lt;/xs:simpleType&gt;
              &lt;xs:element name="duration" nillable="true" type="tns:duration" /&gt;
              &lt;xs:simpleType name="duration"&gt;
                  &lt;xs:restriction base="xs:duration"&gt;
                      &lt;xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?" /&gt;
                      &lt;xs:minInclusive value="-P10675199DT2H48M5.4775808S" /&gt;
                      &lt;xs:maxInclusive value="P10675199DT2H48M5.4775807S" /&gt;
                  &lt;/xs:restriction&gt;
              &lt;/xs:simpleType&gt;
              &lt;xs:element name="guid" nillable="true" type="tns:guid" /&gt;
              &lt;xs:simpleType name="guid"&gt;
                  &lt;xs:restriction base="xs:string"&gt;
                      &lt;xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}" /&gt;
                  &lt;/xs:restriction&gt;
              &lt;/xs:simpleType&gt;
              &lt;xs:attribute name="FactoryType" type="xs:QName" /&gt;
              &lt;xs:attribute name="Id" type="xs:ID" /&gt;
              &lt;xs:attribute name="Ref" type="xs:IDREF" /&gt;
          &lt;/xs:schema&gt;
          &lt;xs:schema elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/ApplicationService" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.datacontract.org/2004/07/ApplicationService"&gt;
              &lt;xs:complexType name="SignUpInformation"&gt;
                  &lt;xs:sequence&gt;
                      &lt;xs:element minOccurs="0" name="AccountName" nillable="true" type="xs:string" /&gt;
                      &lt;xs:element minOccurs="0" name="AffiliateID" type="xs:long" /&gt;
                      &lt;xs:element minOccurs="0" name="Comment" nillable="true" type="xs:string" /&gt;
                      &lt;xs:element minOccurs="0" name="CurrencyCode" type="xs:int" /&gt;
                      &lt;xs:element minOccurs="0" name="DBA" nillable="true" type="xs:string" /&gt;
                      &lt;xs:element minOccurs="0" name="GiveBigCampaignID" type="xs:long" /&gt;
                      &lt;xs:element minOccurs="0" name="MailingAddress" nillable="true" type="tns:Address" /&gt;
                      &lt;xs:element minOccurs="0" name="PhysicalAddress" nillable="true" type="tns:Address" /&gt;
                      &lt;xs:element minOccurs="0" name="PlanID" type="xs:long" /&gt;
                      &lt;xs:element minOccurs="0" name="ReferalID" type="xs:long" /&gt;
                      &lt;xs:element minOccurs="0" name="TaxID" nillable="true" type="xs:string" /&gt;
                      &lt;xs:element minOccurs="0" name="TimeZone" nillable="true" type="xs:string" /&gt;
                      &lt;xs:element minOccurs="0" name="User1" nillable="true" type="tns:User" /&gt;
                      &lt;xs:element minOccurs="0" name="User2" nillable="true" type="tns:User" /&gt;
                      &lt;xs:element minOccurs="0" name="WebsiteURL" nillable="true" type="xs:string" /&gt;
                  &lt;/xs:sequence&gt;
              &lt;/xs:complexType&gt;
              &lt;xs:element name="SignUpInformation" nillable="true" type="tns:SignUpInformation" /&gt;
              &lt;xs:complexType name="Address"&gt;
                  &lt;xs:sequence&gt;
                      &lt;xs:element minOccurs="0" name="Address1" nillable="true" type="xs:string" /&gt;
                      &lt;xs:element minOccurs="0" name="Address2" nillable="true" type="xs:string" /&gt;
                      &lt;xs:element minOccurs="0" name="City" nillable="true" type="xs:string" /&gt;
                      &lt;xs:element minOccurs="0" name="Country" nillable="true" type="xs:string" /&gt;
                      &lt;xs:element minOccurs="0" name="State" nillable="true" type="xs:string" /&gt;
                      &lt;xs:element minOccurs="0" name="ZipCode" nillable="true" type="xs:string" /&gt;
                  &lt;/xs:sequence&gt;
              &lt;/xs:complexType&gt;
              &lt;xs:element name="Address" nillable="true" type="tns:Address" /&gt;
              &lt;xs:complexType name="User"&gt;
                  &lt;xs:sequence&gt;
                      &lt;xs:element minOccurs="0" name="Email" nillable="true" type="xs:string" /&gt;
                      &lt;xs:element minOccurs="0" name="FirstName" nillable="true" type="xs:string" /&gt;
                      &lt;xs:element minOccurs="0" name="LastName" nillable="true" type="xs:string" /&gt;
                      &lt;xs:element minOccurs="0" name="Phone" nillable="true" type="xs:string" /&gt;
                  &lt;/xs:sequence&gt;
              &lt;/xs:complexType&gt;
              &lt;xs:element name="User" nillable="true" type="tns:User" /&gt;
              &lt;xs:complexType name="PrimaryBankAccountInformation"&gt;
                  &lt;xs:sequence&gt;
                      &lt;xs:element minOccurs="0" name="AccountName" nillable="true" type="xs:string" /&gt;
                      &lt;xs:element minOccurs="0" name="AccountNumber" nillable="true" type="xs:string" /&gt;
                      &lt;xs:element minOccurs="0" name="AccountOwnershipType" nillable="true" type="xs:string" /&gt;
                      &lt;xs:element minOccurs="0" name="AccountType" nillable="true" type="xs:string" /&gt;
                      &lt;xs:element minOccurs="0" name="BankName" nillable="true" type="xs:string" /&gt;
                      &lt;xs:element minOccurs="0" name="CountryCode" nillable="true" type="xs:string" /&gt;
                      &lt;xs:element minOccurs="0" name="RoutingNumber" nillable="true" type="xs:string" /&gt;
                  &lt;/xs:sequence&gt;
              &lt;/xs:complexType&gt;
              &lt;xs:element name="PrimaryBankAccountInformation" nillable="true" type="tns:PrimaryBankAccountInformation" /&gt;
              &lt;xs:complexType name="SignupResult"&gt;
                  &lt;xs:sequence&gt;
                      &lt;xs:element minOccurs="0" name="AccountID" type="xs:long" /&gt;
                      &lt;xs:element minOccurs="0" name="Code" nillable="true" type="xs:string" /&gt;
                      &lt;xs:element minOccurs="0" name="Description" nillable="true" type="xs:string" /&gt;
                  &lt;/xs:sequence&gt;
              &lt;/xs:complexType&gt;
              &lt;xs:element name="SignupResult" nillable="true" type="tns:SignupResult" /&gt;
          &lt;/xs:schema&gt;
      &lt;/wsdl:types&gt;
      &lt;wsdl:message name="ISignup_AccountSignUp_InputMessage"&gt;
          &lt;wsdl:part name="parameters" element="tns:AccountSignUp" /&gt;
      &lt;/wsdl:message&gt;
      &lt;wsdl:message name="ISignup_AccountSignUp_OutputMessage"&gt;
          &lt;wsdl:part name="parameters" element="tns:AccountSignUpResponse" /&gt;
      &lt;/wsdl:message&gt;
      &lt;wsdl:portType name="ISignup"&gt;
          &lt;wsdl:operation name="AccountSignUp"&gt;
              &lt;wsdl:input wsaw:Action="https://ClickAndPledge.com/ApplicationService/ISignup/AccountSignUp" message="tns:ISignup_AccountSignUp_InputMessage" /&gt;
              &lt;wsdl:output wsaw:Action="https://ClickAndPledge.com/ApplicationService/ISignup/AccountSignUpResponse" message="tns:ISignup_AccountSignUp_OutputMessage" /&gt;
          &lt;/wsdl:operation&gt;
      &lt;/wsdl:portType&gt;
      &lt;wsdl:binding name="basicHttpEndpoint" type="tns:ISignup"&gt;
          &lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http" /&gt;
          &lt;wsdl:operation name="AccountSignUp"&gt;
              &lt;soap:operation soapAction="https://ClickAndPledge.com/ApplicationService/ISignup/AccountSignUp" 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:service name="Signup"&gt;
          &lt;wsdl:port name="basicHttpEndpoint" binding="tns:basicHttpEndpoint"&gt;
              &lt;soap:address location="https://application.cloud.clickandpledge.com/Signup.svc" /&gt;
          &lt;/wsdl:port&gt;
      &lt;/wsdl:service&gt;
  &lt;/wsdl:definitions&gt;
  </code></pre>