2011-08-25 130 views
0

我在浏览器中键入我的wcf(svc)服务名称,并显示以下内容: 此服务的元数据发布当前已禁用。 .... ....silverlight服务跨域错误

我的服务地址: http://www.farasanjtelemetry.com/service1.svc

但是当我运行我的测试SL的应用程序(调用该服务),我得到跨域的错误,这是怎么回事? 绑定?终点?跨域文件?我已经在服务器C:\ inetpub \ wwwroot中复制了两个XML文件,并且在我的service1.svc旁边,我应该检查哪些内容? 我的测试SL应用程序地址: http://www.farasanjtelemetry.com/SLServiceTestTestPage.html

现在我该怎么办?

回答

2

检查您的ServiceReferences.ClientConfig,您没有更新您的端点地址。 Silverlight应用程序正在搜索服务

<endpoint address="http://localhost:80/Service1.svc" binding="basicHttpBinding" 
      bindingConfiguration="BasicEndpoint" contract="ServiceReference1.Service1" 
      name="CustomBinding_Service1" /> 

更正它,你应该没问题。

BTW:检查你的录取率,否则它可能会阻止其他用户帮助你在未来

用以下替换您ServiceReferences.ClientConfig:

<configuration> 
<system.serviceModel> 
    <bindings> 
     <customBinding> 
      <binding name="CustomBinding_Service1"> 
       <binaryMessageEncoding /> 
       <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" /> 
      </binding> 
     </customBinding> 
    </bindings> 
    <client> 
     <endpoint address="http://www.farasanjtelemetry.com/service1.svc" binding="basicHttpBinding" 
      contract="ServiceReference1.Service1" name="ServiceReference1.Service1" /> 
    </client> 
</system.serviceModel> 

比你的应用程序将工作,因为你可以从你的机器到达http://www.farasanjtelemetry.com/service1.svc

+0

感谢dominik,但现在我得到另一个错误:底层通道工厂无法创建....它是我的clientconfig:端点地址=“http:// localhost:80/Service1.svc”binding =“basicHttpBinding” bindingConfiguration =“BasicEndpoint”contract =“ServiceReference1.Service1” name =“CustomBinding_Service1”/> –

+0

首先,如果它没有帮助你,我并不是故意接受答案。检查你以前的问题,并标记适当的答案。其次,你看到的内在异常是什么? – Dominik

+0

好的dominik我会这样做肯定,谢谢你的警告,我想知道什么是正确的client.config?有什么地方我可以做一个好的和标准的?内在异常是什么意思? –