Accessing Reactome.Org Using Soap And Curl?
1
5
Entering edit mode
13.7 years ago

Hi all,

I'm trying to send a SOAP query to Reactome using curl.

I want to call the remote method queryPathwaysForReferenceIdentifiers defined in http://www.reactome.org:8080/caBIOWebApp/services/caBIOService?wsdl

I created the following SOAP/XML file: soap.xml


<SOAP-ENV:Envelope xmlns:xsi="&lt;a href=" http:="" www.w3.org="" 1999="" XMLSchema-instance"="" rel="nofollow">http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:r="http://www.reactome.org:8080/caBIOWebApp/services/caBIOService" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:reactome="http://www.reactome.org/caBIOWebApp/schema">
<SOAP-ENV:Body>
<r:queryPathwaysForReferenceIdentifiers>
<r:referenceIdentifiers>
<soapenc:Array soapenc:arrayType="soapenc:string[3]">
<soapenc:string>Q9Y266</soapenc:string>
<soapenc:string>P17480</soapenc:string>
<soapenc:string>P2048</soapenc:string>
</soapenc:Array>
</r:referenceIdentifiers>
</r:queryPathwaysForReferenceIdentifiers>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

and I sent it with curl using the following command:

curl -d @soap.xml \
      -H "Content-Type: application/soap+xml" \
      -H 'SOAPAction: ""' \
      "http://www.reactome.org:8080/caBIOWebApp/services/caBIOService"

But the response is empty:


<soapenv:Envelope xmlns:soapenv="&lt;a href=" http:="" schemas.xmlsoap.org="" soap="" envelope="" "="" rel="nofollow">http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
  <soapenv:Body>
    <ns1:queryPathwaysForReferenceIdentifiersResponse xmlns:ns1="&lt;a href=" http:="" www.reactome.org:8080="" caBIOWebApp="" services="" caBIOService"="" rel="nofollow">http://www.reactome.org:8080/caBIOWebApp/services/caBIOService" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <queryPathwaysForReferenceIdentifiersReturn xmlns:ns2="&lt;a href=" http:="" www.reactome.org="" caBIOWebApp="" schema"="" rel="nofollow">http://www.reactome.org/caBIOWebApp/schema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" soapenc:arrayType="ns2:Pathway[0]" xsi:type="soapenc:Array"/>
    </ns1:queryPathwaysForReferenceIdentifiersResponse>
  </soapenv:Body>
</soapenv:Envelope>

is there an error in my Request ? where ?

Many thanks !

Pierre

Note: cross-posted on Stack-Overflow http://stackoverflow.com/questions/4970668

webservice • 6.8k views
ADD COMMENT
2
Entering edit mode

@Casbon: is there a REST API for reactome ?

ADD REPLY
2
Entering edit mode

Hi, Pierre. You might take a look at the biomart API for reactome. The web version is here.

ADD REPLY
0
Entering edit mode
ADD REPLY
0
Entering edit mode

Sorry, was just a throwaway my tech is better than your tech remark. This looks like your options http://www.reactome.org/download/

ADD REPLY
0
Entering edit mode

@Casbon, sorry but are you sure you know what you are talking about??

ADD REPLY
3
Entering edit mode
13.6 years ago
Joachim ★ 2.9k

You need to omit the Array and I removed xmlns:reactome from the envelope. Try this:


<SOAP-ENV:Envelope xmlns:xsi="&lt;a href=" http:="" www.w3.org="" 1999="" XMLSchema-instance"="" rel="nofollow">http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:r="http://www.reactome.org:8080/caBIOWebApp/services/caBIOService" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<r:queryPathwaysForReferenceIdentifiers>
<r:referenceIdentifiers>
<soapenc:string>Q9Y266</soapenc:string>
<soapenc:string>P17480</soapenc:string>
<soapenc:string>P2048</soapenc:string>
</r:referenceIdentifiers>
</r:queryPathwaysForReferenceIdentifiers>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
ADD COMMENT
1
Entering edit mode

Output of curl when invoked with "soap.xml" as given in the answer: http://pastebin.com/T1df9APh

ADD REPLY
0
Entering edit mode

I received a message faultstring="org.xml.sax.SAXParseException: Content is not allowed in prolog". But my xml is correctly formated.

ADD REPLY
0
Entering edit mode

Hm. I just copied and pasted the XML into a file "soap.xml" and then ran the command you gave above. Works fine for me.

ADD REPLY
0
Entering edit mode

It definitely works with curl. I tried it under Linux with curl 7.15.5 and OSX with curl 7.19.7 and both return a result page.

As for the Java exception, I ran a modified example of http://www.java2s.com/Code/Java/XML/SAXDemo.htm on both "soap.xml" and the XML that was returned by curl and both did fine.

ADD REPLY
0
Entering edit mode

Joachim. Thanks. What's the content of the XML SOAP response ? can you copy-paste it in http://pastebin.com/ or https://gist.github.com/?

ADD REPLY
0
Entering edit mode

Yes ! I don't know what I did wrong with your xml the first time :-) Thanks !

ADD REPLY

Login before adding your answer.

Traffic: 1334 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6