I received a message faultstring="org.xml.sax.SAXParseException: Content is not allowed in prolog". But my xml is correctly formated.
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="<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="<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="<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="<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
1 answer
You need to omit the Array and I removed xmlns:reactome from the envelope. Try this:
<SOAP-ENV:Envelope xmlns:xsi="<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>
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.
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.
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/?
Output of curl when invoked with "soap.xml" as given in the answer: http://pastebin.com/T1df9APh
Yes ! I don't know what I did wrong with your xml the first time :-) Thanks !
Log in to answer this question.
People still use SOAP in 2011! http://royal.pingdom.com/2010/10/15/rest-in-peace-soap/
@Casbon: is there a REST API for reactome ?
Sorry, was just a throwaway my tech is better than your tech remark. This looks like your options http://www.reactome.org/download/
Hi, Pierre. You might take a look at the biomart API for reactome. The web version is here.
@Casbon, sorry but are you sure you know what you are talking about??