Reputation:
I have a project that uses a class library for the business layer functionality (database access, etc.). A web application sits on top of this. I have a web service that I would like to call in the class library. Every time I add a 'service reference' (I am using VS2008) to the class library, everything seems to work OK. The name of the web service is 'EmployeeService'. However, when I try to access it from code, intellisense gives me options like:
'EmployeeServiceSoap'
'EmployeeServiceSoapChannel'
'EmployeeServiceSoapClient'
and lots of '...Request'
'...RequestBody'
'...RequestResponse' types.
I can't access my EmployeeService class even if I write it anyway the compiler will complain. Any ideas? Thanks for any help...
Upvotes: 8
Views: 11516
Reputation:
Really? I will try that. That must have changed with VS2008/.NET 3.5 right? I know it wasn't like that in the past.
EDIT: I finally figured it out. I was adding the reference as a 'service reference' and not a 'web reference'. I guess service reference is new in .NET 3.5 and it a little difference from a classical web reference. VS2008 did not give me an option to add a web reference. I had to go into the advanced properties of the service reference and add a web reference instead. Once I did this it gives me two options (one to add a service reference, another to add a web reference), go figure.
Upvotes: 6
Reputation: 99957
You're supposed to use the EmployeeServiceSoapClient
to access the service. The Service class itself sits on the server.
Upvotes: 5