.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Debug web service consumed through URL

Posted By: jokertin92     Posted Date: April 16, 2012    Points:5   Category :ASP.Net
I have created a new web service which I'm consuming using its URL from a testing application. Below is my testing app's code. I have set breakpoints in my Web Service and I want debug it when I come to the line "WebResponse res = req.GetResponse();" in my test app. But it doesn't go to my web method (DoHelp. I tried hosting the web service in IIS and attached the "aspnet_wp" process. Then it's working if I run from browser. Kindly give me some input to debug the web service from my test application.

string url = "http://localhost/MyService/Help.asmx?op=DoHelp";
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
//HttpRequest req = HttpContext.Current.Request;
req.Headers.Add("Id", "354535018567138");
req.Headers.Add("format", "1");
req.Headers.Add("Name", "0");

req.ContentType = "audio/x-speex;rate=16000";
req.Method = "POST";
byte[] audioData = null;
string path = Server.MapPath(".");
path += "\\AudioFile\\audio_16k16bit.spx";
//string xx = Nuance.DoVoiceRecognition();
audioData = File.ReadAllBytes(path);
Stream datastream = req.GetRequestStream();
datastream.Write(audioData, 0, audioData.Length);
datastream.Close();


WebResponse res = req.GetResponse();
StreamReader sr = new StreamReader(res.GetResponseStream());
string outputResult = sr.ReadToEnd();

Responses

No response found. Be the first to respond this post
Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend