System News
Exploring Web Service Simulation
Java Tech Article Looks at Designing It Using Servlets
February 24, 2010,
Volume 144, Issue 4

Web service simulation is a growing need for every web service based assignment.
 

In a java.net technical article, Adhir Mehta proposes using servlets to assist developers in maintaining their web service based assignments. He offers an algorithm to generate a file name using the input message, and then demonstrates how to use it in a configurable manner so there isn't a need to write any java code.

This article discusses the basics of web services and soap envelopes. Mehta states that the intended message resides in the soap body and is based on the message/content of the body; the response from the file system is picked up and can be returned to the caller. He suggests that this task can be achieved with servlets using the following steps.

  • 1. Extract the soap envelop from input stream.
  • 2. Retrieve the first node of soap body.
  • 3. Apply the algorithm to generate the response file name using input message. (I'll discuss one of the algorithms in following sections).
  • 4. Read the response from file system.
  • 5. Prepare the soap envelop and send it to the caller

Mehta then goes into the response file name generation algorithm with examples of the input SOAP message. He next hits on designing the fully configurable algorithm that is 100% configurable and doesn't require deployment for any change. He presents a sample XML, which defines XSD/XML, and notes that this is a one time writing of xml parser/processor.

Following his lead, developers will achieve a web service simulation via a simple mechanism. Mehta lists the key takeaways from this article as:

  • Servlet to simulate web service.
  • Alter response file name generation logic can be done using simple XML logic.
  • Write your own XML structure to achieve this, which can be based on his XSD and then customized to accomplish your task.
  • This logic only needs to be developed once. Afterward, no java coding is required. It's fully configurable and can save developers effort, time and money.

More Information

Web Service Simulation Using Servlets - Mehta's article

Developer Articles

Java Articles [...read more...]

Keywords:

fullsource
 

Other articles in the Developer section of Volume 144, Issue 4:
  • Exploring Web Service Simulation (this article)

See all archived articles in the Developer section.



News and Solutions for Users of Solaris, Java and Oracle's Sun hardware products
Just the news you need, none of what you don't – 42,000+ Members – 24,000+ Articles Published since 1998