Can someone point me to a sample solution that I can download? I am having trouble trying to find one.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Create a class library, MyInterfaces, that houses just your interfaces:
Add a Web Service Library project. Set a reference to the above project that contains the above Interfaces. Add the following code to this project:
Add a 3rd project, a client app which will consume the Service. I’ll make mine a WinForm app. Have this project also reference the Interface projrect. Add this code:
This is just a quick and dirty example. My goal was to get rid of the generated proxy object that you normally get when you use the Add Service Wizard. I suppose that end point should come from a config file, though I am not sure how to dynamically determine what the port will be when debugging under VS’ web server.
The one thing that I don’t like about this is that the objects I pass, eg, a Customer object, which represent a potential Business Object, seem to require that they have a default parameterless constructor. I prefer to have constructors to ensure that my object was properly initialized wherever it may have been used.