Web service proxy class error

Hi All,

When I use soap header in my webservice my proxy class which include List is not generated anymore

For Example:

In Visual Studio, I created new webservice project and I add new class ("Class1") which include a member documents(List):

public class Class1
{
public List documents = new List();
}

in my web service I used this class as parameter :

public class Service1 : System.Web.Services.WebService
{
[WebMethod]
public string HelloWorld(Class1 class1)
{
return "Hello World";
}
}

finally in my client I used this web service by proxy classes which generated wsdl.exe or svcutil.exe

class Program
{
static void Main(string[] args)
{
Class1 class1 = new Class1();
class1.documents = new [color=Red]ArrayOfUnsignedByte[/color]();
}
}

Everythings ok, In my proxy classes , List converted to a proxy class(ArrayOfUnsignedByte)

After, I added a soap header to my webservice method:

public class Service1 : System.Web.Services.WebService
{
public Auth auth;

[WebMethod]
[[color=Red]SoapHeader[/color]("auth")]
public string HelloWorld(Class1 class1)
{
return "Hello World";
}
}

public class Auth : SoapHeader
{
public string username;
public string password;
}

and I updated service reference in My client application which uses this web service:

class Program
{
static void Main(string[] args)
{
Class1 class1 = new Class1();
class1.documents = new [color=Red]ArrayOfUnsignedByte[/color]();
}
}

Opps I get a compile time error:

Error 1 The type or namespace name 'ArrayOfUnsignedByte' could not be found (are you missing a using directive or an assembly reference?) C:UsersoguzhanuysalDocumentsVisual Studio 2010ProjectsWebServiceConsoleApplicationProgram.cs 15 36 ConsoleApplication

The proxy class ("ArrayOfUnsignedByte") that was generated before is gone anymore!

Is this a .net bug? or I doing something wrong?

Thank for helps, sorry for my english
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories