nikkkilll

tommi4

Oct 3rd, 2019
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. Practical No : 04
  2. Aim : Develop client which consumes web services developed in different platform.
  3. Input:
  4. Netbean
  5. Consumewebservice
  6. package server;
  7. import javax.jws.WebService;
  8. import javax.jws.WebMethod;
  9. import javax.jws.WebParam;
  10. @WebService(serviceName = "ConsumeWebService")
  11. public class ConsumeWebService {
  12.  
  13. @WebMethod(operationName = "hello")
  14. public String hello(@WebParam(name = "name") String txt) {
  15. return "Hello " + txt + " !";
  16. }
  17. }
  18.  
  19. Visual studio
  20. Webform1.aspx.cs
  21. using System;
  22. using System.Collections.Generic;
  23. using System.Linq;
  24. using System.Web;
  25. using System.Web.UI;
  26. using System.Web.UI.WebControls;
  27.  
  28. namespace WebApplication1
  29. {
  30. public partial class WebForm1 : System.Web.UI.Page
  31. {
  32. protected void Page_Load(object sender, EventArgs e)
  33. {
  34. }
  35. protected void Button1_Click(object sender, EventArgs e)
  36. {
  37. string str = TextBox1.Text;
  38.  
  39. Response.Write(str);
  40. }
  41. }
  42. }
  43.  
  44.  
  45. Webform1.aspx
  46. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
  47.  
  48. <!DOCTYPE html>
  49.  
  50. <html xmlns="http://www.w3.org/1999/xhtml">
  51. <head runat="server">
  52. <title></title>
  53. </head>
  54. <body>
  55. <form id="form1" runat="server">
  56. <div>
  57. <asp:Label ID="Label1" runat="server" Text="username"></asp:Label>
  58. <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
  59. <asp:Button ID="Button1" runat="server" Text="show message" OnClick="Button1_Click" />
  60. </div>
  61. </form>
  62. </body>
  63. </html>
Add Comment
Please, Sign In to add comment