Reputation: 53
I have a asp.net MVC website which communicates to a SQL database through a web service. When set up in IIS it all works fine. I recently migrated the whole solution to Azure by publishing the Website and webservice as Web Apps. Under IIS the web.config of the website connects to the service endpoint using:
<client>
<endpoint address="http://localhost:7070/Services.svc"binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ITrain" contract="ServiceReference1.ITrain" name="BasicHttpBinding_ITrain"/>
</client>
In Azure i have changed this to:
<client>
<endpoint address="http://<sitename>.azurewebsites.net/Services.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ITrain" contract="ServiceReference1.ITrain" name="BasicHttpBinding_ITrain" />
</client>
The two web apps do not communicate. Should i be doing something differently or does the problem lie somewhere else?
Upvotes: 2
Views: 93
Reputation: 101
If you say the WSDL looked okay, the next thing I would recommend would be building a new simple Console app to try to talk to it. Use Add Service Reference in the Solution Explorer and provide the http://.azurewebsites.net/Services.svc URL. If Add Service Reference has a problem, you have some kind of WSDL error. But if it succeeds, your project will have auto-generated code to talk to that service. The example at https://msdn.microsoft.com/en-us/library/bb386386.aspx walks through this.
If the Console app succeeds in talking to the service, look very carefully at the generated app.config to see if it differs from your existing config files.
Ron Cain MSFT
Upvotes: 2