Biostar Beta. Not for public use.
Error With Kegg Api Sample Code For Python
1
Entering edit mode
2.5 years ago
JRCX • 10

Hello!

I'm new in programming, coming from Engineering background. When trying to run KEGG APi sample code for Python in Pycharm (first do pip install SOAPpy)

#!/usr/bin/env python

from SOAPpy import WSDL

wsdl = 'http://soap.genome.jp/KEGG.wsdl'
serv = WSDL.Proxy(wsdl)

results = serv.get_genes_by_pathway('path:eco00020')
print results

I get the following error on the line serv = WSDL.Proxy(wsdl):

Traceback (most recent call last):
File "<console>", line 1, in <module>
  File "C:\Python27\lib\site-packages\SOAPpy\WSDL.py", line 85, in __init__
    self.wsdl = reader.loadFromString(str(wsdlsource))

  File "C:\Python27\lib\site-packages\wstools\WSDLTools.py", line 47, in loadFromString
    return self.loadFromStream(StringIO(data))

  File "C:\Python27\lib\site-packages\wstools\WSDLTools.py", line 28, in loadFromStream
    document = DOM.loadDocument(stream)

  File "C:\Python27\lib\site-packages\wstools\Utility.py", line 645, in loadDocument
    return xml.dom.minidom.parse(data)

  File "C:\Python27\lib\xml\dom\minidom.py", line 1914, in parse
    return expatbuilder.parse(file)

  File "C:\Python27\lib\xml\dom\expatbuilder.py", line 928, in parse
    result = builder.parseFile(file)

  File "C:\Python27\lib\xml\dom\expatbuilder.py", line 207, in parseFile
    parser.Parse(buffer, 0)

ExpatError: not well-formed (invalid token): line 1, column 5

Can someone please help me with it? Thanks in advance.

python • 2.8k views
ADD COMMENTlink
0
Entering edit mode

I can confirm that I get the same error. I'm looking into it to see if I can find a solution, but maybe file a bug already with KEGG?

ADD REPLYlink
4
Entering edit mode
13 months ago
France/Nantes/Institut du Thorax - INSE…

It's not a programming problem: the URL of the WSDL ( http://soap.genome.jp/KEGG.wsdl ) seems wrong from here :

Access forbidden! (403)

see also: http://www.genome.jp/kegg/soap/

The current SOAP-based API service has not been updated for five years (see ChangeLog) and has become obsolete in certain aspects. Because the original developer is no longer with us at KEGG, we have decided to move to the new service with a much simpler design. The old service will continue to be accessible for six months, until December 31, 2012.

ADD COMMENTlink
0
Entering edit mode
12 months ago
Leandro Lima • 920
San Francisco, CA

Well... just to help.

www.vision.ime.usp.br/~llima/KEGG.wsdl

Please download. If you want, it's possible to do it with a local file.

serv = WSDL.Proxy('KEGG.wsdl')

ADD COMMENTlink
1
Entering edit mode

Dear Joana, use it only if you're in a hurry. But I recommend you to do like Pierre said (using REST).

ADD REPLYlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.1