我用C#开发了一个控制台应用程序,应该调用Web Service方法。
添加服务参考并创建了VS类之后,我可以使用它来调用方法:
var seed = new Seed.CrSeedClient();
string semilla = await seed.getSeedAsync();
当调用getSeedAsync方法时,这将显示在调试窗口中,当然,该方法不会返回应有的状态。
'ConComm.exe' (CLR v4.0.30319: ConComm.exe): 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_es_b77a5c561934e089\mscorlib.resources.dll' loaded. Module was compiled with no symbols.
Thrown exception: 'System.IO.FileNotFoundException' in mscorlib.dll
Thrown exception: 'System.IO.FileNotFoundException' in mscorlib.dll
'ConComm.exe' (CLR v4.0.30319: ConComm.exe): 'C:\Users\jaime\AppData\Local\Temp\wcu5wg4c\wcu5wg4c.dll' loaded. Symbols loaded.
我已使用解释了here的步骤来尝试解决该问题。
首先设置
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
在app.manifest文件中,以强制控制台应用程序以管理员身份运行。
第二,我在app.config文件中添加了它:
<system.diagnostics>
<switches>
<add name="XmlSerialization.Compilation" value="4"/>
</switches>
</system.diagnostics>
当我看到C:\ Users \ jaime \ AppData \ Local \ Temp \文件夹时,我可以检查是否在调用该Web服务方法时创建了其中包含一些文件的文件夹,因此,这不是权限问题。
另一种尝试我还能做什么?
顺便说一句,当使用SoapUI应用程序时,该方法运行良好,因此,这不是WS的问题。
此致海梅
也许尝试绕过方法调用,以查看是否可以查看InnerException以获取更多信息
try
{
var seed = new Seed.CrSeedClient();
string semilla = await seed.getSeedAsync();
}
catch(Exception e)
{
var details = e.InnerException;
}