Ahmed
Ahmed

Reputation: 7238

Calling web service from asp.net causes exception but from windows app does not?

I have an asp.net site that uses Bing Translate Web service(http://api.microsofttranslator.com/V2/Soap.svc)

The code that calls the service causes exception (There was no endpoint listening at http://api.microsofttranslator.com/V2/soap.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.)

But the same code works from windows app.

Code:

BingService.LanguageServiceClient client = new BingService.LanguageServiceClient();
res = client.Translate(BingAppID, "text", "en", "ar", "text/plain", "general");

I suspect it may be from policy on my domain (iis or somethinng like that) as I tried to use another internet connection (outside domain, normal DSL without firewall) it works fine!! but how can this policy does not apply when I run windows app?

Upvotes: 2

Views: 1052

Answers (3)

Rudi
Rudi

Reputation: 3228

Also check the identity of your application pool running the website. If it is running under a LocalSystem or LocalService account, it can not access external resources (such as the internet web service). Reconfiguring the application pool (or better yet, creating a new dedicated app-pool) using the NetworkService account might solve the problem in that case.

Upvotes: 4

Chad
Chad

Reputation: 1562

You could have the application on a webserver that does not allow access beyond your intranet.

You may also need to look into Impersonation You may need that to get through your firewall.

Upvotes: 3

Steve Wellens
Steve Wellens

Reputation: 20620

Is it possible that in the Windows application the proxy stays instantiated but in the web application the proxy goes out of scope and is recreated between requests? You may need to keep the proxy instantiated between requests to keep a 'connection' established.

Upvotes: 0

Related Questions