How to build RPC BASED WEB SERVICE IN ASP.NET 2.0
-
Hi All, I am developing webservice in asp.net 2.0 which must be RPC Style based which takes input as a xml file.I am just developing default webservice in Visual Studio 2005 which has webMethod.Is this is RPC STYLE OR Document style webservice? if No then how build RPC style one.........? Also How client then made request to this service which must be open on some port. Send me some example for RPC STyle Web Service if possible. Thanks in Advance.
-
Hi All, I am developing webservice in asp.net 2.0 which must be RPC Style based which takes input as a xml file.I am just developing default webservice in Visual Studio 2005 which has webMethod.Is this is RPC STYLE OR Document style webservice? if No then how build RPC style one.........? Also How client then made request to this service which must be open on some port. Send me some example for RPC STyle Web Service if possible. Thanks in Advance.
By default, Visual Studio creates document style web services. This can be a problem if you are calling the web service from a J2EE application becuase J2EE clients expect RPC style services by default. The good news is that it is easy to change the stype of your web service. 1. Add [SoapRpcService()] above your class declaration 2. Remove [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] from your web service class. Let's look at the default web service visual studio provides when you create a new web services project:
/// DOCUMENT STYLE [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ToolboxItem(false)] public class Service1 : System.Web.Services.WebService { [WebMethod] public string HelloWorld() { return "Hello World"; } }
Here is the same web service implemented RPC style// RPC STYLE [WebService(Namespace = "http://tempuri.org/")] [ToolboxItem(false)] [SoapRpcService()] public class Service1 : System.Web.Services.WebService { [WebMethod] public string HelloWorld() { return "Hello World"; } }
Jim Conigliaro jconigliaro@ieee.org
http://www.jimconigliaro.com -
By default, Visual Studio creates document style web services. This can be a problem if you are calling the web service from a J2EE application becuase J2EE clients expect RPC style services by default. The good news is that it is easy to change the stype of your web service. 1. Add [SoapRpcService()] above your class declaration 2. Remove [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] from your web service class. Let's look at the default web service visual studio provides when you create a new web services project:
/// DOCUMENT STYLE [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ToolboxItem(false)] public class Service1 : System.Web.Services.WebService { [WebMethod] public string HelloWorld() { return "Hello World"; } }
Here is the same web service implemented RPC style// RPC STYLE [WebService(Namespace = "http://tempuri.org/")] [ToolboxItem(false)] [SoapRpcService()] public class Service1 : System.Web.Services.WebService { [WebMethod] public string HelloWorld() { return "Hello World"; } }
Jim Conigliaro jconigliaro@ieee.org
http://www.jimconigliaro.com -
By default, Visual Studio creates document style web services. This can be a problem if you are calling the web service from a J2EE application becuase J2EE clients expect RPC style services by default. The good news is that it is easy to change the stype of your web service. 1. Add [SoapRpcService()] above your class declaration 2. Remove [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] from your web service class. Let's look at the default web service visual studio provides when you create a new web services project:
/// DOCUMENT STYLE [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ToolboxItem(false)] public class Service1 : System.Web.Services.WebService { [WebMethod] public string HelloWorld() { return "Hello World"; } }
Here is the same web service implemented RPC style// RPC STYLE [WebService(Namespace = "http://tempuri.org/")] [ToolboxItem(false)] [SoapRpcService()] public class Service1 : System.Web.Services.WebService { [WebMethod] public string HelloWorld() { return "Hello World"; } }
Jim Conigliaro jconigliaro@ieee.org
http://www.jimconigliaro.comHi Jim, I have created one RPC Style WebService by including [SoapRpcService()]. Now after launching how to open that webService to particular port,so that it can able to listen the request from client. Actualy i have one code snippet [SoapRpcMethod()] public string GetData(string request) { data.XmlRequest = request; string response = data.GetData(); return response; } This take string as input which is in xml format.After parsing and performing calulation returns a string response which is in same format. so, my question is how this method listen the request from client? i.e J2EE Client. Or is there nessesary to open a partucular port for listening client request? What things I should do extra for converting it to RPC Based? Once again... Thanks in advance.
-
Hi Jim, I have created one RPC Style WebService by including [SoapRpcService()]. Now after launching how to open that webService to particular port,so that it can able to listen the request from client. Actualy i have one code snippet [SoapRpcMethod()] public string GetData(string request) { data.XmlRequest = request; string response = data.GetData(); return response; } This take string as input which is in xml format.After parsing and performing calulation returns a string response which is in same format. so, my question is how this method listen the request from client? i.e J2EE Client. Or is there nessesary to open a partucular port for listening client request? What things I should do extra for converting it to RPC Based? Once again... Thanks in advance.
Once a web service is deployed, it is always listening, but that is handled by IIS. Web services function very much like web pages. When you type a URL into your browser, a request is made the server for the specififed web page and the web page response with some content. A web service works very much the same way; when IIS receives a request from the client, it passes it on to your web service which then response with the appropriate SOAP response. By default, web services run over port 80, but you can configure IIS to use any port you wish without changing any code.
Jim Conigliaro jconigliaro@ieee.org
http://www.jimconigliaro.com -
Once a web service is deployed, it is always listening, but that is handled by IIS. Web services function very much like web pages. When you type a URL into your browser, a request is made the server for the specififed web page and the web page response with some content. A web service works very much the same way; when IIS receives a request from the client, it passes it on to your web service which then response with the appropriate SOAP response. By default, web services run over port 80, but you can configure IIS to use any port you wish without changing any code.
Jim Conigliaro jconigliaro@ieee.org
http://www.jimconigliaro.com -
Hi, Last but not list..................................... How to call RPC WebService through J2EE client through SOAP Request.
It's been about five years since I've worked heavily in Java, so I don't think I could help you out, but this link may be helpful: https://bpcatalog.dev.java.net/nonav/soa/j2ee-client/index.html[^]
Jim Conigliaro jconigliaro@ieee.org
http://www.jimconigliaro.com