Retrieve SOAP Request Valid from XSD - soap

I have this kind of "guidelines" to call a SOAP service:
URL: http://80.211.113.172:8080/soap
No WSDL at all!
The XSD for request:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="/soap_serv" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAPENC="http://schemas.xmlsoap.org/soap/encoding/" SOAPENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:TRACKING>
<ldv xsi:type="xsd:string">2020.00.0070423</ldv>
<codcli xsi:nil="true"/>
<rifcli xsi:nil="true"/>
<anno_bl xsi:nil="true"/>
</ns1:TRACKING>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Does anyone know how to create a request object to send with SoapUI?

The XML you are showing isn't an XML Schema (or XSD file). As pointed out in the comment by #kimbert, that is actually an SOAP XML message. The payload inside it is what an XML instance of an XSD schema would be.
You have two options:
ask for a WSDL for the web service so that you can generate some client code to help you with the calls.
if a WSDL is not available, ask for better documentation for how to call the service. Not sure where you got that example but is the operation name TRACKING? Is the ns1 prefix pointing to the correct namespace? Should the elements inside the TRACKING element also be in this namespace? Note also that you are using codcli and rifcli in your call, when that guideline shows cod_cli and rif_cli. You most likely also need to send values for your elements, not have them null like that.
Not having a WSDL or valid up to date documentation for how the exchanged messages should look like will make things very difficult for you in interacting with the web service.

Related

Using Insomnia To Make Soap Calls

I am trying to use Insomnia to make soap calls - specifically trying to get post to succeed. I defined the URL as the end point and put the body type as XML with the SOAP contents (envelope, header, body). I defined the user id and password in the header. When I run I get 415 Unsupported Media Type. I can't really paste the soap contents because of all of the URL addressing in the envelope. I am using Insomnia to succeed in doing the REST call to get my information (for some crazy reason the gets are REST but the posts are SOAP) but can't get the insert to work. Is there something special I need, or does Insomnia not support SOAP post transactions? I googled and it appears in 2018 this was added. I don't have the WSDL available.
I appreciate this is not giving lots of information so guidance on what more I may provide to get assistance will also be helpful. Has anyone succeeded in using Insomnia to make SOAP calls?
All that was needed for me to make it work was:
Request method: POST.
Setting the Content-Type header to text/xml; charset=utf-8 (application/xml gave me the 415 response).
Wrapping request body in proper SOAP envelope.
You should be able to call GET on YourHandler.asmx to look up envelopes for requests you want to use. Envelope should look somewhat like this:
<?xml version="1.0" encoding="utf-8"?>
<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>
<HelloWorld xmlns="http://tempuri.org/">
<foo>
<Id>1</Id>
<Name>Bar</Name>
</foo>
</HelloWorld>
</soap:Body>
</soap:Envelope>
Credits for the guidance and envelope sample goes to this answer.
You can import the WSDL file, so that all methods, headers etc. will be created automatically. Click on:
Go to dashboard
Click Create
Choose URL (under import from)
Paste the WSDL URL and click Fetch and Import
As an example you can use the following URL: http://www.dneonline.com/calculator.asmx?wsdl
You will get this:
The problem as of writing this answer is, that there are two bugs:
Not all WSDL URLs are getting imported correctly (e.g. this one works in SOAP UI, but not in Insomnia http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL)
The methods are getting imported, but they don't work
You can submit and issue on Github, so that this is getting fixed: https://github.com/Kong/insomnia

Why do i get "Wrong API base URL used" when pinging Adobe EchoSign Cloud by a SOAP request?

I am trying to access signed documents within the Adobe EchoSign Cloud. I have got an API key for authentication and used it in a testPing SOAP request like
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:api="http://api.echosign">
<soapenv:Header/>
<soapenv:Body>
<api:testPing>
<api:apiKey>myKeyhere</api:apiKey>
</api:testPing>
</soapenv:Body>
</soapenv:Envelope>
I sent this request to
https://secure.echosign.com/services/EchoSignDocumentService22
But as a result I only get
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Wrong API base URL used</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
What does that message mean?
I suspect Cross-Domain but you should test it with fiddler. It reports you more clean data with your problem.
I found an important note in the Adobe documentation:
However, starting from version 22 of the Document API, all API calls must be made on a specific base URL obtained either using the OAuth workflow (the api_access_point parameter that is included with an authorization code) or by making a call to the getBaseUris method. The corresponding gateway can then be constructed by concatenating the base URL with "services/EchoSignDocumentService22". Calls made on the wrong base URL will result in an exception indicating that the wrong API base URL was used. Note that getBaseUris itself can be called on any appropriate gateway, including the one mentioned above.
Calling getBaseUris indeed returns another URI which then can be used for subsequent requests.

Using JMeter SOAP/XML-RPC Request to call ChemSpell Web Service

I'm trying to test the web service api for a free service called ChemSpell. I am trying to use JMeter's SOAP/XML-RPC Request option to test it. I am a bit new at this and not sure what to enter in. The call expects two parameters, which for testing purposes I want to set to the following:
Name = "formeldehyde"
Source = "All databases"
Based on their site I'm putting "http://chemspell.nlm.nih.gov:80/axis/SpellAid.jws" for the URL and "http://chemspell.nlm.nih.gov" in Send SOAPAction. I'm not sure how to configure the "Soap/XML-RPC Data" portion. I'm thinking the WSDL file they provide should give me everything I need to configure that section, but I'm not exactly sure how. Any help is much appreciated!
You need to create the xml that will be sent to the webservice, based on the wsdl, and paste it in the SOAP/XML-RPC data field.
The xml will describe the method call you wish to make and the data you wish to pass to it.
It will look like this (you will need to replace ? with data):
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:spel="http://chemspell.nlm.nih.gov/axis/SpellAid.jws/axis/SpellAid.jws">
<soapenv:Header/>
<soapenv:Body>
<spel:getSugList soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<name xsi:type="xsd:string">?</name>
<src xsi:type="xsd:string">?</src>
</spel:getSugList>
</soapenv:Body>
</soapenv:Envelope>
The easiest way to generate blank requests like the above is using SOAP UI. You just give the wsdl URL and it generates all possible requests for you. I copy and paste these over to JMeter.

How to send image data and other parameter using SOAP web service

I want to send image data over soap web service. My soap message as per mention 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>
<TestFile xmlns="http://tempuri.org/">
<userID>int</userID>
<FileTitle>string</FileTitle>
<FileName>string</FileName>
<BufferFile>base64Binary</BufferFile>
<languageID>int</languageID>
</TestFile>
</soap:Body>
</soap:Envelope>
and i want to add image over bufferFile with base64 encoding.
Give me any suggestion or sample code that can send maltipart data or parameters at same time.
Thanks.
Try to use SudzC, which will generate client code for iOS, to communicate with your WebService. In your case, it will generate a method, with parameters you need to pass. All you need to have is a WSDL.

Accesing the value returned from web service called through soap in iphone

I was working with SOAP to access web service. my question is how to retrieve the value returned from web service
This is my SOAP response
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?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>
<fnPartyQuestionsPathResponse xmlns="http://QIA/">
<fnPartyQuestionsPathResult>string</fnPartyQuestionsPathResult>
</fnPartyQuestionsPathResponse>
</soap:Body>
</soap:Envelope>
THanks in advance..
wsdl2objc is always worth a look when working with SOAP. It will auto-generate a whole series of classes and objects from your WSDL file (assuming you have access to it) and that makes accessing the data really easy. I've used it on some live projects and find it does what it says on the tin.
You could try using the SudzC library to generate accessor code for your SOAP service, and work with that. I find that it's pretty simple and robust for usage.