A
Axel Fuchs
Hi,
I am trying to do patent searches accessing the webservice at the
European patent office
(www.ops.epo.org/patents/patent-information/free/open-patent-services.html).
Here is the code I wrote:
____________________________________________________________
#step 1: SOAP method and parameters
require 'soap/wsdlDriver'
wsdl = 'ops.wsdl'
driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
#step 2: SOAP request and response
XSD::Charset.encoding = 'UTF8'
my_query = 'ti=green and ti=plant'
result = driver.biblio-search(my_query,1,3)
________________________________________________
Questions: How do I access the elements in result?
What do I do about this error message:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/parsers/baseparser.rb:371:in
`pull': The 'xml' prefix must not be bound to any other namespace
(http://www.w3.org/TR/REC-xml-names/#ns-decl) (REXML:arseException)
Line:
Position:
Last 80 unconsumed characters:
<import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http:/
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/parsers/baseparser.rb:365:in
`each'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/parsers/baseparser.rb:365:in
`pull'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/parsers/streamparser.rb:16:in
`parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/document.rb:201:in
`parse_stream'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/xsd/xmlparser/rexmlparser.rb:27:in
`do_parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:63:in
`parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:42:in
`parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:30:in
`import'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:19:in
`import'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/import.rb:59:in
`import'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/import.rb:47:in
`parse_attr'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:144:in
`decode_tag'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:137:in
`each'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:137:in
`decode_tag'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:82:in
`start_element'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/xsd/xmlparser/parser.rb:67:in
`start_element'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/xsd/xmlparser/rexmlparser.rb:34:in
`tag_start'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/parsers/streamparser.rb:24:in
`parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/document.rb:201:in
`parse_stream'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/xsd/xmlparser/rexmlparser.rb:27:in
`do_parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:63:in
`parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:42:in
`parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:30:in
`import'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:19:in
`import'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/import.rb:59:in
`import'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/import.rb:47:in
`parse_attr'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/parser.rb:143:in
`decode_tag'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/parser.rb:139:in
`each'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/parser.rb:139:in
`decode_tag'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/parser.rb:84:in
`start_element'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/xsd/xmlparser/parser.rb:67:in
`start_element'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/xsd/xmlparser/rexmlparser.rb:34:in
`tag_start'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/parsers/streamparser.rb:24:in
`parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/document.rb:201:in
`parse_stream'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/xsd/xmlparser/rexmlparser.rb:27:in
`do_parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/parser.rb:65:in
`parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/importer.rb:29:in
`parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:30:in
`import'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/importer.rb:18:in
`import'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/soap/wsdlDriver.rb:124:in
`import'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/soap/wsdlDriver.rb:28:in
`initialize'
from ./patent_get.rb:7:in `new'
from ./patent_get.rb:7
I am trying to do patent searches accessing the webservice at the
European patent office
(www.ops.epo.org/patents/patent-information/free/open-patent-services.html).
Here is the code I wrote:
____________________________________________________________
#step 1: SOAP method and parameters
require 'soap/wsdlDriver'
wsdl = 'ops.wsdl'
driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
#step 2: SOAP request and response
XSD::Charset.encoding = 'UTF8'
my_query = 'ti=green and ti=plant'
result = driver.biblio-search(my_query,1,3)
________________________________________________
Questions: How do I access the elements in result?
What do I do about this error message:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/parsers/baseparser.rb:371:in
`pull': The 'xml' prefix must not be bound to any other namespace
(http://www.w3.org/TR/REC-xml-names/#ns-decl) (REXML:arseException)
Line:
Position:
Last 80 unconsumed characters:
<import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http:/
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/parsers/baseparser.rb:365:in
`each'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/parsers/baseparser.rb:365:in
`pull'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/parsers/streamparser.rb:16:in
`parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/document.rb:201:in
`parse_stream'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/xsd/xmlparser/rexmlparser.rb:27:in
`do_parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:63:in
`parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:42:in
`parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:30:in
`import'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:19:in
`import'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/import.rb:59:in
`import'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/import.rb:47:in
`parse_attr'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:144:in
`decode_tag'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:137:in
`each'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:137:in
`decode_tag'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:82:in
`start_element'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/xsd/xmlparser/parser.rb:67:in
`start_element'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/xsd/xmlparser/rexmlparser.rb:34:in
`tag_start'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/parsers/streamparser.rb:24:in
`parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/document.rb:201:in
`parse_stream'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/xsd/xmlparser/rexmlparser.rb:27:in
`do_parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:63:in
`parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:42:in
`parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:30:in
`import'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:19:in
`import'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/import.rb:59:in
`import'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/import.rb:47:in
`parse_attr'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/parser.rb:143:in
`decode_tag'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/parser.rb:139:in
`each'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/parser.rb:139:in
`decode_tag'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/parser.rb:84:in
`start_element'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/xsd/xmlparser/parser.rb:67:in
`start_element'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/xsd/xmlparser/rexmlparser.rb:34:in
`tag_start'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/parsers/streamparser.rb:24:in
`parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/document.rb:201:in
`parse_stream'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/xsd/xmlparser/rexmlparser.rb:27:in
`do_parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/parser.rb:65:in
`parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/importer.rb:29:in
`parse'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:30:in
`import'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/wsdl/importer.rb:18:in
`import'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/soap/wsdlDriver.rb:124:in
`import'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/soap/wsdlDriver.rb:28:in
`initialize'
from ./patent_get.rb:7:in `new'
from ./patent_get.rb:7