Amazon Elastic Cloud 和 Silverlight 部署

发布于 2024-07-15 17:56:19 字数 1566 浏览 2 评论 0原文

我们正在尝试在 Amazon EC2 上托管 silverlight 应用程序。

我可以让它提供 .xap 文件,但我在使用 silverlight 应用程序所需的 Web 服务时遇到了一些问题。

通常我会在 Visual Studio 中添加服务引用并输入 Web 服务的 URL,例如 http://url。 com/ServiceName.svc 并且将为我生成一个代理。

但是,当 Amazon Elastic Cloud 实例输入 URL

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

给出错误“未识别为已知文档类型”

如果我输入

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

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

<wsdl:types>
<xsd:schema targetNamespace="http://asp.net/ApplicationServices/v200/Imports">
  <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>

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

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

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

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

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">
  <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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

倾听心声的旋律 2024-07-22 17:56:19

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

希望有帮助。

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

Hope it helped.

混浊又暗下来 2024-07-22 17:56:19

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

http://174.129.139.48/AuthService。 svc

编辑:

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

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

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);
浅忆 2024-07-22 17:56:19

这篇文章(特别是最后两篇文章)帮助我解决了这个问题。

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

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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文