sudzc soap client deserialization error - ios

I'm using sudzc soap client in an iOS app.
Here is soap method declaration
(SoapRequest*) UploadData: (myid <SoapDelegate>) handler myid: (NSString*) myid props: (NSString*) props
For example, if i pass string "<test>" in the second parameter, i get following error:
a:DeserializationFailed The formatter threw an exception while trying
to deserialize the message: Error in deserializing body of request
message for operation 'UploadData'. End element 'props' from namespace
'http://tempuri.org/' expected. Found element 'test' from namespace
'http://tempuri.org/'. Line 1, position 338.
Why can't sudzc handle "<" or ">" characters in string parameter? Do i have to manually escape these characters?

I don't think this error is related to iOS or sudzc generator. SOAP uses XML for data transfer, so you have to encode any special characters according to XML spec. See the following answer.

Related

iOS SDK SOAP parsing error : Data at the root level is invalid. Line 1, position 1

I am developing an iPhone app. I have to get data from .NET server. The response is in the following form.
<string xmlns="http://tempuri.org/">
{"success":1,"message":"Data Save Successfully.","returnvalue":"106"}
</string>
I am using NSXMLParser to parse to parse it. I want to get the json string . But the parser is giving error
Server was unable to process request. ---> Data at the root level is invalid. Line 1, position 1.
How can i fix the error.
Thanks in advance
The String in the respons is a JSON, So i think the NSXMLParser don't work with a JSON input. The parsing error is because the syntax of XML is different then from JSON.
This link will help you to read the String JSON response you get.
how to parse json with swift2

SOAP input STRING - xml format - WSDL TEST

I have a SOAP Web Service with 3 string parameters in input (user,psw,strXml).the content of my strXml is a xml string format.
I do this following test :
I have this error :
but if I test it with postman, it's OK but need the balise CDATA :
How I can test my WS in the first method (with the form generating by soap environment)???
thanks
Ah, I found the solution
I use the CustomRequestValidator and it's OK
ref : Web service does not accept input
thanks

How to make jmeter convert |(pipe) to %7C automatically?

I am getting following error whenever Jmeter gets a | (pipe) symbol in the URL since the "pipe" symbol is not allowed in URL. Is there any way to convert the |(pipes) in URL to %7C automatically?
Response code: Non HTTP response code: java.net.URISyntaxException
Assuming the pipe is in an existing parameter try the following:
Check "Encode?" box in "Send Parameters with the Request" input of HTTP Request
Wrap your variable in __urlEncode function as ${__urlencode(queryTerm)}
Use Beanshell Pre Processor as a child of HTTP Request with the following code:
vars.put("queryTerm", URLEncoder.encode(vars.get("queryTerm")));
This should convert the pipes automatically.
Got the instructions from here: Jmeter - Configure Keywords with spaces using CSV File Configuration

RestResponse is null on POST request using RestSharp

I am making a POST request with RestSharp (on windows phone 7.1 client). I sent string to a service in a request body. Looks like the service is successfully called and it returns proper value (integer), however response object is null:
client.ExecuteAsync<T>(request, (response) => {
data = response.Data; // response is null in debugger
});
I cant understand why is that so.
<T> isn't a valid value for that call. I'm not sure that would even build there unless you've wrapped it in a generic method.
Also, is the response coming back as plain text? What's the Content-Type returned? Most likely, you should just use ExecuteAsync(request, callback) without the generic parameter and grab the data out of response.Content which is a string of the response body. response.Data is for the automatically deserialized XML or JSON (or custom) response if you use the generic method overload that specifies a type to deserialize to.
This seems to be an ongoing issue with RestSharp asynchronous calls - for HTTP transport errors ErrorException object is useless (returns null). Check the StatusCode property if it returns with anything but HttpStatusCode.OK. StatusDescription is not extremely useful either as it doesn't match complete status message from server response payload.

Parse JSON string to detect error response

i'm working with a server which response using the JSON format.
when the request contain valid data they respond with a string like this
{"data":{"results":[{"Branch":"ACCT590006"}]}}
but if the parameters of the request are incorrect the response goes like this
{"error":{"errors":[{"domain":"global","reason":"invalid","message":"Invalid
Params"}],"code":98865,"message":"Invalid
param value"}}
So the questions are how i can determine when the response of the server contains a error string using the TJSONObject object and additionally parse the JSON string to show the messages and error codes like this.
Failed reason : invalid
Message : Invalid params
Code: 98865
message : invalid param value.
I've worked a little with JSON, an every time I've parsed from code(delphi 7). But i've searched a little bit, and here you may find the answer of your question:
http://edn.embarcadero.com/print/40882
and with a little adaption this should work.
Best regards,
Radu

Resources