Hi all,
I did implemented the following little web service in .NET 2.0:
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
public class Service1 : System.Web.Services.WebService
{
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
[WebMethod]
public void HelloWorld2(ref string answer)
{
answer = "Hello World";
}
}
When I then use a browser to get details on the web methods,
apparently I can call HelloWorld using HTTP POST or HTTP GET, but not
HelloWorld2. In fact, when I do try to do it, I get:
HTTP/1.1 500 Internal Server Error
Server: ASP.NET Development Server/8.0.0.0
Date: Wed, 29 Oct 2008 01:24:03 GMT
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: text/plain; charset=utf-8
Content-Length: 461
Connection: Close
System.InvalidOperationException: HelloWorld2 Web Service method name
is not valid.
at System.Web.Services.Protocols.HttpServerProtocol.I nitialize()
at System.Web.Services.Protocols.ServerProtocol.SetCo ntext(Type
type, HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.ServerProtocolFactor y.Create(Type
type, HttpContext context, HttpRequest request, HttpResponse response,
Boolean& abortProcessing)
Is there an explanation for this ?
Thanks in advance for your answers.
Joris Spriet