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/OCEJWSD) and the fly likes Unable to send a SOAP request properly designed using SAAJ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
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: 519
    
    2

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
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
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: 519
    
    2

Thanks Ivan,

You are right. I used wrong element names param1 and param2 in SAAJ client, instead of arg0 and arg1. My bad
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to send a SOAP request properly designed using SAAJ