Java
  Home arrow Java arrow JSP Consumer for a Visual Studio Created W...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

JSP Consumer for a Visual Studio Created Web Service Using Sun Java Studio Creator
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2006-10-03

    Table of Contents:
  • JSP Consumer for a Visual Studio Created Web Service Using Sun Java Studio Creator
  • Test the Web Service In-situ
  • Creating the JSP Client with Java Studio Creator 2
  • Referencing the Web Service in Java Studio Creator 2
  • JSP Client Returning Result from the Web Service
  • The Completed Java Code

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


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


    (Page 1 of 6 )

    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.

    Introduction

    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

    Service.vb
    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

    More Java Articles
    More By Jayaram Krishnaswamy


       · The last time I did not succeed, thanks to the refurbished, enhanced, Java Studio...
     

    JAVA ARTICLES

    - 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 ...
    - Generics and Limitations in Java
    - Getting Started with Java Web Development in...






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT