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

service XML response not parsed

Expand Messages
  • wanda_b_anon
    I get a response from a server that looks like good XML, but SOAP::Lite only provides it as a long string of XML rather than parsing it into a hash of
    Message 1 of 1 , Jan 10, 2006
    • 0 Attachment
      I get a response from a server that looks like good XML, but
      SOAP::Lite only provides it as a long string of XML rather than
      parsing it into a hash of entities, attributes, and values as I
      expected. Am I doing something wrong? Can I feed the string into a
      parser and get the hash I expect?

      Here is a response string and code to exercise the server.

      <WORLDPATENTDATA><BIBLIO Seed="US4000034"><SDOBI><B111EP
      DATE="19761228">US4000034</B111EP><B131EP>A</B131EP><B211EP
      DATE="19750815">US19750605093</B211EP><B311EP
      DATE="19750815">US19750605093</B311EP><B510
      TYPE="EPC">D21C11/06B2</B510><B510 TYPE="IPC">D21C11/06</B510><B510
      TYPE="CI">D21C11/00</B510><B510 TYPE="AI">D21C11/06</B510><B542
      TYPE="TI">Kraft mill recovery system</B542><B570EP>An improved process
      for the treatment, separation, and utilization of precipitator catch
      wherein treated precipitation catch is separated by countercurrent
      washing in a column.</B570EP><B711EP>HOOKER CHEMICALS PLASTICS
      CORP</B711EP><B721EP>PARTRIDGE HAROLD DEVERE;</B721EP><B721EP>FULLER
      WILLARD A</B721EP></SDOBI></BIBLIO></WORLDPATENTDATA>


      #!/usr/bin/perl
      use SOAP::Lite 'trace' , 'debug';
      print "SOAP::Lite VERSION: $SOAP::Lite::VERSION \n";

      # service described at http://ops.espacenet.com/
      my $wsdl =
      'http://ops.espacenet.com/OpenPatentServices/OpenPatentServices.wsdl';
      my $req_xml = '<OpenPatentServices ACTION="Biblio">'
      .'<WORLDPATENTDATA><BIBLIO SEED=" US '.' '.' '.' '.' '.
      '4000034A#" SEED_FORMAT="D" SEED_TYPE="PN"/>'.'
      </WORLDPATENTDATA></OpenPatentServices>';

      my $som = SOAP::Lite
      -> ns('urn:EPO-OpenPatentServices')
      -> proxy('http://ops.espacenet.com/OpenPatentServices/webService')
      -> getPatentData($req_xml);

      print "\n\nHere it comes:\n", $som->result(), "\n\n",
      ${${${$som->envelope()}{'Body'}}{'getPatentDataResponse'}}{'getPatentDataReturn'},
      "\n\n",
      ${${$som->body()}{'getPatentDataResponse'}}{'getPatentDataReturn'},
      "\n\n",$som->faultdetail(),
      "\n\n",%{$som->method()} ;
    Your message has been successfully submitted and would be delivered to recipients shortly.