现在的位置: 首页 > 综合 > 正文

silverlight问题,笑死我了

2013年12月05日 ⁄ 综合 ⁄ 共 4500字 ⁄ 字号 评论关闭
http://silverlight.net/forums/t/10852.aspx
----------------------------------------------------------------------------------------
你好:喜欢Silverlight的朋友们
我已经建成了一个WCF的安全服务,它能验证并且返回验证标识等内容,并在验证后提供了调用接口以完成其它功能。现在,我想整合它到 Silverlight 2 Beta 1,但是在整合过程中遇到了一些问题。程序抛出了异常,并且我不能发现错在哪里。我已经找到很多文章,看了很多博客,etc etc etc etc关于SL2及WCF的文章(应当是四个等等吧,哈哈。笑死我了,俺以为俺不明白,没想到他也不懂),但是都没有解决这个问题。Hmm,请问谁能帮助我呢?

下面是
1.我将WCF宿主在IIS7(Vista)上,访问http://localhost/WCF/SecurityService.svc是正常的。
2.在一些控制台程序中,我能正常应用上面提供的服务。
3.我没有进行跨域访问,因为所有的应用都运行在http://localhost/.........这个域中。
---------

一个'System.ServiceModel.ProtocolException'异常在System.ServiceModel.dll中被抛出,但是在用户代码中无法捕捉到它。

Additional information: [UnexpectedHttpResponseCode]
Arguments:Not Found
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=2.0.30226.2&File=System.ServiceModel.dll&Key=UnexpectedHttpResponseCode

----

上帝与我们同在,


================================================================================================

Hello Silverlight World,

I have successfully created a WCF security service which can authenticate users and return tokens etc, which can be used to call subsequent methods on the service interface. Now, I would like to integrate this with Silverlight 2 Beta 1, but I am facing problems getting the integration between SL2 and WCF to work. I keep gettting the exception below thrown at me and can't figure out what I am doing wrong. I have read articles, blogs etc etc etc etc. on SL2 and WCF, but nothing about this error. Hmm, please could someone help me with this one?

 Here is where I am:

 1) I'm hosting the WCF service in IIS7 (Vista) which works when I access http://localhost/WCF/SecurityService.svc

 2) I can use the above service using a simple console app

 3) I am not facing any cross-domain issues because everything runs on http://localhost/.........

-----

An exception of type 'System.ServiceModel.ProtocolException' occurred in System.ServiceModel.dll but was not handled in user code

Additional information: [UnexpectedHttpResponseCode]
Arguments:Not Found
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=2.0.30226.2&File=System.ServiceModel.dll&Key=UnexpectedHttpResponseCode

----

All the best,
Jan

你好, 简
 
我想你看到的这个错误可能是WEB Service抛出的,我经历过这种事Web Service抛出异常的错误并得到了类似的住处。你可以Debug Web Service,或者加上try...catch语句。

Nokola
=====================================================================
Hello Jan,

 I think the error message you are seeing is because the web service throws an exception. I tried a web service throwing exception and got the same message. You could either debug the web service or put a try...catch and see if it works

 Nokola

另一个可能性是服务的终结点地址不匹配。
========================
Another possible issue may be that the EndPointAddress of the service does not match with the address in the service configuration when you click on the service reference and select "configure". You will have to use the service client constructor that accepts Binding and EndpointAddress (not the default constructor). This might work.

我也遇到了相同的问题,Web Service在我的机器上(地址是正确的) .当我检查WEB SERVICE的时候,发现它工作得非常正常,还有哪些可能的情况呢?
谢谢
======================================================================
I have the same problem!

The web service is on my machine (the address is correct) and when I check the web service alone it works great. What else could it be?

 Thanks,

Aviv.

I have the same problem!

The web service is on my machine (the address is correct) and when
I check the web service alone it works great. What else could it be?

 Thanks,

Aviv.

For those who have problems with web services. Please refer to this quick start.

A few notes:

For WCF services, unfortunately currently Silverlight doesn't support configuration files. So you have to create the Binding and EndpointAddress in code. Refer to that quick start.

For ASMX services, the address is included in the proxy, so you don't need to do anything.

For WCF services, currently only BasicHttpBinding is supported.

For cross domain scenarios, you must create a policy file on the server. Refer to http://msdn2.microsoft.com/en-us/library/cc197955(VS.95).aspx for more information.

shanaolanxing - Please mark the posts as answers if they help and unmark if they don't.

对于在Web Services中遇到问题的朋友们,请看入门指南。
几点应当注意的问题:
对于WCF服务,非常不幸的是当前版本的Silverlight还不支持配置文章。所以你必须用代码来绑定终结点地址(EndpointAddress),请参考入门指南。

对于WCF服务,当前只有BasicHttpBinding协议被支持。
对于跨域的情况,你必须在服务器上建立一个策略文件,参考http://msdn2.microsoft.com/en-us/library/cc197955(VS.95).aspx for more information.

对于在Web Services中遇到问题的朋友们,请看入门指南。
几点应当注意的问题:
对于WCF服务,非常不幸的是当前版本的Silverlight还不支持配置文章。所以你必须用代码来绑定终结点地址(EndpointAddress),请参考入门指南。

对于WCF服务,当前只有BasicHttpBinding协议被支持。
对于跨域的情况,你必须在服务器上建立一个策略文件,参考http://msdn2.microsoft.com/en-us/library/cc197955(VS.95).aspx for more information.  

==================================
这个应当是可以的吧,我没有试。

 

抱歉!评论已关闭.