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

object refernce error

Expand Messages
  • Christy
    Using the following bit of code: my $query=qq{
    Message 1 of 1 , Nov 16, 2004
    • 0 Attachment
      Using the following bit of code:


      my $query=qq{
      <EverNetQuerySpecification
      xmlns="urn:www.nwmls.com/Schemas/General/EverNetQueryXML.xsd">
      <Message>
      <Head>
      <UserId>MYUSER</UserId>
      <Password>MYPASS</Password>
      <SchemaName>NWMLSStandardXML</SchemaName>
      </Head>
      <Body>
      <Query>
      </Query>
      </Body>
      </Message>
      </EverNetQuerySpecification>};


      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})
      =>#Arguments listed next
      SOAP::Data->name(v_strXMLQuery=>$query));


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

      I get the following error regarding object references. I assume that
      the problem is with the code and not the actual SOAP interaction.

      Can someone help


      SOAP::Transport::HTTP::Client::send_receive:
      HTTP::Request=HASH(0x9d8545c)
      SOAP::Transport::HTTP::Client::send_receive: POST
      http://evernet.nwmls.com/evernetqueryservice/evernetquery.asmx HTTP/1.1
      Accept: text/xml
      Accept: multipart/*
      Content-Length: 866
      Content-Type: text/xml; charset=utf-8
      SOAPAction: "http://www.nwmls.com/EverNetServices/RetrieveOfficeData"

      <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><RetrieveOfficeData xmlns="http://www.nwmls.com/EverNetServices"><v_strXMLQuery xsi:type="xsd:string">
      <EverNetQuerySpecification
      xmlns="urn:www.nwmls.com/Schemas/General/EverNetQueryXML.xsd">
      <Message>
      <Head>
      <UserId>MYUSER</UserId>
      <Password>MYPASS</Password>
      <SchemaName>NWMLSStandardXML</SchemaName>
      </Head>
      <Body>
      <Query>
      </Query>
      </Body>
      </Message>
      </EverNetQuerySpecification></v_strXMLQuery></RetrieveOfficeData></SOAP-ENV:Body></SOAP-ENV:Envelope>
      SOAP::Transport::HTTP::Client::send_receive:
      HTTP::Response=HASH(0x9fe7cc8)
      SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
      Cache-Control: private, max-age=0
      Connection: close
      Date: Tue, 16 Nov 2004 22:24:50 GMT
      Server: Microsoft-IIS/5.0
      Content-Length: 1235
      Content-Type: text/xml; charset=utf-8
      Client-Date: Tue, 16 Nov 2004 22:24:50 GMT
      Client-Response-Num: 1
      X-AspNet-Version: 1.1.4322
      X-Powered-By: ASP.NET

      <?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"><RetrieveOfficeDataResult><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.CheckWellFormedNess(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></RetrieveOfficeDataResult></RetrieveOfficeDataResponse></soap:Body></soap:Envelope>
    Your message has been successfully submitted and would be delivered to recipients shortly.