Client found response content type of '', but expected 'text/xml'

  • Thread starter Vish Ramachandran
  • Start date
V

Vish Ramachandran

I am trying to run a web service project with multiple web services. The problem is that this works sometimes, and sometimes it does not work. I've worked on this problem for nearly 3 days now, and still no solution :( The exception is

An unhandled exception of type 'System.InvalidOperationException' occurred in system.web.services.dl
Additional information: Client found response content type of '', but expected 'text/xml'

When I try to run the web service from the project on the Internet Explorer test page, it runs without any problem, but then if I run it from another application using a web reference, it does not work

I tried creating the project all over again by copying the code for the web services exactly from the previous code, it worked initially, but then after a few minutes it started giving the same error agin

I suspected that it is the namespace of the services which is probably giving the problem, so I commented the WebService attribute for all web service classes, and then tried. It worked! Just to make sure that this was the problem, I reverted back, and it didnt work! Really satisfied that I solved the problem, I commented back the attributes and tested it again. IT DID NOT WORK

Now I am totally stuck not knowing what to do. Can anyone please help me

Thanks a lot in advanc
Vis
 
M

Martin Boehm

Hi,

did you update your web reference after changeing the webservice namespace?

Check the file reference.cs if the correct namespace is in there. If it's
not in there leave the file open in the editor and then refresh your web
reference. There seems to be a bug in VS.Net when updating a web reference,
but leaving the reference.cs file open in the editor will cause the editor
to reload the file.

best regards
Martin

Vish Ramachandran said:
I am trying to run a web service project with multiple web services. The
problem is that this works sometimes, and sometimes it does not work. I've
worked on this problem for nearly 3 days now, and still no solution :( The
exception is:
An unhandled exception of type 'System.InvalidOperationException' occurred in system.web.services.dll
Additional information: Client found response content type of '', but expected 'text/xml'.

When I try to run the web service from the project on the Internet
Explorer test page, it runs without any problem, but then if I run it from
another application using a web reference, it does not work.
I tried creating the project all over again by copying the code for the
web services exactly from the previous code, it worked initially, but then
after a few minutes it started giving the same error agin.
I suspected that it is the namespace of the services which is probably
giving the problem, so I commented the WebService attribute for all web
service classes, and then tried. It worked! Just to make sure that this was
the problem, I reverted back, and it didnt work! Really satisfied that I
solved the problem, I commented back the attributes and tested it again. IT
DID NOT WORK!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top