0% found this document useful (0 votes)
23 views6 pages

Weather Web Service Implementation Guide

The document outlines a practical assignment by Prakash Kumawat, a TYCS C student, to create a web service for weather information and a client application that consumes this service. The server-side application is developed in Java, providing weather data based on city input, while the client-side application is built using ASP.NET to interact with the web service. The document includes code snippets for both the server and client applications, detailing the steps taken to implement the project.

Uploaded by

ANAS MULLA
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views6 pages

Weather Web Service Implementation Guide

The document outlines a practical assignment by Prakash Kumawat, a TYCS C student, to create a web service for weather information and a client application that consumes this service. The server-side application is developed in Java, providing weather data based on city input, while the client-side application is built using ASP.NET to interact with the web service. The document includes code snippets for both the server and client applications, detailing the steps taken to implement the project.

Uploaded by

ANAS MULLA
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Name:-Prakash kumawat

Class:-TYCS C
Roll no.:-9337
Practical No. 5
Aim: Create a web service as a Weather Information. Develop a client that consumes web
services developed in different platforms. (Java to .NET and .NET to Java)
Creating server-side application
Creating a web service with name [Link]
Code:
[Link]
package abc;
import [Link];
import [Link];
import [Link];

@WebService(serviceName =
"hello") public class hello {

@WebMethod(operationName = "getWeather")
public String getWeather(@WebParam(name = "city") String city) {

if([Link]("Panvel")){
return "Rain";
}
else if([Link]("Mumbai"))
{
return "No Rain";
}
else{
return "no city information";
}
}
}
Name:-Prakash kumawat
Class:-TYCS C
Roll no.:-9337
Testing the web service:-

Creating the client-side application:-


Steps:-
Step 1:-creating [Link] Web application(.NET framework) on visual studio.
Name:-Prakash kumawat
Class:-TYCS C
Roll no.:-9337
Step 2:-

Step 3:-Select Empty in this step


Name:-Prakash kumawat
Class:-TYCS C
Roll no.:-9337
Step 4:-Consuming the web service in this project. right click on the [Link] add then the
service reference.

Step 5:-Copy the link of WSDL file and paste here and select go and select the web service.
Name:-Prakash kumawat
Class:-TYCS C
Roll no.:-9337

Code:-
[Link]
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="[Link]"
Inherits="application1.WebForm1" %>

<!DOCTYPE html>

<html xmlns="[Link]
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<br />
Enter City:
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="getWeather" OnClick="Button1_Click"
/>
</div>
</form>
</body>
</html>

[Link]
using System;
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];

namespace application1
{
Name:-Prakash kumawat
Class:-TYCS C
Roll no.:-9337
public partial class WebForm1 : [Link]
{
protected void Page_Load(object sender, EventArgs e)
{

protected void Button1_Click(object sender, EventArgs e)


{
String city = [Link];
[Link] s1= new [Link]();
[Link]([Link](city));
}
}
}
Output:

You might also like