使用 ServerXMLHTTP 超时发布 xml

发布于 2024-07-11 08:54:12 字数 930 浏览 8 评论 0原文

我正在两个网站上工作。 一种是现有的经典 asp 网站,它将 xml 发布到新的 asp.net (.net 3.5) 网站。 经典的 asp 站点使用 vbscript 中的 msxml 的 serverxmlhttp 对象来发送此 xml。 整个事情一直有效,直到我对 ASP.NET 站点进行了看似无关的更改。

当我添加几行使用 System.Speech.Synthesis 从文本生成 wav 文件的代码时,经典的 asp 网站 serverxmlhttp.send 命令超时。 据我所知,asp.net 页面工作正常,它可以通过几行新代码而没有出现问题(生成了 wav 文件)。 导致问题的几行语音代码在超时之前就已完成。

看起来 asp.net 页面实际上正在将某种确认发送回不再发送的经典页面。 我还应该指出,语音代码抛出了一个异常,表示它需要异步,我通过将 Async="true" 添加到 . 然而,当 async="true" 时它可以工作,只是那些语音线破坏了它。 “问题代码”只是

SpeechSynthesizer speaker = new SpeechSynthesizer();
speaker.Volume = 100;
speaker.SelectVoiceByHints(System.Speech.Synthesis.VoiceGender.Female, System.Speech.Synthesis.VoiceAge.Adult, 0);

try
{
    speaker.SetOutputToWaveFile("c:\\test\\output.wav");
}
catch (Exception ex)
{
    retVal = false;
}

speaker.Speak(msgText);
speaker.SetOutputToDefaultAudioDevice();

有人对可能出错的地方或者我可以用什么来帮助调试这个有什么建议吗?

I'm working on two websites. One is an existing classic asp site which posts xml to a new asp.net (.net 3.5) website. The classic asp site is using msxml's serverxmlhttp object in vbscript to send this xml over. The whole thing works until I make a seemingly unrelated change to the asp.net site.

When I add a few lines of code that uses System.Speech.Synthesis to generate a wav file from text the classic asp websites serverxmlhttp.send command times out. As far as I can tell the asp.net page is working fine, it makes it through the few new lines of code without an issue (the wav file is generated). The few lines of speech code causing the issue is done well before the timeout.

It seems like the asp.net page was actually sending some sort of acknowledgement back to the classic page which is no longer getting sent. I should also point out that the speech code was throwing an exception saying it needed to be asynchronous which I fixed by adding Async="true" to the . However, it works when async="true", it's just those speech lines that break it. The "problem code" is just

SpeechSynthesizer speaker = new SpeechSynthesizer();
speaker.Volume = 100;
speaker.SelectVoiceByHints(System.Speech.Synthesis.VoiceGender.Female, System.Speech.Synthesis.VoiceAge.Adult, 0);

try
{
    speaker.SetOutputToWaveFile("c:\\test\\output.wav");
}
catch (Exception ex)
{
    retVal = false;
}

speaker.Speak(msgText);
speaker.SetOutputToDefaultAudioDevice();

Does anyone have any suggestions on what could be wrong or what I could use to help debug this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

长发绾君心 2024-07-18 08:54:12

<块引用>

看起来 asp.net 页面实际上正在向不再发送的经典页面发送某种确认

听起来您应该对其进行更多调查,以便您可以告诉我们服务器之前和之后的响应行为。 另请指出抛出的异常。

我的猜测是这些 API 在服务进程中不能很好地工作。 但我真的不知道。 我很好奇这个异常,你不清楚你做了什么异步。

It seems like the asp.net page was actually sending some sort of acknowledgement back to the classic page which is no longer getting sent

It sounds like you should investigate it more so you can tell us server's response behavior before and after. Also please indicate the exception thrown.

My guess would be these APIs don't work well in a service process. I have no clue though really. I'm curious about the exception, you're not clear about what you made async.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文