# WSDL Interface to EPO (European Patent Office)

**URL:** <https://www.ruby-forum.com/t/wsdl-interface-to-epo-european-patent-office/185107>\
**Category:** Ruby\
**Created:** [March 13, 2010, 8:44pm UTC](https://www.ruby-forum.com/t/wsdl-interface-to-epo-european-patent-office/185107 "2010-03-13T20:44:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![worldfox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/e480ec/32.png) [@worldfox](https://www.ruby-forum.com/u/worldfox)\
**Post date:** [March 13, 2010, 8:44pm UTC](https://www.ruby-forum.com/t/wsdl-interface-to-epo-european-patent-office/185107/1 "2010-03-13T20:44:52Z")

</div>

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](http://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::ParseException) 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

---

<div class="post-metadata">

**Author:** ![worldfox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/e480ec/32.png) [@worldfox](https://www.ruby-forum.com/u/worldfox)\
**Post date:** [March 16, 2010, 8:33pm UTC](https://www.ruby-forum.com/t/wsdl-interface-to-epo-european-patent-office/185107/2 "2010-03-16T20:33:26Z")

</div>

Axel Fuchs wrote:

> 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](http://www.ops.epo.org/patents/patent-information/free/open-patent-services.html)).

$ curl -v  
[http://www.ops.epo.org/patents/patent-information/free/open-patent-services.html](http://www.ops.epo.org/patents/patent-information/free/open-patent-services.html)

- getaddrinfo(3) failed for [www.ops.epo.org:80](http://www.ops.epo.org:80)
- Couldn’t resolve host ‘[www.ops.epo.org](http://www.ops.epo.org)’
- Closing connection #0  
curl: (6) Couldn’t resolve host ‘[www.ops.epo.org](http://www.ops.epo.org)’

$ dig [www.ops.epo.org](http://www.ops.epo.org). a  
…  
;; -\>\>HEADER\<\<- opcode: QUERY, status: NXDOMAIN,

So it looks like that link is bad (authoritative non-existent domain  
answer)

> Here is the code I wrote:

I suggest you follow the steps on the other thread:

- ensure you’re using the gem soap4r, not the bundled one  
require ‘rubygems’  
gem ‘soap4r’  
require ‘soap/wsdlDriver’

- build interface classes using wsdl2ruby.rb

- get a wiredump

> Questions: How do I access the elements in result?

- run it in irb and use inspection to look at the available methods

> 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  
> ([Namespaces in XML 1.0 (Third Edition)](http://www.w3.org/TR/REC-xml-names/#ns-decl)) (REXML::ParseException)

This suggests they’re sending back invalid XML or that the WSDL has  
invalid XML, but we’d need to see a wiredump exchange and/or the WSDL.

---

<div class="post-metadata">

**Author:** ![worldfox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/e480ec/32.png) [@worldfox](https://www.ruby-forum.com/u/worldfox)\
**Post date:** [March 16, 2010, 9:28pm UTC](https://www.ruby-forum.com/t/wsdl-interface-to-epo-european-patent-office/185107/3 "2010-03-16T21:28:32Z")

</div>

Brian C. wrote:

> $ dig [www.ops.epo.org](http://www.ops.epo.org). a  
> …  
> ;; -\>\>HEADER\<\<- opcode: QUERY, status: NXDOMAIN,
> 
> So it looks like that link is bad (authoritative non-existent domain  
> answer)

It looks like the correct domain is [ops.epo.org](http://ops.epo.org), not [www.ops.epo.org](http://www.ops.epo.org).

The path you gave gives a 404 error. The error page contains a link to  
the WSDL at  
[http://ops.epo.org/patents/patent-information/free/wsdl/ops.wsdl](http://ops.epo.org/patents/patent-information/free/wsdl/ops.wsdl) but  
that also gives a 404 error.

But I found another link to this:  
[http://ops.epo.org/wsdl/ops.wsdl](http://ops.epo.org/wsdl/ops.wsdl)

wsdl2ruby.rb says that it doesn’t like the wsdl, with the same error you  
gave. It seems it doesn’t like:

\<xsd:import namespace=“[http://ops.epo.org](http://ops.epo.org)”  
schemaLocation=“[http://ops.epo.org//schema/ops.xsd](http://ops.epo.org//schema/ops.xsd)”/\>

If you fetch this xsd you see that it imports two more xsd’s, and these  
include these declarations:

xmlns:xml=“[The "xml:" Namespace](http://www.w3.org/XML/1998/namespace)”

I believe this is what it’s objecting to. You can fix these by making  
them relative links. Try the attached for size.
