Web Service method name is not valid

  • Thread starter Thread starter andrew
  • Start date Start date
A

andrew

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 to the test environment web service I get results as
expected.

The demo page in the test environment which is pointed at the web service in
the test environment doesn't work at all... instead I end up with this
bizarre error:

Client found response content type of 'text/plain; charset=utf-8', but
expected 'text/xml'.
The request failed with the error message:
--
System.InvalidOperationException: /WebServices/myWebService.asmx 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 figure I need to change some sort of environmental variable on the test
environment machine but I'm not really sure what to change.

Here's the demo page code...

Private Sub Submit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Submit.Click

Dim myWS As New myWebReference.myWebService
Dim myDS As DataSet
Dim myResponseStr As String

Try

'Create Soap Header
CreateSoapHeader(myWS)

myDS = myWS.GetStuff(Me.txtInput.Text)

myResponseStr = myDS.GetXml

txtOutput.Text = myResponseStr
Catch ex As Exception
Throw ex
End Try

End Sub

Public Sub CreateSoapHeader(ByRef myWS As myWebReference.myWebService)
Dim myWSCredentials As myWebReference.Credentials

' Build Credentials.
If (Me.txtUserName.Text <> "" AndAlso Me.txtPassword.Text <> "") Then
myWSCredentials = New ConsumerComplaintsWSWR.Credentials
myWSCredentials.UserName = Me.txtUserName.Text
myWSCredentials.Password = Me.txtPassword.Text
End If

myWS.CredentialsValue = myWSCredentials
End Sub
 
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 to the test environment web service I get results
as
expected.

The demo page in the test environment which is pointed at the web service
in
the test environment doesn't work at all... instead I end up with this
bizarre error:

Client found response content type of 'text/plain; charset=utf-8',
but
expected 'text/xml'.
The request failed with the error message:

Point a browser at your web service, and see if you can connect

Jeff
 
Back
Top