ASMX Service Client Debugging

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

Rob GaudetAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Miguel OzSenior Software EngineerCommented:
Q1. NO. NO methods means no way to talk to web server.
Q2. Tell them to provide the appropriate way to talk to their services. COMPLETE Sample code  with the correct URL and a valid user, the method may have permissions rules that you need to satisfy in order to use it.
Also you can only debug services that you have the source code.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kaufmed   ( ⚆ _ ⚆ )I asked the operating system what I could do to become a better programmer. It said, "Let me give you some pointers."Commented:
That username and password string in your Authorization line needs to be base-64 encoded. (The "Basic" bit doesn't; just the username and password.) Also, your Accept header doesn't look correct. It should be something like "application/xml" or maybe "application/json", depending on what kind of data you wish to get back. If you're not getting any data back, then you can leave the Accept out altogether.
Rob GaudetAuthor Commented:
The client is driving the boat here... they don't want to base-64 encode the auth. info and I don't want to rock it. As for the Accept header, I'll make that adjustment and see how it goes.
Rob GaudetAuthor Commented:
Yeah, changed the Accept header to the proper text but still getting this error --> "The remote server returned an error: (500) Internal Server Error.".
Miguel OzSenior Software EngineerCommented:
You need to have a look at the server logs to determine the correct error (typically include error details and hopefully ad stack trace that cold guide you to find out what the problem is)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
XML

From novice to tech pro — start learning today.