Loading ...
Sorry, an error occurred while loading the content.

not set to an instance of an object

Expand Messages
  • Christy Austin
    I am getting the following error in my soap response:
    Message 1 of 1 , Nov 7, 2004
    • 0 Attachment
      I am getting the following error in my soap response:

      <?xml version="1.0" encoding="utf-8"?><soap:Envelope
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap
      :Body><RetrieveOfficeDataResponse
      xmlns="http://www.nwmls.com/EverNetServices"><Retr
      ieveOfficeDataResult><Offices><ResponseMe
      ssages><Message><Error>System.NullReferenceException:
      Object reference not set to an instance of an object.
      at System.Xml.XmlTextReader..ctor(String xmlFragment, XmlNodeType
      fragType, XmlParserContext context)
      at
      EverNetLib.EverNetUtility.QueryParseOperations.Che
      ckWellFormedNess(String
      v_strUserName, String v_strXmlQuery, XmlValidatingReader xvrReader)
      at
      EverNetLib.EverNetUtility.QueryParseOperations.ValidateQuery(String
      v_strXmlQuery, MessageCollections& r_mcMessages, Boolean
      blnBuildQueryParamCollection)
      at EverNetQueryService.EverNetQuery.ValidAndRemotingEnabled(String
      v_strXmlQuery, String v_strMethodName)
      at EverNetQueryService.EverNetQuery.RetrieveOfficeData(String
      v_strXmlQuery)</Error></Message></R
      esponseMessages></Offices></RetrieveOffic
      eDataResult></RetrieveOfficeDataResponse></soap:Body></soap:Envelope>


      <Offices><ResponseMessages><Message><Error>System.
      NullReferenceException:
      Object reference not set to an instance of an object.
      at System.Xml.XmlTextReader..ctor(String xmlFragment, XmlNodeType
      fragType, XmlParserContext context)
      at
      EverNetLib.EverNetUtility.QueryParseOperations.Che
      ckWellFormedNess(String
      v_strUserName, String v_strXmlQuery, XmlValidatingReader xvrReader)
      at
      EverNetLib.EverNetUtility.QueryParseOperations.ValidateQuery(String
      v_strXmlQuery, MessageCollections& r_mcMessages, Boolean
      blnBuildQueryParamCollection)
      at EverNetQueryService.EverNetQuery.ValidAndRemotingEnabled(String
      v_strXmlQuery, String v_strMethodName)
      at EverNetQueryService.EverNetQuery.RetrieveOfficeData(String
      v_strXmlQuery)</Error></Message></ResponseMessages></Offices>


      Here is the code:

      my $uri="http://www.nwmls.com/EverNetServices";
      my $server='http://evernet.nwmls.com';
      my $endpoint="$server/evernetqueryservice/evernetquery.asmx";
      my $method='RetrieveOfficeData';
      my $soap = SOAP::Lite ->uri($uri) ->proxy("$endpoint")
      ->on_action(sub { sprintf '"%s/%s"', shift,shift }) ;




      $soap->serializer->xmlschema('2001'); # Not strictly needed but
      doesn't help


      #my $response =
      $soap->call(SOAP::Data->name($method)->attr({xmlns
      =>$uri})=>SOAP::Data->name(v_strXmlQuery=>$num));


      my $response=$soap ->call( SOAP::Data->name($method)
      ->attr({xmlns=>$uri})
      =>#Arguments listed next
      SOAP::Data->name(v_strUserName=>$luser));

      if ($response->fault){
      printf "A fault (%s) occurred: %s\n",
      $response->faultcode,$response->faultstring. join
      ("\n\t",@_)."\n";
      }
      else
      { print "$response->result\n";
      }

      Where is the code problem here?
    Your message has been successfully submitted and would be delivered to recipients shortly.