开发者

How do I access a workflow service in silverlight?

I have one worflow service named GetDataWorkflowService.xamlx that I want to use in Silverlight.

When I add a service reference to my application, it gives a message 'This Operation is not supported for the relative URI.' It still adds the reference, however.

When I use the referece:

Servicelient proxy=new ServiceClient();
proxy.GetDataCompleted += (o, a) => Debug.WriteLine("Result is " + a.Resul开发者_JAVA技巧t);
proxy.GetDataAsync(123);

I get the following error:

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.

I don't understand what's happening.


A few things:

  • What happens if you use the WCF Test Client to call GetData()? Do you get an error or does that work just fine. If you get an error here concentrate on the server parts.
  • What happens if you set a service reference from a console application and call your workflow service. Same error or does that work?
  • Is the workflow service hosted in the same web site as the Silverlight client? If not do you have the cross domain policy files setup correctly.
  • Assuming the WCF Test Client works. Open up fiddler and compare the request from your Silverlight client with that from the WCF Test Client. What is different?
  • Enable tracing on the server to see if there are any exceptions or warnings that might provide more insight to what is wrong.


Check your startup project to be sure you are starting a web project and not the Silverlight project. For more details see Troubleshooting Workflow Services / Silverlight on my blog

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜