0

I am trying to connect to core service giving a particular user's credentials most of the time it works but sometimes I get proxy 407 error (as written in title of this question), this auto get resolved after 10-15 minutes and then I am able to connect to core service again. Is there a permanent solution for this issue? I know this is a simple question but I can't give credentials as System.Net.CredentialCache.DefaultCredentials; or as other solution available on web. Below is the code of my connection to core service, this problem occurs even if I call client.Close() after each operation.

core_service.ServiceReference1.SessionAwareCoreService2010Client client = new SessionAwareCoreService2010Client(); 
    client.ClientCredentials.Windows.ClientCredential.UserName = "myUserName"; 
    client.ClientCredentials.Windows.ClientCredential.Password = "myPassword"; client.Open();

 if (client.State == System.ServiceModel.CommunicationState.Opened)
            {
                // some code                }
Nuno Linhares
  • 10,214
  • 1
  • 22
  • 42
SDL Developer
  • 612
  • 1
  • 5
  • 15
  • Haven't seen that one before, it looks like a network/.NET error rather than the Core Service's. Is there anything logged server side? – Nuno Linhares Sep 06 '12 at 12:40

3 Answers3

3

Try this instead of "SessionAwareCoreService2010Client" use "CoreService2010Client"

var objclient = new CoreService2010Client();
            objclient.ClientCredentials.Windows.ClientCredential.UserName = Generation.Settings.Username;
            objclient.ClientCredentials.Windows.ClientCredential.Password = Generation.Settings.Password;
            objclient.Open();
Shekhar Gigras
  • 654
  • 3
  • 5
  • I tried using CoreService2010Client and now same proxy error is not coming after opening of connection i.e. client.Open() but now it is coming at client.GetDefaultData(), is there any other way to avoid this? This error (proxy one) only occurs at local machine never it come on server where SDL tridion is installed. – SDL Developer Sep 07 '12 at 04:43
  • what object you want to get, you can get all information for a particular uri – Shekhar Gigras Sep 07 '12 at 08:14
  • I have not writen comment about getting item but that when GetDefaultData() is about to call proxy error comes with your suggest CoreService2010Client class object, even when state of connection is opened it is giving proxy error. Have you ever faced this. – SDL Developer Sep 09 '12 at 01:45
2

Sometimes it happens when you use Fiddler type web debugging tool. Can you try to set the proxy credentials directly to find out the reason as below -

request.Proxy = new WebProxy("proxyIp", 8080);
 request.Proxy.Credentials = CredentialCache.DefaultCredentials; 

Note:- above suggestion is based on my .net experience not on tridion core service.

Ram Saurabh
  • 1,586
  • 8
  • 27
0

Might be the solution is in increasing Timeout of an endpoint I have update Timeout to 15 minutes from existing 1 minutes, below is the code of a particular endpoint of app.config

    <binding name="wsHttp_2010" closeTimeout="00:15:00" openTimeout="00:15:00"
                receiveTimeout="00:10:00" sendTimeout="00:15:00" bypassProxyOnLocal="false"
                transactionFlow="true" hostNameComparisonMode="StrongWildcard"
                maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                allowCookies="false">

Lets ses if this works, please suggests if I need to do any other changes in config file.

SDL Developer
  • 612
  • 1
  • 5
  • 15