473,385 Members | 1,333 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Web Service method name is not valid

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.I nitialize() at
System.Web.Services.Protocols.ServerProtocolFactor y.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
Feb 24 '06 #1
1 14318
Hi,

I solved the problem.

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

Regards
Andy

--
Regards,
Anand
"Andy" <ar******@ivesia.com> wrote in message
news:OQ**************@TK2MSFTNGP15.phx.gbl...
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.I nitialize() at
System.Web.Services.Protocols.ServerProtocolFactor y.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

Feb 24 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: maflatoun | last post by:
Hi, I have recently noticed that some of my web services when used/tested directly by calling the ..asmx page return the following result Invalid method name 'logusagereport', method names...
0
by: dpp | last post by:
Hi I am calling a method of a .NET component from both win forms and web service applications. Strangly, it is working fine from win forms application, but when i call the same method (same...
2
by: SM | last post by:
Hi, I have a web service method developed in .Net 1.1 where both http get and post protocols are enabled. the problem is that , when i access my web method from ie window like...
1
by: Debasish Pramanik | last post by:
Hi All, Is there any standards to be followed for method name while writing Web Service. For e.g. Should we follow the camel case standards or Hungarian notation. -- Regards,
4
by: Abhi | last post by:
Hi All, I have a web service method which works fine when called from my local machine i.e. from localhost but when I publish the web services to a remote machine it throws an invalid cast soap...
2
by: Microsoft Newsgroups | last post by:
I am trying to consume a web service where there is a dot in the method name as defined in the portType and binding section of the WSDL file. Here is an example: <operation...
0
by: Matteo | last post by:
Hi everybody, can anyone tell me how to pass an XMLNode to a web service method? While using structs as response of the web service all works fine, but there's a certain difficulty with XML...
0
by: enggwaqas | last post by:
I am exposing my Biztalk orchestration as a web service and want to consume this web service asyncly, but when i added web reference in my visual studio project it isn't displying Begin<Web Method...
3
by: =?Utf-8?B?YW5kcmV3?= | last post by:
I have a web application demo page and a web service. On my machine everything works great. In our test environment the web service is working fine... when I point the demo page on my machine...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.