Home arrow Java arrow JSP Consumer for a Visual Studio Created Web Service Using Sun Java Studio Creator

JSP Consumer for a Visual Studio Created Web Service Using Sun Java Studio Creator

It isn't supposed to matter to a web service what platform or programming language it's dealing with. When Sun Java Studio Creator first appeared in beta two years ago, it apparently was not fully compatible with Visual Studio. Now that both languages have changed, it is possible to create a JSP web client in one of them for a simple web service created in the other. This article explains how.

Author Info:
By: Jayaram Krishnaswamy
Rating: 5 stars5 stars5 stars5 stars5 stars / 12
October 03, 2006
  1. · JSP Consumer for a Visual Studio Created Web Service Using Sun Java Studio Creator
  2. · Test the Web Service In-situ
  3. · Creating the JSP Client with Java Studio Creator 2
  4. · Referencing the Web Service in Java Studio Creator 2
  5. · JSP Client Returning Result from the Web Service
  6. · The Completed Java Code

print this article

JSP Consumer for a Visual Studio Created Web Service Using Sun Java Studio Creator
(Page 1 of 6 )


Web services are supposed to be platform and programming language agnostic in nature. This is of utmost importance to any and every kind of business operation throughout the Internet. In 2004 when the Sun Java Studio Creator surfaced in its beta, I tried to create a JSP web client to access a web service created with Visual Studio 2003. I did not succeed and rationalized in a way that was not satisfactory.

This tutorial is about revisiting that scene. Both of the software programs have changed and much water has flowed under the bridge. This tutorial will show how to create a JSP web client using Sun Java Studio Creator for a simple web service created with Visual Studio 2005. Both of these programs as well as the IIS 5.1 web server are running on the same computer using the Windows XP Professional Media Center Edition operating system.

Creating the Web Service

Create a new website project with Visual Studio 2005 from the File-->New website drop-down. This opens up the New Web Site window. From the Visual Studio Installed Templates area select the ASP.NET Web Service. You have to give a name to the web site; it's called Jikan in this tutorial.

When you click on the button labeled OK in the above window you will have created the Jikan web site with a folder/file structure as shown.

The files Service.asmx and Service.vb are the main files for the web service that will be created. Although it is advisable to change the name of the files to something different from this default naming, the defaults were taken in this tutorial as is. The content of the Service.asmx file is quite simple as shown here.

<%@ WebService Language="vb" CodeBehind="~/App_Code/Service.vb" Class="Service" %>

The Service.vb file comes with a default example of a web method described by the function Helloworld(). This has been retained and a second method called Curtime() has been added whose purpose is to get the current time on the server. The variable y will have the server time information. The next paragraph shows the Service.vb file

Imports System.Web
Imports Service
Imports System.Web.Services
Imports System.Web.Services.Protocols
<="http: designtimesp="18399"> _
<=wsiprofiles.basicprofile1_1)(> _
Public Class Service
Inherits System.Web.Services.WebService
Public Function HelloWorld() As String
Return "Hello World"
End Function
<="get designtimesp="18403"> _
Public Function Curtime() As String
Dim x As System.DateTime
x = System.DateTime.Now
Dim y As String = x.Date
Return y
End Function
End Class

blog comments powered by Disqus

- Java Too Insecure, Says Microsoft Researcher
- Google Beats Oracle in Java Ruling
- Deploying Multiple Java Applets as One
- Deploying Java Applets
- Understanding Deployment Frameworks
- Database Programming in Java Using JDBC
- Extension Interfaces and SAX
- Entities, Handlers and SAX
- Advanced SAX
- Conversions and Java Print Streams
- Formatters and Java Print Streams
- Java Print Streams
- Wildcards, Arrays, and Generics in Java
- Wildcards and Generic Methods in Java
- Finishing the Project: Java Web Development ...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials