• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Writing a web service to read XML message

 
Aniket Pathak
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

I am writing my first web service for a specific request. I am going through lots of online document but not able to find a perfect link.

I want to write a Web Service which will get following XML message. Web service will parse this message and send a response if required.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:iiw="http://iiws.innotrac.com/INOC_ATS_IIWS/V7_2/outbound/shared/services/iiwsOutbound">
<soap:Header/>
<soap:Body>
<OrderConfirmation>
<OrderID>80634928</OrderID>
<OrderStatus>200</OrderStatus>
<OrderNumber>10014</OrderNumber>
</OrderConfirmation>
<OrderConfirmation>
<OrderID>891634445</OrderID>
<OrderStatus>230</OrderStatus>
<OrderNumber>10567</OrderNumber>
</OrderConfirmation>
</soap:Body>
</soap:Envelope>

Please help me with this or suggest me a link or any guidelines so I can take it forward.

thanks
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Normally the SOAP stack would bind the data to data structures you keep on the server; or is this payload of a larger SOAP message that encapsulates this XML? Which SOAP stack and which API are you using?
 
Aniket Pathak
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lester Burnham wrote:Normally the SOAP stack would bind the data to data structures you keep on the server; or is this payload of a larger SOAP message that encapsulates this XML? Which SOAP stack and which API are you using?


Sorry but really not sure about the SOAP stack. I tried using Axis api to build the service.
I am just not able to get the proper implementation method. The XML given in the post will be sent to me by another application. So I need to host a web service to consume this message parse and process it with requires business logic and send a response back.
The given XML will be provided as it is without any inbuild large message or any object just plan values present in the XML tags.

Hope I have given the rite information required.

thanks.
 
Jim Akmer
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure I understand what you are asking.
Usually when someone writes a web service, he also publishes a wsdl. This wsdl (which serves as an interface to the web service) is either created manually and the web service class is created using an automatic wsdl2java tool or the java class is annotated to act as a web service and the wsdl is generated dynamically by the annotations.
Once these steps are finished and the web service is deployed, the framework will do all the xml parsing (including SOAP parsing) and you just implement a java method. So what do you mean "The given XML will be provided as it is without any inbuild large message or any object just plan values present in the XML tags. "
You will just implement a java method using the method arguments. The framework will handle the mapping of the parameters to your web method. This includes the response.
Does this answer your question?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic