ASP.NET

Moderators: None (Apply to moderate this forum)
Number of threads: 1735
Number of posts: 3305

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Web service proxy class error Posted by uniqueou on 5 Apr 2010 at 1:35 AM
Hi All,

When I use soap header in my webservice my proxy class which include List<Byte> 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<byte>):

public class Class1
{
public List<Byte> documents = new List<byte>();
}

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 ArrayOfUnsignedByte();
}
}

Everythings ok, In my proxy classes , List<Byte> 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]
[SoapHeader("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 ArrayOfUnsignedByte();
}
}

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:\Users\oguzhanuysal\Documents\Visual Studio 2010\Projects\WebService\ConsoleApplication\Program.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



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.