Web services and c#
-
I not sure which is the best forum to place this question in so I will start here. I have an web application that has a business logic layer consisting of serveral files in c#. I want to expose some of those methods in the files via a web service. I belive I can expose them using the [WebMethod] attribute. Now, I can also generate an asmx (web service)file for the web services but I can not for the life of me figure out how the asmx file is supposed to find out about the webmethods in the business logic layer. Any suggestions. I can easily create an asmx file and write the code directly into the file but that defeats the purpose (i.e. now I have the same logic in two places) Please any help would be great.
-
I not sure which is the best forum to place this question in so I will start here. I have an web application that has a business logic layer consisting of serveral files in c#. I want to expose some of those methods in the files via a web service. I belive I can expose them using the [WebMethod] attribute. Now, I can also generate an asmx (web service)file for the web services but I can not for the life of me figure out how the asmx file is supposed to find out about the webmethods in the business logic layer. Any suggestions. I can easily create an asmx file and write the code directly into the file but that defeats the purpose (i.e. now I have the same logic in two places) Please any help would be great.
The
.asmx
can be created in VS.NET where you can create a Web Service. The beauty in this is that you should also be able to allow VS.NET to create the wdsl portion, which exposes the methods available through the web services. Take a look at the wsdl that Chris has created for the XML web service that is up and running now. Code Project WSDL Contents HTH Nick Parker -
The
.asmx
can be created in VS.NET where you can create a Web Service. The beauty in this is that you should also be able to allow VS.NET to create the wdsl portion, which exposes the methods available through the web services. Take a look at the wsdl that Chris has created for the XML web service that is up and running now. Code Project WSDL Contents HTH Nick ParkerHi Nick, Yes I understand that and have been able to do just that. My question is how does one create a web service (asmx file) that supports multiple classes in different .cs files? When creating an asmx file, you can associate a codebehind page but it seems to be able to support only one .cs file and one class. I want the codebehind page to show multiple cs files and multiple classes. (Does this make sense?) Can this be done? I might be missing something here so if you can elaborate, that would be great. For example, the link that you provided for the codeproject web service provides an asmx file in which the methods all reside in a single class. What I want is the ability to support mehtods from multiple cs files and choose multiple methods from classes within those cs files. Hopefully this makes sense.