We help IT Professionals succeed at work.
Get Started

ASMX Service Client Debugging

345 Views
Last Modified: 2016-03-11
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

Comment
Watch Question
Senior Software Engineer
CERTIFIED EXPERT
Top Expert 2009
Commented:
This problem has been solved!
Unlock 2 Answers and 5 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE