首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

调用webservice 无响应有关问题

2013-07-04 
调用webservice 无响应问题?本帖最后由 jxdong1013 于 2013-06-28 18:02:14 编辑调用webservice 无响应问

调用webservice 无响应问题?
本帖最后由 jxdong1013 于 2013-06-28 18:02:14 编辑 调用webservice 无响应问题? 

服务代码如下:

    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    public class WebService1 : System.Web.Services.WebService
    {
        System.Speech.Synthesis.SpeechSynthesizer a = new System.Speech.Synthesis.SpeechSynthesizer();
        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }

        [WebMethod]
        public void Speak(string txt)
        {          
            a.Speak(txt);
            a.Dispose();
            a = null;
        }
    }

在客户端调用 HellowWorld 方法 正常。调用 Speak方法 无响应。求解?
我怀疑是使用了微软的 System.Speech.Synthesis.SpeechSynthesizer 这个类引起的,但是不知道如何解决?

我在做了一个WCF的服务,代码相同,是正常响应的。 c# speech webservice
[解决办法]
断点~调试~
[解决办法]
Web无法调用本地硬件
而且要WIN7系统才自带语音包,你是XP系统
最好不要在webserivce做这些东西,因为它不是为了这些设计的

弄清需求 合理设计
[解决办法]
a.SpeakText(txt);


[解决办法]
与之相关的语音库有吗。

热点排行