0

I try to connect to https web service over proxy at my end.

below is code snippet

    Dim strProxyURL As String = "http://myproxy.com"
    Dim mypingRequest As New pingRequest()
    Dim httpUri As New Uri("https://mysite.com")
    Dim mybinding As New WSHttpBinding()
    Dim remoteAddress As New EndpointAddress(httpUri)

    mybinding.UseDefaultWebProxy = True

    mybinding.BypassProxyOnLocal = True


    mybinding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.Windows

    mybinding.MessageEncoding = WSMessageEncoding.Mtom
    mybinding.TextEncoding = System.Text.Encoding.UTF8
    mybinding.Security.Mode = SecurityMode.TransportWithMessageCredential 'TransportWithMessageCredential

    mybinding.Security.Message.ClientCredentialType = MessageCredentialType.Windows

    Dim myMBClient As New v1_PortTypeClient(mybinding, remoteAddress)

    myMBClient.ClientCredentials.Windows.ClientCredential.UserName = "username"
    myMBClient.ClientCredentials.Windows.ClientCredential.Password = "pwd"

    myMBClient.ping()

when I use proxy I error proxy authentication required error if I remove proxy from desktop and use direct internet then I go to site web service but cannot login even thought the gave correct username and password

John Saunders
  • 160,644
  • 26
  • 247
  • 397
  • issue is resolved. WCF web services uses Custom binding hence error. also i have add webrequest.defaultwebproxy and credentials to access via web proxy at requesting client side http://stackoverflow.com/questions/187001/wcf-custom-http-proxy-authentication – user3459754 Apr 02 '14 at 04:32

1 Answers1

0

issue is resolved. WCF web services uses Custom binding hence error. also i have add webrequest.defaultwebproxy and credentials to access via web proxy at requesting client side WCF Custom Http Proxy Authentication

Community
  • 1
  • 1