2011-08-25 107 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?有什麼地方我可以做一個好的和標準的?內在異常是什麼意思? –