SOAP input STRING - xml format - WSDL TEST - post

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

Related

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

SOAPUI REST url having + in JSON issue

I am using SOAPUI v4.6.4.
I am testing REST SOAPUI test. I have the media type set to application/json.
I am trying to pass this value as part of JSON string and I get 404 server error.
{"enteredTime":"2001-12-17T09:30:47+05:00"}
It is having issues with + sign.
I tried encoding it as 2001-12-17T09%3A30%3A47%2B05%3A00. The 404 server is gone but the application code is NOT expecting the encoded value.
Any solutions are highly appreciated.

sudzc soap client deserialization error

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.

How to read data from SOAP message with large XOP attachment using Spring WS and Axiom

I'm trying to build a web-service, which will receive large files and save them with the name specified in SOAP message.
Here is an example request message
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://mywebservice.com.ua/bait/schemas" xmlns:xm="http://www.w3.org/2005/05/xmlmime">
<soapenv:Header/>
<soapenv:Body>
<sch:SubmitProjectFileRequest>
<sch:ProjectName>MyADProject.xml</sch:ProjectName>
<sch:ProjectFile xm:contentType="text/text">cid:710420383131</sch:ProjectFile>
</sch:SubmitProjectFileRequest>
</soapenv:Body>
</soapenv:Envelope>
I've build some stuff already: I can receive large XOP files without OutOfMemoryError.
The problem is that I can't access ProjectName node of the request, as any attempts to get it lead to inlining of an attachment into request. And that itself leads to OutOfMemoryError
Here is the code which I currently use for that purpose
#PayloadRoot(localPart = SUBMIT_PROJECT_FILE_REQUEST, namespace = NAMESPACE_URI)
public void handleSubmitProjectFileRequest(SoapMessage message) throws Exception {
String projectName = getProjectName(message.getDocument());
Attachment attachment = message.getAttachments().next();
projectFileService.storeProjectFile(projectName, attachment.getDataHandler());
}
private String getProjectName(Document xml) throws XPathExpressionException {
String prefix = xml.lookupPrefix(NAMESPACE_URI);
NodeList names = xml.getElementsByTagName(String.format("%s:%s", prefix, "ProjectName"));
String projectName = names.item(0).getTextContent();
return projectName;
}
Could anyone help me to extract both large XOP attachment and ProjectName node content using Spring WS and Axiom?
Thanks in advance
From what I read (Sorry could only post 2 links total):
http://www.java.net/node/690763
markmail.org/message/utd5ineljlvvugse
And by the detailed definition of the MTOM method:
www.crosschecknet.com/intro_to_mtom.php
Although optimized for transport, the base64 encoded data that you attach to your message will still be unmarshalled and put back into the soap message before a basic handler (Like SOAPHandler for example) gets ahold of it. This seems to be a limitation of this methodology.
Using the technologies you mentioned puts you on the right track for a solution (compared to those of us who were cornered into using basic SOAPMessage and SOAPHandlers). If you use some of the specialized objects in AXIOM and spring, you should be able to accomplish this. CHeck this article out here: http://forum.springsource.org/archive/index.php/t-48343.html
Thanks,
KK

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