views:

234

answers:

2

We are experimenting with hosting a silverlight application on Amazons EC2.

I can get it to serve up the .xap file, but I'm having some trouble with using the webservices that the silverlight application requires.

Usually I would add a service reference in visual studio and enter the URL for the webservice, something like http://url.com/ServiceName.svc and a proxy would be generated for me.

However with the Amazon Elastic Cloud instance entering the url

http://ec2-174-129-139-48.compute-1.amazonaws.com/AuthService.svc

Gives the error "is not recognised as a known document type"

And if I enter

http://ec2-174-129-139-48.compute-1.amazonaws.com/AuthService.svc?wsdl

Into the internet explorer address bar I get a wsdl description - but it has this part in the config which seems a bit odd

<wsdl:types>
<xsd:schema targetNamespace="http://asp.net/ApplicationServices/v200/Imports"&gt;
  <xsd:import schemaLocation="http://ip-0af8db15/AuthService.svc?xsd=xsd0" namespace="http://asp.net/ApplicationServices/v200" /> 
  <xsd:import schemaLocation="http://ip-0af8db15/AuthService.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" /> 
  </xsd:schema>
  </wsdl:types>

The schemaLocation http://ip-0af8db15/AuthService.svc? doesn't look like the right address to me?

Anyone know if I need to configure something or change something to access WCF webservices on Amazon EC2?

Edit: Should note : Windows Server 2003, IIS 6.0

Edit: Looks like ip-0af8db15 is the machine name

A: 

I have the same scenario deployed with no issues. Why don't you try using the IP address instead of the dynamic hostname:

http://174.129.139.48/AuthService.svc

Edit:

If an unreachable server name is being put into the VS.Net generated proxy then you can adjust it manually in the automatically generated configuration.svcinfo. Alternatively you can set the URL programatically, this is a better option since it won't get over written if you need to re-generate the proxy.

BasicHttpBinding binding = new BasicHttpBinding();
EndpointAddress address = new EndpointAddress("http://174.129.139.48/AuthService.svc");
YourProxy yourProxy = new YourProxy(binding, address);
sipwiz
Some problem - WSDL is returning the machine name and Visual Studio cannot find the reference.
JSmyth
A: 

This thread (particularly the last two posts) helped me to solve this problem.

http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/c7fd51a2-773e-41d4-95a0-244e925597fe/

JSmyth