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

'Element' is an invalid node type - .NET WebService, SOAP::Lite client

Expand Messages
  • Mitchell, Louise M
    All, I m getting an error message: Element is an invalid node type The web service is .NET, calling from SOAP::Lite perl script.... the perl code, .NET soap
    Message 1 of 1 , May 28 7:55 AM
    • 0 Attachment
      'Element' is an invalid node type - .NET WebService, SOAP::Lite client

      All,

      I'm getting an error message:  'Element' is an invalid node type

      The web service is .NET, calling from SOAP::Lite perl script.... the perl code, .NET soap template, my soap envelope, and my soap response are all below...

      I've googled this error string... seems to indicate some bug if using an xsd and some nested elements, but I'm not using any schema with this...

      I've also tried to follow the instructions on the microsoft site for calling a .NET web service from SOAP::Lite... there ARE differences between my SOAP envelope and the SOAP envelope template provided by the .NET web service...like the SOAP-ENV namespace used by SOAP::Lite....also, the 1999 Schema reference, vs. the 2001 Schema reference... I'm just not sure which ones matter... or if that's the issue at all...

      Any help is appreciated...

      thanks,
      L
      ***********************
      perl code
      ***********************
      #!d:/apps/perl/bin/perl.exe
      use SOAP::Lite ( +trace => all, maptype => {} );
        select STDOUT; $|=1;
        select STDERR; $|=1;
      my $soap = SOAP::Lite
                 ->uri('http://tempuri.org')
                 ->on_action( sub { join '/', 'http://tempuri.org', $_[1] } )
                 ->proxy('http://ppsdev.pnl.gov/rateestimator/rateestimator.asmx');
      sub SOAP::Transport::HTTP::Client::get_basic_credentials {
        return '****' => '****'; }         
      $xml = q%<sXML><rate_estimator_trans>
              <send_title_sw>Y</send_title_sw>
              <short_record_sw>Y</short_record_sw>
              <remove_non_orig_base_trans_sw>Y</remove_non_orig_base_trans_sw>
              <rate_eff_date></rate_eff_date>
              <material_travel_estimate_date></material_travel_estimate_date>
              <acctg_trans>
              <acctg_tran units="56" cost_bypass_sw="N" change_sw="N" id="7" emplid="" parent_id="6" fy="2003" alc_grp_id="" rcvr_subacct="6378" cost_sheet_no="6378" revision_no="0" rcvr_acct="25110" toe="117" sndr_acct="" sndr_subacct="" cor_cd="71" resource_type="117 - Regular Labor"        tos="" task_midpoint_date="08/31/2003" pre_escalate_sw="Y" amt="4218.80" bld_cd="E" cost_cd="D9T97" trav_type="" resource_category="Labor"/>

              <acctg_tran units="56" cost_bypass_sw="N" change_sw="N" id="7" emplid="" parent_id="6" fy="2003" alc_grp_id="" rcvr_subacct="6378" cost_sheet_no="6378" revision_no="0" rcvr_acct="25110" toe="233" sndr_acct="" sndr_subacct="" cor_cd="71" resource_type="Acquisition Service Charge" tos="" task_midpoint_date="08/31/2003" pre_escalate_sw="Y" amt="250"     bld_cd="E" cost_cd="D9T97" trav_type="" resource_category="Materials"/>

              </acctg_trans>
              <alcs>
              <alc alc_grp_id="" rcvr_subacct="6378" cost_sheet_no="6378" revision_no="0" alc_toe="980" rate="12.00" subacct_ovr="" wp_no_ovr=""/>

              </alcs>
            </rate_estimator_trans></sXML>%;


      my $method = SOAP::Data->name('BurdenTransaction')->attr({xmlns=>'http://tempuri.org/'});
      my $param = SOAP::Data->type('xml' => $xml);
      my $response = $soap->call($method=>$param);
      if ($response->fault)
        {
          die $response->faultstring;
        }
      else
        {
          my %result = %{$response->result};
          print map("$_: @{[$result{$_} || '']}\n", keys %result), "\n";
        }
      ****************************************
      MS.NET soap envelope template
      ****************************************
      POST /rateestimator/rateestimator.asmx HTTP/1.1
      Host: ppsdev.pnl.gov
      Content-Type: text/xml; charset=utf-8
      Content-Length: length
      SOAPAction: "http://tempuri.org/BurdenTransaction"

      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

        <soap:Body>
          <BurdenTransaction xmlns="http://tempuri.org/">
            <sXML>string</sXML>
          </BurdenTransaction>
        </soap:Body>
      </soap:Envelope>
      ****************************************
      my soap envelope
      ****************************************
      POST http://ppsdev.pnl.gov/rateestimator/rateestimator.asmx
      Accept: text/xml
      Accept: multipart/*
      Content-Length: 1818
      Content-Type: text/xml; charset=utf-8
      SOAPAction: http://tempuri.org/BurdenTransaction

      <?xml version="1.0" encoding="UTF-8"?>
          <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/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/1999/XMLSchema"
                             SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
           <SOAP-ENV:Body>
            <BurdenTransaction xmlns="http://tempuri.org/">
             <sXML>
             <rate_estimator_trans>
              <send_title_sw>Y</send_title_sw>
              <short_record_sw>Y</short_record_sw>
              <remove_non_orig_base_trans_sw>Y</remove_non_orig_base_trans_sw>
              <rate_eff_date>04/30/2004</rate_eff_date>
              <material_travel_estimate_date>04/30/2004</material_travel_estimate_date>
              <acctg_trans>
              <acctg_tran units="56" cost_bypass_sw="N" change_sw="N" id="7" emplid="" parent_id="6" fy="2003" alc_grp_id="" rcvr_subacct="6378" cost_sheet_no="6378" revision_no="0" rcvr_acct="25110" toe="117" sndr_acct="" sndr_subacct="" cor_cd="71" resource_type="117 - Regular Labor"        tos="" task_midpoint_date="08/31/2003" pre_escalate_sw="Y" amt="4218.80" bld_cd="E" cost_cd="D9T97" trav_type="" resource_category="Labor"/>

              <acctg_tran units="56" cost_bypass_sw="N" change_sw="N" id="7" emplid="" parent_id="6" fy="2003" alc_grp_id="" rcvr_subacct="6378" cost_sheet_no="6378" revision_no="0" rcvr_acct="25110" toe="233" sndr_acct="" sndr_subacct="" cor_cd="71" resource_type="Acquisition Service Charge" tos="" task_midpoint_date="08/31/2003" pre_escalate_sw="Y" amt="250"     bld_cd="E" cost_cd="D9T97" trav_type="" resource_category="Materials"/>

              </acctg_trans>
              <alcs>
              <alc alc_grp_id="" rcvr_subacct="6378" cost_sheet_no="6378" revision_no="0" alc_toe="980" rate="12.00" subacct_ovr="" wp_no_ovr=""/>

              </alcs>
            </rate_estimator_trans>
            </sXML>
           </BurdenTransaction>
          </SOAP-ENV:Body>
        </SOAP-ENV:Envelope>
      ***************************************
      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>
                <soap:Fault>
                  <faultcode>soap:Client</faultcode>
                  <faultstring>Server was unable to read request.
                               --&gt; There is an error in XML document (2, 3). --&gt;
                               'Element' is an invalid node type. Line 2, position 3.
                  </faultstring>
                  <detail />
                </soap:Fault>
              </soap:Body>
      </soap:Envelope>

    Your message has been successfully submitted and would be delivered to recipients shortly.