I want to access an online program via the command line within a bash script. I've been told I can run a SOAP request in order to access the software. This is the request I've been told I can use.
POST /OnlineAnalysis/Service.asmx HTTP/1.1
Host: cydas.org
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.cydas.org/OnlineAnalysis/analyseKaryotype"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<analyseKaryotype xmlns="http://www.cydas.org/OnlineAnalysis/">
<strKaryotype>string</strKaryotype>
</analyseKaryotype>
</soap:Body>
</soap:Envelope>
I've never run a SOAP request before but it looks like I'm able to use the curl command based on this question. I've tried to model my curl command according to the link I posted
curl -X POST -H "POST /OnlineAnalysis/Service.asmx HTTP/1.1" -H "Content-Type: text/xml; charset=utf-8" -H "SOAPAction: \"http://www.cydas.org/OnlineAnalysis/analyseKaryotype\"" -H "Host: cydas.org" --data-binary #request.xml
And am getting this output
<HTML>
<HEAD>
<TITLE>405 Method Not Allowed</TITLE>
<BASE href="/error_docs/"><!--[if lte IE 6]></BASE><![endif]-->
</HEAD>
<BODY>
<H1>Method Not Allowed</H1>
The HTTP verb used to access this page is not allowed.<P>
<HR>
<ADDRESS>
Web Server at cydas.org
</ADDRESS>
</BODY>
</HTML>
<!--
- Unfortunately, Microsoft has added a clever new
- "feature" to Internet Explorer. If the text of
...
These are the contents of my request.xml file below
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<analyseKaryotype xmlns="http://www.cydas.org/OnlineAnalysis/">
<strKaryotype>46,XX,del(3)(p11)</strKaryotype>
</analyseKaryotype>
</soap:Body>
</soap:Envelope>
I'm not sure what the expected output is supposed to be yet because I can't run the program. I just want to get my SOAP request running properly.
try this:
curl -v "http://www.cydas.org/OnlineAnalysis/Service.asmx" -H "Content-Type: text/xml;charset=UTF-8" -H "SOAPAction: \"http://www.cydas.org/OnlineAnalysis/analyseKaryotype\"" -H "Connection: Keep-Alive" -H "Host: www.cydas.org" --data #request.xml
The server responded with the message: "The Karyotype del(3)(p11) is not valid:
Non-specified error in chromosome count element (del(3)(p11))"
Here's the complete response message:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<analyseKaryotypeResponse xmlns="http://www.cydas.org/OnlineAnalysis/">
<analyseKaryotypeResult>
<Original_ISCN_Formula>del(3)(p11)</Original_ISCN_Formula>
<IsPolyClonal>false</IsPolyClonal>
<IsValidKaryotype>false</IsValidKaryotype>
<Corrected_ISCN_Formula/>
<CloneSize>0</CloneSize>
<IsIncompleteKaryotype>false</IsIncompleteKaryotype>
<Ploidy>0</Ploidy>
<ErrorMessages>The Karyotype del(3)(p11) is not valid:
Non-specified error in chromosome count element (del(3)(p11))</ErrorMessages>
</analyseKaryotypeResult>
</analyseKaryotypeResponse>
</soap:Body>
</soap:Envelope>
cURL is a great tool, but if you want a nice gui you can try other tools like SoapUI or Postman for testing APIs. SoapUI is a standalone Java application and Postman is a plugin for Chrome. They're both free.
Related
I am new to postman and am given what I believe is a postman export. I can manually add these fields into postman but is there a quicker way to import into postman? I tried to import in postman via raw text, but unrecognized format.
POST /WebService/WebService.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
Host: dev.helloworld.com
User-Agent: PostmanRuntime/7.28.4
Accept: */*
Postman-Token: f62e3cd8-91c0-4238-844c-592aeb19e0a3
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 596
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<sDatabaseName>Apples</sDatabaseName>
</soap:Body>
</soap:Envelope>
That doesn't look like a Postman export.
That looks like a (raw) console log output.
A Postman export would be in JSON format.
The information you have would need to be input manually as you have described.
However, once it has been input, you could then export the collection you create (in JSON format) and you would have a copy that you can then re-import whenever you need to.
Alternatively, if you have the cURL command you could import that as raw text.
I am experiencing an error calling WSO2 API Manager v2.1.0 Admin Services via soapUI. It seems that the requests that are changing state in API Manager like this one, addRole, are failing. Note that "read only" style requests like listAllUsers or getAllRolesNames are succeeding.
Here is the raw request from soapUI:
POST https://localhost:9443/services/UserAdmin.UserAdminHttpsSoap11Endpoint HTTP/1.1
Accept-Encoding: gzip,deflate
SOAPAction: "urn:addRole"
Authorization: Basic YWRtaW46YWRtaW4=
Content-Type: application/soap+xml
Content-Length: 283
Host: localhost:9443
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://org.apache.axis2/xsd">
<soapenv:Header/>
<soapenv:Body>
<xsd:addRole>
<xsd:roleName>test_role</xsd:roleName>
</xsd:addRole>
</soapenv:Body>
</soapenv:Envelope>
Here is the response form soapUI:
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Action>http://www.w3.org/2005/08/addressing/soap/fault</wsa:Action>
</soapenv:Header>
<soapenv:Body>
<soapenv:Fault>
<soapenv:Code>
<soapenv:Value>soapenv:VersionMismatch</soapenv:Value>
</soapenv:Code>
<soapenv:Reason>
<soapenv:Text xml:lang="en-US">Transport level information does not match with SOAP Message namespace URI</soapenv:Text>
</soapenv:Reason>
<soapenv:Detail/>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Here is the log entry that appears in wso2carbon.log:
[2017-03-03 16:23:03,474] ERROR - ResponseTimeCalculator wso2statistics.request.received.time is null in the IN MessageContext
Any help is greatly appreciated.
Thanks!
Looks like your request is a SOAP 1.1.
In that case, the Content-Type of the request should be text/xml, not application/soap+xml.
If that doesn't work, try using RemoteUserStoreManagerService instead of UserAdmin.
I am New to BlackBerry development using Momentics. Now I want to send one object to SOAP request.
Here is my web service:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Login xmlns="http://shidhints.com/">
<MyLoginCredentials>
<Email>string</Email>
<Password>string</Password>
</MyLoginCredentials>
</Login>
</soap:Body>
</soap:Envelope>
Here is my C++ code:
m_soap.setAction("http://shidhints.com/Login");
m_soap.setHost("mobile.shidhints.com");
QtSoapMessage request;
request.setMethod(QtSoapQName("Login", "http://shidhints.com/"));
request.addMethodArgument("Email", "http://shidhints.com/", email);
request.addMethodArgument("Password", "http://shidhints.com/", password);
// Submit the method request to the web service.
m_soap.submitRequest(request, "http://shidhints.com/Service.asmx");
Now I am getting an error like:
Query failed: XML parse error
I have Resolved it Using the code,
QtSoapStruct *myStruct=new QtSoapStruct(QtSoapQName("MyLoginCredentials"));
myStruct->insert( new QtSoapSimpleType(QtSoapQName("Email"), email));
myStruct->insert( new QtSoapSimpleType(QtSoapQName("Password"),password));
request.addMethodArgument(myStruct);
all. I have next problem. I want to connect to mailbox with Impersonation rights. User Admin has Impersonation rights, and i know how to do it in C#.
I have next code:
ExchangeServiceBindingProxy *proxy = new ExchangeServiceBindingProxy(endpoint.c_str());
soap *pSoap = proxy->soap;
pSoap->userid = "Admin";
pSoap->passwd = "PASSWORD";
pSoap->ntlm_challenge = "";
pSoap->authrealm = "Ursa-Minor";
pSoap->ssl_flags = SOAP_SSL_NO_AUTHENTICATION;
pSoap->keep_alive = true;
soap_mode(pSoap,SOAP_IO_KEEPALIVE);
string smtp = "User1#no-such-email.com";
pSoap->header = new struct SOAP_ENV__Header();
pSoap->header->ns3__RequestServerVersion = new _ns3__RequestServerVersion();
pSoap->header->ns3__RequestServerVersion->Version = ns3__ExchangeVersionType__Exchange2007_USCORESP1;
if(!smtp.empty())
{
pSoap->header->ns3__ExchangeImpersonation = new ns3__ExchangeImpersonationType();
pSoap->header->ns3__ExchangeImpersonation->ConnectingSID = new ns3__ConnectingSIDType();
pSoap->header->ns3__ExchangeImpersonation->ConnectingSID->union_ConnectingSIDType.PrimarySmtpAddress = &smtp;
pSoap->header->ns3__ExchangeImpersonation->ConnectingSID->__union_ConnectingSIDType = 3;
}
As a resault i have this request:
POST /ews/Exchange.asmx HTTP/1.1
Host: 192.168.0.49
User-Agent: gSOAP/2.8
Content-Type: text/xml; charset=utf-8
Content-Length: 1093
Connection: keep-alive
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAGoAAAAYABgAggAAABoAGgBAAAAACAAIAFoAAAAIAAgAYgAAAAAAAACaAAAABYKBAk4ATwAtAFMAVQBDAEgALQBFAE0AQQBJAEwASQB2AGEAbgBJAHYAYQBuAKEcAIkJWxEWBsuOv7MjtBpHLDWAL8JCTJ28+8Uotrb6QFrMa88HavXFTG1ddTR1VQ==
SOAPAction: "http://schemas.microsoft.com/exchange/services/2006/messages/GetFolder"
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns3="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ns1="http://schemas.microsoft.com/exchange/services/2006/messages">
<SOAP-ENV:Header>
<ns3:ExchangeImpersonation SOAP-ENV:mustUnderstand="1">
<ns3:ConnectingSID>
<ns3:PrimarySmtpAddress>User1#no-such-email.com</ns3:PrimarySmtpAddress>
</ns3:ConnectingSID>
</ns3:ExchangeImpersonation>
<ns3:RequestServerVersion SOAP-ENV:mustUnderstand="1" Version="Exchange2007_SP1"></ns3:RequestServerVersion></SOAP-ENV:Header><SOAP-ENV:Body><ns1:GetFolder xsi:type="ns1:GetFolderType"><ns1:FolderShape><ns3:BaseShape>AllProperties</ns3:BaseShape></ns1:FolderShape><ns1:FolderIds><ns3:DistinguishedFolderId Id="msgfolderroot" xsi:type="ns3:DistinguishedFolderIdType"></ns3:DistinguishedFolderId></ns1:FolderIds></ns1:GetFolder></SOAP-ENV:Body>
</SOAP-ENV:Envelope>
It seems legit, but server response return error:
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/exchange/services/2006/types">a:ErrorInternalServerError</faultcode>
<faultstring xml:lang="en-US">An internal server error occurred. The operation failed.</faultstring>
<detail>
<e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorInternalServerError</e:ResponseCode>
<e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">An internal server error occurred. The operation failed.</e:Message>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
ns3:ExchangeImpersonation> !!! THERE IS SOMETHING WRONG
<ns3:RequestServerVersion SOAP-ENV:mustUnderstand="1" Version="Exchange2007_SP1"></ns3:RequestServerVersion>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:GetFolder xsi:type="ns1:GetFolderType">
<ns1:FolderShape><ns3:BaseShape>AllProperties</ns3:BaseShape></ns1:FolderShape>
<ns1:FolderIds>
<ns3:DistinguishedFolderId Id="msgfolderroot" xsi:type="ns3:DistinguishedFolderIdType"></ns3:DistinguishedFolderId>
</ns1:FolderIds>
</ns1:GetFolder>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Response even doesn`t have well formed xml.
Well, i don`t know how to solve this problem at this moment.
To remove the mustunderstand attribute from the wsdl2h-generated source code declarations that produces the SOAP Header, use wsdl2h option -k.
This is an old question, but I had a little update on it: To those that may be experiencing issues with mustunderstand appearing due to using some gsoap plugin (for me it was with the wsse plugin, I know mustunderstand is part of that standard, but the service I am calling does not)
Anyway, to solve this I edited the header files in gsoap/import to remove the mustunderstand parts. This stopped the wsse header having mustunderstand included.
(Note: this question was cross-posted on Biostar)
Hi all,
I'm trying to send a RPC-encoded SOAP query to Reactome (a biological pathways database), 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
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:xsi="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, whereas I expected a result.
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="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="http://www.reactome.org:8080/caBIOWebApp/services/caBIOService" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<queryPathwaysForReferenceIdentifiersReturn xmlns:ns2="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
the question was answered on Biostar: http://biostar.stackexchange.com/questions/5511