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

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.

Related

set username and password to soap wsdl request in soap ui app

I have a soap wsdl webservice and I must use user name and password for my requset but I dont know where?
Actually the provider said that I must add this value as a property to my request,,
But now when I add these property to my request from the default property panel of soap ui it doesnt work correctly,,
below is my source code that I use in soap ui request panel
<soap:Envelope xmlns:bpm="http://test.co/" xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
</soap:Header>
<soap:Body>
<dpm:getTransactionById>
<bpm:referenceId>fgdfgdgfdfgdfgd</bpm:referenceId>
</dpm:getTransactionById>
</soap:Body>
</soap:Envelope>
is there a way for adding some parameter in header block of xml soap requset?
thanks a bunch
There are 2 solution for you to solve your problem,,
First solution:
you can add username and password in your soap xml request not only for password but also for time stamp(but it depend on your service provider) but in most cases this senario is true,so then after call the api another time
below is the sample code.
<soap:Envelope xmlns:bpm="http://xxxxxxx.co/" xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<wsse:Security soap:mustUnderstand="true" xmlns:wsse="http://xxxxxx.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://xxxxx.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsu:Timestamp wsu:Id="TS-xxxxx">
<wsu:Created>2023-01-04T08:04:26.709Z</wsu:Created>
<wsu:Expires>2023-01-04T08:05:26.709Z</wsu:Expires>
</wsu:Timestamp>
<wsse:UsernameToken wsu:Id="UsernameToken-xxxxxxxxxxxxxx">
<wsse:Username>xxxxxxxxxx</wsse:Username>
<wsse:Password Type="http://xxxxxx.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">xxxxxx</wsse:Password>
<wsse:Nonce EncodingType="http://xxxxxxx.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">xxxx</wsse:Nonce>
<wsu:Created>2023-01-04T08:02:55.404Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
<soap:Body>
<dpm:getTransactionById>
<bpm:referenceId>fgdfgdgfdfgdfgd</bpm:referenceId>
</dpm:getTransactionById>
</soap:Body>
</soap:Envelope>
you can see add user name password and time stamp to our request.
in second solution you can click right in soap ui app requset and choose
add wss username token and ws time stamp and set your configuration,
I hope the solution work for for you,,,
best regard..

Retrieve SOAP Request Valid from XSD

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.

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.

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.

how to receive object (on iphone side)returned by webservice?

in xcode i want to call webservice whose return value is object ?
1. what will be the SOAP message to call this web service ?
2. how xcode receive this object and use?
right now i have one method which return only string and i know how to call that by use of SOAP, but i dont know if it is change in case of object..
thank you in advance
Generally a webservice has to return any kind of standard XML.
If your webservice conforms strictly to SOAP it will return SOAP-XML message like:
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
</soap:Header>
<soap:Body>
<m:GetStockPrice xmlns:m="http://www.example.org/stock">
<m:StockName>IBM</m:StockName>
</m:GetStockPrice>
</soap:Body>
</soap:Envelope>
for more information see SOAP on Wikipedia
ok, i figure out, if array is returned from web service than i dont have to change my SOAP message