File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services Certification (SCDJWS/OCPJWSD) and the fly likes Unable to send a SOAP request properly designed using SAAJ Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Web Services Certification (SCDJWS/OCPJWSD)
Reply Bookmark "Unable to send a SOAP request properly designed using SAAJ" Watch "Unable to send a SOAP request properly designed using SAAJ" New topic
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
 
Threads others viewed
How to determine if it is Document style or RPC looking at SOAP request ?
SOAP Fault for SOAP Action property
SAAJ - Empty SOAP Response / Null Pointer Exception
SOAPMessage Frights
Different Behavior between SAAJ Implementations (Axis2 and glassfish)
MyEclipse, The Clear Choice