| Author |
Unable to send a SOAP request properly designed using SAAJ
|
Kumar Raja
Ranch Hand
Joined: Mar 18, 2010
Posts: 447
|
|
Hello All,
I'm trying to experiment by sending a SAAJ built SOAP request to my webservice. My service is designed as below
and my service is running at http://localhost:8080/Calculator/CalculatorService
My SAAJ client is as follows
as you can see, I'm printing out the both the request and response and those are as below
I tested my service using SOAP UI and I get the result 9 as expected, but with the above code I get the response as "0"
Also, from the debug statement in service, I see the incoming values as 0 and 0 which explains why my result was 0.
But why are the values which I set as 5 and 4 are converted to 0 when it was received by service. Is there any mistake I'm making here in making my SOAP request.
|
Regards
KumarRaja
|
 |
Ivan Krizsan
Bartender
Joined: Oct 04, 2006
Posts: 2186
|
|
Hi!
Can you post the request generated by soapUI and the request from your client in one and the same post?
If you have time, do compare the two requests for differences.
A common problem when a web service fails to extract parameter values from a request is that element(s) are not in the correct namespace(s).
JAXB fails silently when encountering this kind of problems - in fact, it does not "see" the data since it is not in the expected namespace.
Best wishes!
|
My free books and tutorials: http://www.slideshare.net/krizsan
|
 |
Kumar Raja
Ranch Hand
Joined: Mar 18, 2010
Posts: 447
|
|
Thanks Ivan,
You are right. I used wrong element names param1 and param2 in SAAJ client, instead of arg0 and arg1. My bad
|
 |
 |
|
|
subject: Unable to send a SOAP request properly designed using SAAJ
|
|
|