troubleshooting Question

ASMX Service Client Debugging

Avatar of Rob Gaudet
Rob GaudetFlag for United States of America asked on
XMLC#Web ServicesSOAP Protocol
5 Comments2 Solutions350 ViewsLast Modified:
I am testing a client who's supposed to connect to my .asmx web service with a single method called PostData.

The client code being used is also used for other web services, however, it does not reference any methods.
So I'm assuming the other services this client publishes too are web services that don't expose any methods.

QUESTION 1) Is is possible to create web services that don't expose methods?

I had them send me an example of the code to test out myself, I've copied it below. When I try running this... I get a "The remote server returned an error: (500) Internal Server Error.".

I would like to debug this inside of the web service, however I am not sure how to since it doesn't ever load up the exposed method.

QUESTION 2) ANY IDEAS?


string returnString;
			var request = System.Net.WebRequest.Create("https://-------/Services/DataPushService.asmx") as System.Net.HttpWebRequest;
			var messageString = "<?xml version=\"1.0\" encoding=\"utf-8\"?><XML xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">DATA HERE</XML>";
			request.Method = "POST";
			request.ContentType = "text/xml";

			request.Accept = "Accept"; // options.Communications.HttpAcceptHeader; 
			request.KeepAlive = false;
			request.ServicePoint.Expect100Continue = false;

			request.Headers["Authorization"] = "Basic WebServiceTest:miller69";

			using (var requestStream = request.GetRequestStream())
			{
				using (var requestWriter = new System.IO.StreamWriter(requestStream, Encoding.UTF8))
				{
					requestWriter.Write(messageString);
				}
			}

			using (var response = request.GetResponse())
			{
				using (var responseStream = response.GetResponseStream())
				{
					if (responseStream != null)
					{
						using (var responseReader = new System.IO.StreamReader(responseStream, Encoding.UTF8))
						{
							returnString = responseReader.ReadToEnd();
						}
					}
				}
			}

Open in new window

ASKER CERTIFIED SOLUTION
Miguel Oz
Senior Software Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Top Expert 2009

The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.

Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 2 Answers and 5 Comments.
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>

Mike

Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 2 Answers and 5 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004