Discussions

XML & Web services: SOAP Message (Request and Response)

  1. SOAP Message (Request and Response) (1 messages)

    Hi, I have a webservice client written using WSDL2Java 1.2 I use the following steps a. Create Stubs using WSDL2Java b. Invoked the webservice using Locator and Soap classes generated from the step a c. I am able to post request and get response which are java classes created from step a My question is how can i convert the request and response to the webservice from java classes to string format 1. .toString() resulted in a object name 2. Did not find a good JAXB example...not sure if thats the route to go 3. Does WSDL2Java or Axis provide easier solution 4. Cannot use products like Castor....looking for a soution with products like Axis or its suite of products. Looking forward for your responses. Thanks Gamad
  2. If i understand your question right.... this snippet might help: SOAPBody soapBody = response.getSOAPBody(); java.util.Iterator iterator = soapBody.getChildElements(bodyName); SOAPBodyElement bodyElement = (SOAPBodyElement)iterator.next(); String value = bodyElement.getValue(); http://java.sun.com/j2ee/1.4/docs/tutorial/doc/SAAJ3.html#wp78677 Bhagvan K http://www.jroller.com/page/bhagvank