问题描述
亲爱的朋友,
我正在运行一个窗口服务,其中将数据从访问表中提取到数据表中,然后借助 foreach 循环;在同一项目的 bin/debug 文件夹中创建一个XML文件,并将具有ID和详细信息的相同信息写入 XML文件.
现在,Window服务将从XML文件中读取数据,并且特定身份的ID和详细信息将通过Web服务(我已将其添加到window服务中的引用)发送到Web方法.
但是,当我调用Web方法时,窗口服务无法将xml文件复制(或创建)到指定的文件夹中,并且出现错误,例如:-错误2无法复制文件" obj \ Debug \ TrackingSystem.exe"更改为"bin \ Debug \ TrackingSystem.exe".
该进程无法访问文件"bin \ Debug \ TrackingSystem.exe",因为它正在被另一个进程使用.跟踪系统
" :(
出现异常错误的原因如下:客户端发现响应内容类型为"application/wsdl + xml",但预期为"text/xml"." .
今天出现的异常是:"
Dear Friends,
I am running a window service in which the data is fetched from the access sheet into a datatable and then with the help of foreach loop; A XML file is created in the bin/debug folder of the same project and the same information with the Id and Details is written into the XML file.
Now the Window service will read the data from the XML file and the ID and details for a particular person will be sent to a web method through a web service (of which reference I have added into the window service).
But when I am calling the web method, the window service is not able to copy(or create) the xml file into the specified folder and an error is coming like:- "Error2Unable to copy file "obj\Debug\TrackingSystem.exe" to "bin\Debug\TrackingSystem.exe".
The process cannot access the file ''bin\Debug\TrackingSystem.exe'' because it is being used by another process.TrackingSystem
" :(
The exception error is coming as: "Client found response content type of ''application/wsdl+xml'', but expected ''text/xml''.".
Today exception is coming as: "
System.Web.Services.Protocols.SoapException: Server was unable to process request. --->
System.Data.DataException: Connection must be valid and open
at executeOperations.insertRecords(String strSQLQuery) in d:\webServiceForPHP\App_Code\connectionClassForMySQL.cs:line 95
at Service.insertStudentDetails(Int32 userId, String dateTime, String inOutStatus)
in d:\webServiceForPHP\App_Code\Service.cs:line 27
--->
End of inner exception stack trace --->
".
如果我不使用Web方法(通过Web服务),则窗口服务运行得非常好.
请帮助:)
谢谢
Varun Sareen
Software Developer
".
The window service is running absolutely fine if I don''t use the Web Method (through web service).
Kindly help :)
Thanks
Varun Sareen
Software Developer
推荐答案
这篇关于在窗口服务中执行Web服务时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!