Web Service Debugging

J

John Cantley

Usually I write the web service into my solution and can debug it with no
problems. My current situation does not give me access to the source control
so I want to keep the web service out of the main web solution. So in
essence how do I debug the webservice? I can instantiate it in my web
project but never hit any breakpoints. I get an error when I try to step
into the webservice call from the web project. If I don't step in but just
f10 it, the webservice never stops at a breakpoint. I am attaching to the
WebDev.WebServer.EXE process and I get no breaks. I do not want to debug
this from the discovery but the other web project.

Thanks,
John Cantley
 
G

Glenn

John

If you want to debug on the same machine put a break point on the entry
point of the web service and start it up in debug. From another instance of
VS run your client app and put a break point at the point you call the web
service. You should now be able to step across into the web service code.

HTH

Glenn
 
V

Valko

you can try to Override wse request too:


protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
PropertyInfo requestPropertyInfo = null;

WebRequest request = base.GetWebRequest(uri);

if (requestPropertyInfo==null)

requestPropertyInfo = request.GetType().GetProperty("Request");

// Retrieve underlying web request
HttpWebRequest webRequest =
(HttpWebRequest)requestPropertyInfo.GetValue(request, null);

// Setting KeepAlive
//webRequest.KeepAlive = false;
// or better use diffrent protocol
webRequest.ProtocolVersion = System.Net.HttpVersion.Version10;

return request;
}
 

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,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top