Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Practical No : 04
- Aim : Develop client which consumes web services developed in different platform.
- Input:
- Netbean
- Consumewebservice
- package server;
- import javax.jws.WebService;
- import javax.jws.WebMethod;
- import javax.jws.WebParam;
- @WebService(serviceName = "ConsumeWebService")
- public class ConsumeWebService {
- @WebMethod(operationName = "hello")
- public String hello(@WebParam(name = "name") String txt) {
- return "Hello " + txt + " !";
- }
- }
- Visual studio
- Webform1.aspx.cs
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- namespace WebApplication1
- {
- public partial class WebForm1 : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- string str = TextBox1.Text;
- Response.Write(str);
- }
- }
- }
- Webform1.aspx
- <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title></title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <asp:Label ID="Label1" runat="server" Text="username"></asp:Label>
- <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
- <asp:Button ID="Button1" runat="server" Text="show message" OnClick="Button1_Click" />
- </div>
- </form>
- </body>
- </html>
Add Comment
Please, Sign In to add comment