阅读背景:

Amazon Elastic Cloud和Silverlight部署

来源:互联网 

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

我们正在尝试在亚马逊EC2上托管一个silverlight应用程序。

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.

我可以使用它来提供.xap文件,但是我在使用silverlight应用程序所需的web服务时遇到了一些麻烦。

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

通常我会在visual studio中添加一个服务引用并输入webservice的URL,比如https://url.com/ServiceName.svc,我会生成一个代理。

However with the Amazon Elastic Cloud instance entering the url

但是,随着Amazon Elastic Cloud实例进入网址

https://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

如果我进入

https://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

进入Internet Explorer地址栏我得到一个wsdl描述 - 但它在配置中有这个部分似乎有点奇怪

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

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

schemaLocation https://ip-0af8db15/AuthService.svc?对我来说看起来不是正确的地址?

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

任何人都知道我是否需要配置某些内容或更改内容以访问Amazon EC2上的WCF Web服务?

Edit: Should note : Windows Server 2003, IIS 6.0

编辑:应注意:Windows Server 2003,IIS 6.0

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

编辑:看起来像ip-0af8db15是机器名称

3 个解决方案

#1


Just in case someone went into the same problem: on proxy generation try remove the https:// at the beginning of the EC2 Address and then in the Service Config replace the part "ip-0af8db15" with the EC2 Address.

为了防止有人遇到同样的问题:在代理生成时尝试删除EC2地址开头的https://然后在服务配置中用EC2地址替换“ip-0af8db15”部分。

Hope it helped.

希望它有所帮助。

#2


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

我部署了相同的场景,没有任何问题。为什么不尝试使用IP地址而不是动态主机名:

https://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.

如果将无法访问的服务器名称放入VS.Net生成的代理中,则可以在自动生成的configuration.svcinfo中手动调整它。或者,您可以以编程方式设置URL,这是一个更好的选项,因为如果您需要重新生成代理,它将不会被覆盖。

BasicHttpBinding binding = new BasicHttpBinding();
EndpointAddress address = new EndpointAddress("https://174.129.139.48/AuthService.svc");
YourProxy yourProxy = new YourProxy(binding, address);

#3


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

这个帖子(特别是最后两个帖子)帮助我解决了这个问题。

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


分享到: