Chapter 9 .NET Client Support
These steps require a .NET framework SDK, which you can download from the Microsoft .NET SDK download Web site :
wsdl c:\DotNETSampleImpl.wsdl c:\DotNETSample.wsdl
com.sybase.jaguar.component.name=dotNETSample/Greeting
<wsdl:service name= "dotNETSample/GreetingService">
GreetingService.cs
wsdl /out:GreetingService.cs DotNETSampleImpl.wsdl DotNETSample.wsdl
csc.exe Client.cs GreetingService.cs
public class dotNETSampleGreetingService
<wsdl:service name= "dotNETSample/GreetingService">
Client.exe
This is the listing of the client.cs file:
using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; public class Client { static void Main(String[] args) { if (args.Length == 0) { Console.WriteLine("usage: client <name>"); return; } dotNETSampleGreetingService srv = new dotNETSampleGreetingService(); String str = srv.sayHello(args[0]); Console.WriteLine(str); } }
This is the listing of the GreetingService.cs proxy file
//------------------------------------------------------------------------ // <autogenerated> // This code was generated by a tool. // Runtime Version: 1.0.3705.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </autogenerated> //--------------------------------------------------------------------------- // // This source code was auto-generated by wsdl, Version=1.0.3705.0. // using System.Diagnostics; using System.Xml.Serialization; using System; using System.Web.Services.Protocols; using System.ComponentModel; using System.Web.Services; /// <remarks/> [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Web.Services.WebServiceBindingAttribute(Name="dotNETSample/GreetingServiceBinding", Namespace="http://www.com.sybase.webservices/DotNETSampleImpl")] public class dotNETSampleGreetingService : System.Web.Services.Protocols.SoapHttpClientProtocol { /// <remarks/> public dotNETSampleGreetingService() { this.Url = "http://localhost:8080/WEBSERVICES/SOAP"; } /// <remarks/> [System.Web.Services.Protocols.SoapRpcMethodAttribute("dotNETSample/Greeting.ejbCreate return,void,return", RequestNamespace="", ResponseNamespace="")] [return: System.Xml.Serialization.SoapElementAttribute("return")] public string ejbCreate() { object[] results = this.Invoke("ejbCreate", new object[0]); return ((string)(results[0])); } /// <remarks/> public System.IAsyncResult BeginejbCreate(System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("ejbCreate", new object[0], callback, asyncState); } /// <remarks/> public string EndejbCreate(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((string)(results[0])); } /// <remarks/> [System.Web.Services.Protocols.SoapRpcMethodAttribute("dotNETSample/Greeting.ejbActivate return,void,return", RequestNamespace="", ResponseNamespace="")] [return: System.Xml.Serialization.SoapElementAttribute("return")] public string ejbActivate() { object[] results = this.Invoke("ejbActivate", new object[0]); return ((string)(results[0])); } /// <remarks/> public System.IAsyncResult BeginejbActivate(System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("ejbActivate", new object[0], callback, asyncState); } /// <remarks/> public string EndejbActivate(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((string)(results[0])); } /// <remarks/> [System.Web.Services.Protocols.SoapRpcMethodAttribute("dotNETSample/Greeting.ejbPassivate return,void,return", RequestNamespace="", ResponseNamespace="")] [return: System.Xml.Serialization.SoapElementAttribute("return")] public string ejbPassivate() { object[] results = this.Invoke("ejbPassivate", new object[0]); return ((string)(results[0])); } /// <remarks/> public System.IAsyncResult BeginejbPassivate(System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("ejbPassivate", new object[0], callback, asyncState); } /// <remarks/> public string EndejbPassivate(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((string)(results[0])); } /// <remarks/> [System.Web.Services.Protocols.SoapRpcMethodAttribute("dotNETSample/Greeting.ejbRemove return,void,return", RequestNamespace="", ResponseNamespace="")] [return: System.Xml.Serialization.SoapElementAttribute("return")] public string ejbRemove() { object[] results = this.Invoke("ejbRemove", new object[0]); return ((string)(results[0])); } /// <remarks/> public System.IAsyncResult BeginejbRemove(System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("ejbRemove", new object[0], callback, asyncState); } /// <remarks/> public string EndejbRemove(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((string)(results[0])); } /// <remarks/> [System.Web.Services.Protocols.SoapRpcMethodAttribute("dotNETSample/Greeting.sayHello return,java.lang.String,return in,java.lang.String" + ",p0", RequestNamespace="", ResponseNamespace="")] [return: System.Xml.Serialization.SoapElementAttribute("return")] public string sayHello(string p0) { object[] results = this.Invoke("sayHello", new object[] { p0}); return ((string)(results[0])); } /// <remarks/> public System.IAsyncResult BeginsayHello(string p0, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("sayHello", new object[] { p0}, callback, asyncState); } /// <remarks/> public string EndsayHello(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((string)(results[0])); } }
Copyright © 2002 Sybase, Inc. All rights reserved. |
![]() |