changing includetimestamp on basichttpbinding with httpproxy RRS feed

  • Question

  • I'm having a problem adding an httpproxy to a wcfproxy that uses httpbinding but, also has a includetimestamp = false requirement.

    Ok, firstly, here's my config...

            <binding name="dpsauthenticationSoap" closeTimeout="00:10:00"
                openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
                allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
              <security mode="TransportWithMessageCredential">
                <message clientCredentialType="UserName" />

    Any the Code.

    Dim Auth As DPSAuth.dpsauthenticationSoapClient ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 Auth = New DPSAuth.dpsauthenticationSoapClient() Auth.ClientCredentials.UserName.UserName = CompanyUserID Auth.ClientCredentials.UserName.Password = CompanyPassword Dim aElements As BindingElementCollection = Auth.Endpoint.Binding.CreateBindingElements() Dim aSecurityBindingElement As SecurityBindingElement = aElements.Find(Of SecurityBindingElement)() aSecurityBindingElement.IncludeTimestamp = False Auth.Endpoint.Binding = New CustomBinding(aElements) Dim Prx As BasicHttpBinding = Auth.Endpoint.Binding Prx.ProxyAddress = New Uri(proxyServer + ":" + proxyPort.ToString) Prx.BypassProxyOnLocal = False Prx.UseDefaultWebProxy = False

    It fails on the 4th line from the bottom, as the endpoint binding is now a custom binding..  how do I change it to allow me to set the proxy details?

    Tuesday, April 30, 2013 1:15 PM


  • Found the answer in the end, didn't need to mess about with changing everything to a custom binding in the config, I just had to apply the proxy setting before converting the endpoints to a custom binding to apply the  includetimestamp setting.
    • Marked as answer by Adrian Parker Wednesday, May 1, 2013 4:44 PM
    Wednesday, May 1, 2013 4:44 PM

All replies