Just a small summary of the infrastructure. I have a webservice running on a server in India only accessible through the companies internal network. I'm located in Europe.
The webservice is hosted in its own windows service, so no IIS.
When starting the client the first call allways takes approx 22 sec., this is a simple "ping" operation, just asking if the server is there, so no logic on the server that takes any time.
I have tried this solution First call to a .net webservice is slow with a bypass list. But that doesn't seem to work, unless it's me doing something wrong ?
<bypasslist>
<add address="[a-z]+\.company_name\.com"/>
</bypasslist>
Where the server address is staging.company_name.com
I also tried the other solution that has been suggested in the post, but still no luck.
<configuration >
<system.net>
<defaultProxy>
<proxy bypassonlocal="true" usesystemdefault="false" />
</defaultProxy>
</system.net>
</configuration>
Using fiddler I can see that the above apparently works, because this results in fiddler not being able to capture the traffic.
All the following webservice calls on the client are handled within short time less than 1 sec.
What / How can I reduce the first calls delay ?
UPDATE
This wasn't due to problems with WCF this is a routing / DNS problem on our network in the company....
Related
I need to configure a default proxy to enable Application Insights.
In an ASP.NET Web Api the default proxy can be set in the web.config like below:
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true">
<proxy proxyaddress="someaddress" bypassonlocal="True" />
</defaultProxy>
</system.net>
With this setting AI works fine. Unfortunately I could not find an option to set the proxy in appsettings.json. Is there any possibility to define the default proxy in an ASP.NET Core Web API?
Or do I have to configure the proxy in IIS, when the application is getting hosted with it?
Edit:
I am setting the default proxy now like this:
WebRequest.DefaultWebProxy = new WebProxy(new Uri("someaddress"), true)
{
UseDefaultCredentials = true
};
When getting the proxy with
WebRequest.DefaultWebProxy.GetProxy(new Uri("https://dc.services.visualstudio.com/v2/track"))
it returns the correct proxy.
Strange things happens when Fiddler is running.
As soon as Fiddler is running the application is logging successfully to AI. When closing Fiddler the logging breaks again.
Has anyone an idea?
Do you mean you want to configure HttpClient proxy globally?
If so, I am afraid it is impossible. You may consider creating an encapsulate class with accepting Proxy configuration and return a HttpClient, you could load the configuration from appsettings.json or anywhere
Perhaps your traffic is going through Fiddler Proxy so when Fiddler shuts down so as your connection to other services.
I am making an asynchronous call to an .asmx web service and I am constantly getting a timeout. It doesn't matter what time is set the timeout on the binding in the client it is always exceeded.
<binding
name="xxxxxxxxx" closeTimeout="00:20:00" openTimeout="00:20:00"
receiveTimeout="00:20:00" sendTimeout="00:20:00"/>
The web method invokes two stored procedures which have no parameters. I have run them manually and they both run successfully, taking 31 seconds and 6 minutes.
Taking this into account I would expect a time-out of 10 minutes to be more than enough and have even tried 20 minutes but they both time-out.
I have set the executionTimeout property of httpRuntime to 600 in the web.config and made sure debug=false, but I am still getting this error.
<httpRuntime executionTimeout="600"/>
<compilation debug="false" targetFramework="4.5">
Can anybody help?
UPDATE:
I am calling from a winforms application.
If I run the web service manually from the browser I get a timeout as well:
UPDATE 2:
Upped the executionTimeout to 800 and I can now run the web service successfully via the browser, but still getting the error when I call it from the desktop application.
UPDATE 3:
I added an old style, non-WCF based web reference and I still get the timeout.
I have got the a service with the following topology.
A (Web application) ---calls---> B (Local Web Api) ---calls---> C (Remote Web Api)
I am trying to capture the traffic from B to C in Fiddler, but nothing is logged.
B is a web site hosted locally on my dev box in IIS. It's running on an app pool with a credential other than mine as it has a different set of permissions. Traffic going out from B is not getting logged, even after I have done the following redirect:
<system.net>
<defaultProxy
enabled = "true"
useDefaultCredentials = "true">
<proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />
</defaultProxy>
What can I do to capture traffic leaving B?
The problem is that the .NET Framework is hardcoded to bypass the proxy for localhost addresses. Change the target address to localhost.fiddler and the traffic will be captured.
Referencing this answer, I'm attempting to establish a proxy connection for a service reference, but am having trouble verifying that it's actually being used.
In my app.config, I have
<system.net>
<defaultProxy useDefaultCredentials="true">
<proxy
usesystemdefault="False"
proxyaddress="http://proxyaddresst.com:80"
bypassonlocal="False"/>
</defaultProxy>
</system.net>
but would like to be able to list the address of the proxy being used in the program itself, through
Console.WriteLine(DateTime.Now.ToString("hh:mm:ss.fff") + " Proxy: " + ???);
Is there a way to do this? It seems simple, but so did setting up the proxy in the first place, and the program isn't working as expected. I'd like to either verify the proxy is in use (and discount it as necessary) or verify that it isn't (and then look for another way to integrate it).
Why is it that for some of my web services, I get test forms, so I can see the generated XML data, but for other web services, I get a message saying "The test form is only available for requests from the local machine."?
Both times, I am connecting to the URL of the web-service from a client side browser and all web services are created with C#, .NETÂ 3.5.
I googled for "The test form is only available for requests from the local machine."
There were many results, and the consensus is to add these nodes to the web.config file of the web service. I haven't tried this solution yet, but you can check to see if your web services that shows the test form remotely has this that have these nodes in the web.config. Or, you can add it to the web services that give this message and see if the test form starts appearing remotely.
<configuration>
<system.web>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
</system.web>
</configuration>
Here are some of the search results
Stack Overflow: The test form is only available for requests from the local machine.
GeeksWithBlogs (archived on the Internet Wayback Machine): "The test form is only available for requests from the local machine"
Microsoft support: INFO: HTTP GET and HTTP POST Are Disabled by Default