Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Unable to send a SOAP request properly designed using SAAJ

 
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Kumar Raja
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ivan,

You are right. I used wrong element names param1 and param2 in SAAJ client, instead of arg0 and arg1. My bad
 
moose poop looks like football shaped elk poop. About the size of this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic