http://bugzilla.novell.com/show_bug.cgi?id=530868
Summary: SoapHeaderException when calling a web service with a
struct and a generic list in the signature
Classification: Mono
Product: Mono: Runtime
Version: 2.4.x
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: P5 - None
Component: misc
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: jp.gouigoux at free.fr
QAContact: mono-bugs at lists.ximian.com
Found By: ---
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.0.13)
Gecko/2009073022 Firefox/3.0.13
A web service has a struct (value type) and a List<> in its signature. The
struct is composed of several strings and ints, but nothing else. If I compile,
then call wsdl to create the stub, the stub shows a string[] signature for the
List<>, and created a class to send the "struct" information. This is OK, but
when I use the stub to call the service from a console application, the client
sends a SoapHeaderException and tells me the IL code is invalid.
If I simply change the struct keyword to a class, making it a reference type,
it works as expected. Also, if I change the signature of the [WebService]
function to use a string[], it works as well.
Reproducible: Always
Steps to Reproduce:
1. Create a web service with the following code :
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Test : System.Web.Services.WebService
{
[WebMethod]
public ReturnClass Method1(
string Parameter,
List<string> InfoList,
InputStructure Parametres)
{
return new ReturnClass();
}
[WebMethod]
public ReturnClass Method2(
string Parameter,
string[] InfoList,
InputStructure Parametres)
{
return new ReturnClass();
}
[WebMethod]
public ReturnClass Method3(
string Parameter,
List<string> InfoList,
InputClass Parametres)
{
return new ReturnClass();
}
[WebMethod]
public ReturnClass Method4(
string Parameter,
string[] InfoList,
InputClass Parametres)
{
return new ReturnClass();
}
public class ReturnClass
{
public string Info1 = "Nothing";
}
public struct InputStructure
{
public int Min;
public int Max;
public string Info1;
public string Info2;
}
public class InputClass
{
public int Min;
public int Max;
public string Info1;
public string Info2;
}
}
2. Create a stub for the web service
3. Create a console client with a code like this and run it :
ServiceMiniReproBug.Test Client = new
ConsoleTest.ServiceMiniReproBug.Test();
Client.Method2(string.Empty, new string[0], new
ConsoleTest.ServiceMiniReproBug.InputStructure());
Client.Method3(string.Empty, new string[0], new
ConsoleTest.ServiceMiniReproBug.InputClass());
Client.Method4(string.Empty, new string[0], new
ConsoleTest.ServiceMiniReproBug.InputClass());
Client.Method1(string.Empty, new string[0], new
ConsoleTest.ServiceMiniReproBug.InputStructure());
Actual Results:
Methods 2, 3 and 4 work, but not Method1. It sends :
Invalid IL code in (wrapper runtime-invoke)
Test:runtime_invoke_Test/ReturnClass__this___string_List`1<string>_Test/InputStructure
(object,intptr,intptr,intptr): IL_002b: call 0x00000005
Expected Results:
All methods should work
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.