当前位置:编程学习 > C#/ASP.NET >>

windowservice 访问 webservice 的问题

目前的情况是这样,webservice部署在一台机器A上,windowservice部署在机器B上,要求我从C机器作为客户端来调用B机器的windowservice,B机器windowservice再调用A机器的webservice,获取返回值.
但是现在的问题是windowservice访问webservice有时会出问题(即windowservice在有的机器上可以访问webservice,而在另一台机器上就访问不了)异常如下:
* Catched Exception: [System.Runtime.InteropServices.ExternalException]: "Timed out waiting for a program to execute. The command being executed was "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /noconfig /fullpaths @"C:\WINDOWS\TEMP\q7a0ugdj.cmdline"." in <System> 
- StackTrace:    at System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpersonated(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine)
   at System.CodeDom.Compiler.Executor.ExecWaitWithCapture(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine)
   at Microsoft.CSharp.CSharpCodeGenerator.Compile(CompilerParameters options, String compilerDirectory, String compilerExe, String arguments, String& outputFile, Int32& nativeReturnValue, String trueArgs)
   at Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames)
   at Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources)
   at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters options, String[] sources)

大家有没有遇到类似问题的,多谢指点.
--------------------编程问答-------------------- 代码太乱、 --------------------编程问答-------------------- 假设A为客户机  B C为服务端

A->B->C这样的方式进行访问的话,那么B不能帮助你访问C,而是通过B访问C。。。这个是两码事!

也就是说,当你是需要访问C的时候,需要在A里同时也拥有C的客户端配置信息,也就是WEBCONFIG里的绑定信息。。。

不建议你用这种方式访问来访问去的,WEB SERVICE首要条件就是要服务边界明确,也就是说两个WEB服务之间不应该有紧密的耦合,那么干两件事情的话,客户端就需要去访问不同的两个WEB服务器,你只需要负责体提供你自己的服务就好了!这个是一种规矩,如果你不守这个规矩,那么你要走很多弯路!

如果WEB服务都是你自己写的,那么无法避免互相调用的时候,应该采用对象的方式,而不是啥WEB SERVICE,这是一种扯淡! --------------------编程问答--------------------

我发现我看错了!那个B是个WINDOWS SERVICE。。。。老大你打个空格不好么!
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,