web reference in a .net class library

R

russell.lane

I have a web service that exposes database contents as disconnected
datasets. I would to use that web service from within a class library.

I have included a web reference to the service in my class library project.

If I bring up the reference in the object browser, I see the web service
namespace nested within the class library namespace, and I see the web
service type definition with all of the service methods correctly described.

If I look at the app.config file for the reference, I see the URL for the
service in the properties settings for the class library.

When I try to instantiate a service proxy in the class library code,
however, the service namespace and proxy object type are not recognized by
Intellisense or by the compiler. Or, actually, sometimes they are and
sometimes they are not, and I can't make out any rhyme or reason to when
they are and aren't.

Note that I would like this class library to be a reusable component, so I
do not want to have to wait until it's included in an application to be able
to code to the service proxy type.

What am I missing?

Thanks -

Russell Lane
Principal SW Engineer
Eliza Corporation
 
M

Michael Nemtsev

Hello russell.lane,

Did u include using directive with the namespace of your web service?

r> I have a web service that exposes database contents as disconnected
r> datasets. I would to use that web service from within a class
r> library.
r>
r> I have included a web reference to the service in my class library
r> project.
r>
r> If I bring up the reference in the object browser, I see the web
r> service namespace nested within the class library namespace, and I
r> see the web service type definition with all of the service methods
r> correctly described.
r>
r> If I look at the app.config file for the reference, I see the URL for
r> the service in the properties settings for the class library.
r>
r> When I try to instantiate a service proxy in the class library code,
r> however, the service namespace and proxy object type are not
r> recognized by Intellisense or by the compiler. Or, actually,
r> sometimes they are and sometimes they are not, and I can't make out
r> any rhyme or reason to when they are and aren't.
r>
r> Note that I would like this class library to be a reusable component,
r> so I do not want to have to wait until it's included in an
r> application to be able to code to the service proxy type.
r>
r> What am I missing?
r>
r> Thanks -
r>
r> Russell Lane
r> Principal SW Engineer
r> Eliza Corporation
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
R

russell.lane

Bingo. I included a using clause for the fully qualified namespace, i.e.,
"using ClassLibraryNamespace.WebServiceNamespace". All good.

Thanks!

R
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top