Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
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:- "Error 2 Unable 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: "
MSIL
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 --->

"
.

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
Posted
Updated 27-Sep-10 19:39pm
v3
Comments
DavidKiryazi 27-Sep-10 5:34am    
Hi Varun,

Have you tried to access the webservice through internet explorer and seeing what result you get for a particular query?

The error sounds like it has something to do with the way the webservice is being configured and the permissions for its use. I had a similar problem when I was doing webservices, (but dont know much about them and cant remember how i ended up fixing the problem)
Varun Sareen 28-Sep-10 1:00am    
Dear David,

I have executed and tested the web service through a windows based application and it is running absolutely fine and showing appropriate results also.

Now as mentioned in question I am trying to access it through a window service but not able to execute the same. :( and getting the following error:-

"Client found response content type of 'application/wsdl+xml', but expected 'text/xml'."

Hi David,

Check if the location where you copy the file to has enough permissions to copy it. You can even check the permission and try to paste it there.
 
Share this answer
 
Dear Friends,

Thanks to all for the nice suggestions but i solved the problem myself. Actually I was calling the window service after every 1 sec and the web service was not getting much time to open the connection to MYSQL.

So, i increased the time of the window service call and hence the problem is solved.

Varun Sareen
Software Developer
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900