2

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?

6
  • 1
    This might be a stupid question, but do you have the endpoint defined either in a web.config file, or a file that is pointed to in the web.config file? Commented Mar 28, 2011 at 14:26
  • @taylonr - not a stupid question at all, probably the most likely cause. Next most likely is that the server the ASP.NET site is running on can't see the outside world correctly, but I'd check the Web.Config first to make sure the <system.serviceModel><client> section is present and correct. Commented Mar 28, 2011 at 14:44
  • It is present under serviceModel <client> <endpoint address="api.microsofttranslator.com/V2/soap.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_LanguageService" contract="BingTranslateService.LanguageService" name="BasicHttpBinding_LanguageService"/> </client> Commented Mar 28, 2011 at 14:55
  • I think the only difference is the context of call, may be there is something from asp.net side Commented Mar 28, 2011 at 14:55
  • Is your ASP.NET site located in your dev machine, or do you have it on a test server? If on a test server, does that server have access to the web? Or even any restrictions for that matter? Commented Mar 29, 2011 at 11:13

3 Answers 3

4
+25

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.

Sign up to request clarification or add additional context in comments.

1 Comment

do you use a proxy? then you should also specify it on your binding.
3

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.

Comments

0

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.

1 Comment

Simply I create object of the service and do call

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.