A web reference is not the same as an assembly (or project) reference -- only web service types and types consumed directly by web service types are exposed, and remember that it's one web reference per .asmx file.
You say that the classes you're not seeing are structs...structs can not be used directly as web services, so the only way they'll be made available (via an auto-generated proxy) by the web reference is if the web service exposes a web method that takes it as a parameter. So you'd need something like this:
public struct MyStruct
{
public int x;
}
[WebClass]
public class MyService : WebService
{
[WebMethod]
public void Foo(MyStruct value)
{
// Do interesting things here with value.
}
}
That's basically the bare minimum...remove *any* piece of that code at all (except perhaps for inheriting from WebService -- that's optional, but recommended), and MyStruct will no longer be exposed by the web reference. If you're doing all that already, please post a sample of your code so we can take a closer look at what's going on. Ideally, this would be the smallest code possible that I could use to reproduce the problem.
Main Topics
Browse All Topics





by: testnPosted on 2005-03-17 at 21:25:31ID: 13571917
I'd bet that it's there already but it won't be in the same namespace. Basically, WSDL should describe the struct and then the consumer will read that and transform that into its own struct/class. This means the web service consumer won't use the same class/struct as the server use. It will be just a similar construct of what in there. Please check in web service namespace that you just imported.