all groups > dotnet web services > february 2006 >
You're in the

dotnet web services

group:

Web Service method name is not valid



Web Service method name is not valid Andy
2/24/2006 12:00:00 AM
dotnet web services: Hi,

I created a sample web service and tried calling it from my VBScript.

Here it is:
----------------------------------------------------------------------------
---------------
'-- Declare variables

dim fs

dim file

dim strPara

Const URL = "http://localhost/Sample/SampleService.asmx"

'-- Initialize variables

para = "Anand"

Set fs = CreateObject("Scripting.FileSystemObject")

Set file = fs.OpenTextFile("C:\Inetpub\wwwroot\Sample\output\get.html", 8,
True)

' Create the HTTP object

Set xmlhttp = CreateObject("Microsoft.XMLHTTP")

xmlhttp.open "GET", URL & "/HelloWorld?pstrTemp=" & strPara, false


' Send the request synchronously

xmlhttp.send ""

'-- Write output to file

file.write xmlhttp.responseText

file.close()

----------------------------------------------------------------------------
---------------
But I get the output as:

System.InvalidOperationException: HelloWorld Web Service method name is not
valid. at System.Web.Services.Protocols.HttpServerProtocol.Initialize() at
System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&
abortProcessing)

I have allowed httpget and httppost in my web.config of the sample web
service.
<webServices>

<protocols>

<add name="HttpGet"/>

<add name="HttpPost"/>

<add name="HttpPostLocalhost"/>

<!-- Documentation enables the documentation/test pages -->

<add name="Documentation"/>

</protocols>

</webServices>

I also do not have my firewall enabled.

Any clue how to solve this?

Regards,
Anand

Re: Web Service method name is not valid Andy
2/24/2006 7:54:03 PM
Hi,

I solved the problem.

Silly mistake, I had commented the [Web Method] before my method that
prevented its exposure. :~)

Regards
Andy

--
Regards,
Anand
[quoted text, click to view]

AddThis Social Bookmark Button