2011-08-25 23 views
1

我有一個我想在Silverlight中使用的名爲GetDataWorkflowService.xamlx的worflow服務。如何在Silverlight中訪問工作流服務?

當我向我的應用程序添加一個服務引用時,它會給出一條消息'This Operation is not supported for the relative URI'。但是,它仍然增加了參考。

當我使用referece:

Servicelient proxy=new ServiceClient(); 
proxy.GetDataCompleted += (o, a) => Debug.WriteLine("Result is " + a.Result); 
proxy.GetDataAsync(123); 

我得到以下錯誤:

An error occurred while trying to make a request to URI 'http://localhost:1234/GetDataWorkflowService.xamlx'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details.

我不明白髮生了什麼。

+0

「請參閱內部例外瞭解更多詳情。」什麼是內在的例外? – Will

回答

0

有幾件事情:

  • 如果你使用WCF測試客戶端調用的GetData()會發生什麼?你有沒有遇到錯誤,或者做得很好?如果您在此處出現錯誤,請專注於服務器部件。
  • 如果您從控制檯應用程序設置服務引用並調用您的工作流服務,會發生什麼情況。相同的錯誤還是有用?
  • 工作流服務是否與Silverlight客戶端位於同一網站中?如果沒有,您是否正確設置了跨域策略文件。
  • 假設WCF測試客戶端工作。打開fiddler並將Silverlight客戶端的請求與WCF Test Client的請求進行比較。有什麼不同嗎?
  • 在服務器上啓用跟蹤以查看是否有任何異常或警告可以提供更多洞察錯誤的信息。
相關問題