none
WCF Rest base servcie with https return The remote server returned an error: (407) Proxy Authentication Required RRS feed

  • Question

  • Hi,

    Note: With HTTP my servcie works fine without any error

    With HTTPS Issue:

    When I am trying to browse given servcie https://myservcie.com/myservice.svc/GetMetadata/10/2/

    I have verified using fiddler now I can see HTTPS response coming to fiddler.

    but on

    browser I am got given

    "Unable to download 1/ from www3.decison.com.

    Unable to open this Internet site.  The requested site is either unavailable or cannot be found.  Please try again later."

    Using Code :  This shows error 407

    WebClient ClientTest = new WebClient();
     
                ClientTest.OpenReadCompleted += new OpenReadCompletedEventHandler(ClientTest_OpenReadCompleted);
              
                string webrequestURIGeoExist = txtUrl.Text;

                ClientTest.OpenReadAsync(new Uri(webrequestURIGeoExist));

    void ClientTest_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
    {// I am getting error InnerException = {"The remote server returned an error: (407) Proxy Authentication Required."}
    }

    On fiddler

    Proxy Authorization Required


    Description: Authorization is required for access to this proxy

    Web.config---

    <system.serviceModel>
        <diagnostics>
          <messageLogging logEntireMessage="true"  logMessagesAtServiceLevel="true" ></messageLogging>
          <endToEndTracing activityTracing="true" propagateActivity="true" ></endToEndTracing>
                           <!--<messagelogging logentiremessage="true" logknownpii="true" logmalformedmessages="true" logmessagesatservicelevel="true" logmessagesattransportlevel="true"></messagelogging>-->

        </diagnostics>

        <services>

          <service name="MServices.Mervicehelper" behaviorConfiguration="ServiceHttpEnabled">
            <endpoint address="" binding="webHttpBinding" contract="MServices.iMServicehelper" bindingConfiguration="webHttpBinding" behaviorConfiguration="EndpBehavior">

            </endpoint>
     <endpoint address="mex" binding="mexHttpBinding"   contract="IMetadataExchange"/>
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost:8732/iMAPServicehelper/"/>
              </baseAddresses>
            </host>
          </service>

       


        </services>

     

        <bindings>
          <webHttpBinding>
            <binding name="webHttpBinding">
              <security mode ="Transport">

    <transport clientCredentialType ="None"></transport>

              </security>
            </binding>
          </webHttpBinding>
        </bindings>
        <behaviors>
          <serviceBehaviors>
            <behavior name ="ServiceHttpEnabled">
              <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
              <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
              <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>

     

     

          </serviceBehaviors>

          <endpointBehaviors>

            <behavior name="EndpBehavior">
              <webHttp helpEnabled="true"/>
            </behavior>
          </endpointBehaviors>

        </behaviors>

    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

      </system.serviceModel>

    Thanks in Advance.


    Rit

    Monday, February 11, 2013 11:10 AM

All replies

  • Hi,

    Set useDefualtWebProxy to true in your binding configuration.

    <system.net>
      <defaultProxy useDefaultCredentials="true" />
    </system.net>

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, February 12, 2013 8:55 AM
    Moderator
  • Thanks for taking your time for response.

    I add given tag inside as given below however this also did not work. please advice what could be reason, by call from my silverlight webclient I am getting 407 issue and i can see same on fidller.

    However if i am  directly browsing that servcie on browser I can see response coming on fiddler.

    Please provide pointer for same.

    I am using IIS6.0 with .netframework 4.0

    <configuration>

    <system.net> <defaultProxy useDefaultCredentials="true" /> </system.net>

    <system.serviceModel>
        <diagnostics>
          <messageLogging logEntireMessage="true"  logMessagesAtServiceLevel="true" ></messageLogging>
          <endToEndTracing activityTracing="true" propagateActivity="true" ></endToEndTracing>
                           <!--<messagelogging logentiremessage="true" logknownpii="true" logmalformedmessages="true" logmessagesatservicelevel="true" logmessagesattransportlevel="true"></messagelogging>-->

        </diagnostics>

        <services>

          <service name="MServices.Mervicehelper" behaviorConfiguration="ServiceHttpEnabled">
            <endpoint address="" binding="webHttpBinding" contract="MServices.iMServicehelper" bindingConfiguration="webHttpBinding" behaviorConfiguration="EndpBehavior">

            </endpoint>
     <endpoint address="mex" binding="mexHttpBinding"   contract="IMetadataExchange"/>
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost:8732/iMAPServicehelper/"/>
              </baseAddresses>
            </host>
          </service>

       


        </services>

     

        <bindings>
          <webHttpBinding>
            <binding name="webHttpBinding">
              <security mode ="Transport">

    <transport clientCredentialType ="None"></transport>

              </security>
            </binding>
          </webHttpBinding>
        </bindings>
        <behaviors>
          <serviceBehaviors>
            <behavior name ="ServiceHttpEnabled">
              <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
              <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
              <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>

     

     

          </serviceBehaviors>

          <endpointBehaviors>

            <behavior name="EndpBehavior">
              <webHttp helpEnabled="true"/>
            </behavior>
          </endpointBehaviors>

        </behaviors>

    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

      </system.serviceModel>

    </configuration>


    Rit


    • Edited by Ritu.Net Wednesday, February 13, 2013 6:36 AM Spellmistake
    Wednesday, February 13, 2013 6:19 AM
  • Hi,

    Please enable tracing for your service to help to dignose the actual issue and use SvcTraceViewer.exe to helps you analyze the diagnostic traces.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, February 13, 2013 9:18 AM
    Moderator