客户端调用web service时报错,很奇怪,请帮我看看!

gshope 2003-10-22 03:08:14
web service程序没问题,生成的*.asmx文件正常。
在客户端程序添加web引用也成功了,但是在调用代理类的时候报错:
行 28:
行 29: /// <remarks/>
行 30: public Service1() {
行 31: this.Url= "http://192.168.30.48/aspnet/aspnet/Service1.asmx";
行 32: }
这是代理类的构造函数部分的代码,其中30行报错,信息如下:
System.IO.FileNotFoundException: 找不到文件或程序集名称“xf6jygsy.dll”,或找不到它的一个依赖项。

而且奇怪的是,xf6jygsy.dll这个文件名每次报错时还都不一样,怎么回事??
...全文
118 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
saucer 2003-10-25
  • 打赏
  • 举报
回复

PRB: You Receive a "System.IO.FileNotFoundException" Error When the Client Application Calls a Web Service
http://support.microsoft.com/?id=823196
gshope 2003-10-24
  • 打赏
  • 举报
回复
另外,我把C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Temporary ASP.NET Files
和c:\winnt\temp两个目录都设置成everyone的完全控制权限,错误还是一样!
gshope 2003-10-24
  • 打赏
  • 举报
回复
asmx文件直接访问没问题,但是在测试它的方法时报错,信息如下:
System.IO.FileNotFoundException: 找不到文件或程序集名称“lfpbf0_o.dll”,或找不到它的一个依赖项。
文件名:“lfpbf0_o.dll”
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Boolean stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()
at System.Xml.Serialization.Compiler.Compile()
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings)
at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings)
at System.Web.Services.Protocols.XmlReturn.GetInitializers(LogicalMethodInfo[] methodInfos)
at System.Web.Services.Protocols.XmlReturnWriter.GetInitializers(LogicalMethodInfo[] methodInfos)
at System.Web.Services.Protocols.MimeFormatter.GetInitializers(Type type, LogicalMethodInfo[] methodInfos)
at System.Web.Services.Protocols.HttpServerType..ctor(Type type)
at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)

Fusion log follows:
=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:\WINNT\TEMP\lfpbf0_o.dll
LOG: Appbase = file:///E:/web/aspnet/aspnet
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===

LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/WINNT/TEMP/lfpbf0_o.dll.


saucer 2003-10-24
  • 打赏
  • 举报
回复
try to give ASPNET full access to C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Temporary ASP.NET Files

or change

userName in <processModel> in machine.config to "SYSTEM"
gshope 2003-10-24
  • 打赏
  • 举报
回复
直接访问asmx没问题,web service 和客户端程序在同一机器上,是win2K server
triout 2003-10-24
  • 打赏
  • 举报
回复
你能确认你的ASMX没有问题(使用ASMX的URL直接访问)?

如果真的没有问题,你应该……(对了,你是在什么环境调用WEBSERVICE?)。

saucer 2003-10-24
  • 打赏
  • 举报
回复
have you tried to change

userName in <processModel> in machine.config to "SYSTEM"

?

also see

http://sellsbrothers.com/tools/#XmlSerializerPreCompiler

if nothing works, I would agree with cyp503(谁怕?一蓑烟雨任平生) , try to reinstall .NET
cyp503 2003-10-24
  • 打赏
  • 举报
回复

try it:uninstalling the .NET Framework and reinstalling it.

This is a security issue; the ASPNET user was not able to write to the specified directory.

gshope 2003-10-23
  • 打赏
  • 举报
回复
没有一个回复是真正有意义的,哎!
cityhunter172 2003-10-22
  • 打赏
  • 举报
回复
你应该在VS.Net的“解决方案资源管理器”里右击“引用”->“添加Web引用”(如http://cityhunter.meibu.com/Service1.asmx)

引用方法时,通过对象调用

com.meibu.cityhunter.Service1 sv =new com.meibu.cityhunter.Service1();
this.TextBox1.Text = sv.HelloWorld();

需注意的是如有防火墙,要充许 aspnet_wp.exe 访问网络
guoyan19811021 2003-10-22
  • 打赏
  • 举报
回复
添加web引用对于web 服务在哪是一样的
houlinghouling 2003-10-22
  • 打赏
  • 举报
回复
你可以直接写地址来调用呀:
url = "http://localhost/netclass/Modules/ClassBrowser/GetContent.asmx/GetContent";
postRequest = "nItemID=" + itemId;
xhttp.Open("POST", url, false);
xhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhttp.setRequestHeader("Content-Length", postRequest.length);
xhttp.send(postRequest);
doc.load(xhttp.ResponseXML);
s = doc.selectSingleNode("//string").text;
var ovc = document.getElementById("_ctl3_ContentArea");
ovc.innerHTML = s;
dingyy 2003-10-22
  • 打赏
  • 举报
回复
gz
lovewangj 2003-10-22
  • 打赏
  • 举报
回复
Web Service放在哪里都一样的,你先在机器里面查找一下这个dll在什么地方。
gshope 2003-10-22
  • 打赏
  • 举报
回复
说明一下,web service程序和客户端程序都在本地机上。这样添加web引用有什么不同吗?

62,047

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧