调用公网上Web Service错误一例Server was unable to process request.

多灾多难的WebService

折磨了一天,局域网内部署测试通过,部署到公网上一个服务器,出现怪问题,
症状如下:
1.通过浏览器 访问公网上的webservice asmx地址正常.
2.程序开发环境直接引用访问公网上的webservice正常.
3.程序调用公网上的webservice方法时,就出错,服务器端方法中log无记录.
4..端口没有做任何过滤.
5 无代理

webconfig中这些信息加上也没用。

  1. <webServices>  
  2.         <protocols>  
  3.           <add   name="HttpSoap"/>  
  4.           <add   name="HttpPost"/>  
  5.           <add   name="HttpGet"/>  
  6.           <add   name="Documentation"/>  
  7.         protocols>  
  8.       webServices>   

 

错误细节如下:

 

未处理 System.ServiceModel.FaultException
  Message=System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: Unable to generate a temporary class (result=1).
error CS2001: Source file 'C:\Windows\TEMP\rslkkupk.0.cs' could not be found
error CS2008: No inputs specified

   at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
   at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
   at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
   at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type)
   at System.Web.Services.Protocols.SoapServerType..ctor(Type type, WebServiceProtocols protocolsSupported)
   at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
   --- End of inner exception stack trace ---
  Source=mscorlib
  StackTrace:
    Server stack trace:
       在 System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
       在 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       在 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       在 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]:
       在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       在 TestVFService.WebSVC.VFIOSoap.UploadFileBegin(UploadFileBeginRequest request)
       在 TestVFService.WebSVC.VFIOSoapClient.TestVFService.WebSVC.VFIOSoap.UploadFileBegin(UploadFileBeginRequest request) 位置 D:\VF\Code\TestVFService\Service References\WebSVC\Reference.cs:行号 692

 

最后的解决办法

给asp.net的运行帐户及NetworkService,匿名账户加上对Windows/temp/目录的写入权限。

原因IIS要在这个目录中创建一些文件。

你可能感兴趣的:(杂项,热点技术)