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.InvalidO perationExcepti on: /WebServices/myWebService.as mx Web
Service method name is not valid.
at System.Web.Serv ices.Protocols. HttpServerProto col.Initialize( )
at System.Web.Serv ices.Protocols. ServerProtocolF actory.Create(T ype 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(By Val sender As System.Object, ByVal e As
System.EventArg s) Handles Submit.Click
Dim myWS As New myWebReference. myWebService
Dim myDS As DataSet
Dim myResponseStr As String
Try
'Create Soap Header
CreateSoapHeade r(myWS)
myDS = myWS.GetStuff(M e.txtInput.Text )
myResponseStr = myDS.GetXml
txtOutput.Text = myResponseStr
Catch ex As Exception
Throw ex
End Try
End Sub
Public Sub CreateSoapHeade r(ByRef myWS As myWebReference. myWebService)
Dim myWSCredentials As myWebReference. Credentials
' Build Credentials.
If (Me.txtUserName .Text <"" AndAlso Me.txtPassword. Text <"") Then
myWSCredentials = New ConsumerComplai ntsWSWR.Credent ials
myWSCredentials .UserName = Me.txtUserName. Text
myWSCredentials .Password = Me.txtPassword. Text
End If
myWS.Credential sValue = myWSCredentials
End Sub
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.InvalidO perationExcepti on: /WebServices/myWebService.as mx Web
Service method name is not valid.
at System.Web.Serv ices.Protocols. HttpServerProto col.Initialize( )
at System.Web.Serv ices.Protocols. ServerProtocolF actory.Create(T ype 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(By Val sender As System.Object, ByVal e As
System.EventArg s) Handles Submit.Click
Dim myWS As New myWebReference. myWebService
Dim myDS As DataSet
Dim myResponseStr As String
Try
'Create Soap Header
CreateSoapHeade r(myWS)
myDS = myWS.GetStuff(M e.txtInput.Text )
myResponseStr = myDS.GetXml
txtOutput.Text = myResponseStr
Catch ex As Exception
Throw ex
End Try
End Sub
Public Sub CreateSoapHeade r(ByRef myWS As myWebReference. myWebService)
Dim myWSCredentials As myWebReference. Credentials
' Build Credentials.
If (Me.txtUserName .Text <"" AndAlso Me.txtPassword. Text <"") Then
myWSCredentials = New ConsumerComplai ntsWSWR.Credent ials
myWSCredentials .UserName = Me.txtUserName. Text
myWSCredentials .Password = Me.txtPassword. Text
End If
myWS.Credential sValue = myWSCredentials
End Sub
Comment