Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web Service Cannot Reference Multiple Web Services

Status
Not open for further replies.

rpolunsky

Programmer
Apr 17, 2001
22
US
I can write a client that references multiple web services. (At least I assume I can, I haven't actually written that particular program.)

However, I have not been able to write a web service that does the same thing. Whenever I try, the IDE throws a compile time error (I'm using C#), fails to recognize the "localhost1" prefix on the second service, and politely suggests that I've forgotten a Using or a namespace.

I can write a web service that consumes a different web service and passes it on to be available to the eventual client. Why can't I consume more than one?

Richard
 
Okay... I may have found the problem. It looks like the IDE is confusing the compiler when it creates aliases for the host of the service.

When you add the first web reference, it gets identified as coming from "localhost".
When you add the second, it gets identified as coming from "localhost1".
But when you compile, the "localhost1" identifier is not recognized.

Apparently the compiler is not correctly distinguishing between the alias "localhost1"
and the actual referenced host "localhost".

My workaround is to rename the alias away from "localhost" when I import my first web reference.
Now I can add a second reference, leave it as "localhost" and everything compiles and works.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top