Title: Http protocol violation

I am in the midst of developing a VB.NET SOAP client. The problem I am having is consuming the web service over HTTPS with BASIC authentication. My client works fine over HTTP with BASIC authentication, and also works over HTTPS without BASIC authentication. When I try to consume the web service over HTTPS with BASIC authentication I get the following error:

        The underlying connection was closed: The server committed an HTTP protocol violation.

Has anybody experienced anything like this? A snippet of my code follows, I left out the full URl on purpose:

<System.Web.Services.WebServiceBindingAttribute( _
 Name:="soapClient", _
 [Namespace]:="urn:soapClient")> _
Public Class soapClient
    Inherits System.Web.Services.Protocols.SoapHttpClientProtocol

    ' Constructor: pass in user/app userid and passwd when creating new soapClient
    <System.Diagnostics.DebuggerStepThroughAttribute()> _
    Public Sub New(ByVal myCache As CredentialCache)
        MyBase.New()

        ' HTTPS
        Me.Url = "https://"

        ' HTTP
        'Me.Url = "http://"

        Me.Credentials = myCache
    End Sub

    ' Web service
    <System.Diagnostics.DebuggerStepThroughAttribute(), _
    System.Web.Services.Protocols.SoapDocumentMethodAttribute( _
     "urn:soapClient/echo", _
     RequestNamespace:="urn:Echo", _
     ResponseNamespace:="urn:Echo", _
     Use:=System.Web.Services.Description.SoapBindingUse.Encoded, _
     ParameterStyle:= _
      System.Web.Services.Protocols.SoapParameterStyle.Wrapped)> _
    Public Function echo(ByVal Name As String) As String
        Dim results() As Object = Me.Invoke("echo", New Object() {Name})
        Return CType(results(0), String)
    End Function

End Class


Any help would be greatly appreciated.

Thanks,

Toby





Reply via email to