CATEGORIES
JSP Web Services Example - XML, XSLT in JSP - XML Web Services in Java
Published by: San (9/19/2007)
I am trying to code a web service for remote server to write out little information. Can you help me in finding an example of jsp web services? I am trying to use the xml response as the requesting server is going to parse the information and publish it the user. Please help me in finding a jsp web services using xml.
Web services are way better than writing a separate application or connecting a remote database to get some information. Parsing the information in the form of xml is the most standard way maintained in the web world. This article describes to code a web service using jsp pages.
<% response.setContentType("text/xml"); %>
<% response.setCharacterEncoding("UTF-8"); %>
<myco:JSPWebService
xmlns:myco="http://www.softcomptools.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.softcomptools.com" >
<% // variable declared and initiated for this web service application
String WebServices = "xml";
%> <Header><![CDATA[
This is an example of jsp web service for <%=WebServices%> data.
]]></Header>
</myco:JSPWebService>
Here you can add or ![CDATA[, by adding this tag you can make sure the data is being transmitted even it is not in xml format. On needed the xml data is being parsed to get the optimal result.
This code is debugged and works fine, if you find any problem or error on running this script then post your comment here.
Most Popular Articles
- Sending Email from JSP Pages Using smtp.gmail.com
- How to Configure 404 Error or Page not Found on Tomcat
- JSP Web Services Example - XML, XSLT in JSP - XML Web Services in Java
- How to Change the Image onMouseOver
- How to Email from JSP Page?
Sample Codes for Sending Emails from JSP Page Using Gmail >>
<< How to Email from JSP Page?
COMMENT