simple web service test?

A

Andy

Hi,

below is simple webservice wich I'd like to test in my local host and when I
put http://localhost/test.asmx I'm getting this error:

XML Parsing Error: no element found
Location: http://localhost/test.asmx
Line Number 1, Column 1:

Can somebody help me why? What I'm missing?

below is sample web setvice code:

<%@ WebService Language="C#" Class="MathService" %>

using System;

using System.Web.Services;

[WebService(Namespace="Microsoft.Samples.XmlMessaging.WebServices")]

public class MathService {

[WebMethod]

public float Add(float a, float b)

{

return a + b;

}


}
 
M

Marc Gravell

The code as posted works fine for me. Is there any more information in
the error message? I'm wondering if this relates more to configuration
(perhaps web.config or the web-server setup) than code.

What web-server are you using to host this; IIS? You might also want
to verify that it is configured as an application, and is running the
correct version of ASP.NET.

Marc
 
A

Andy

thanks for tips,
yes this is IIS, asp 2.0, interesting but I cannot start deafault website,
I'm gettin unexpected error, but I can succesfully restart IIS....
no idea what to do now
 
H

Hans Kesting

thanks for tips,
yes this is IIS, asp 2.0, interesting but I cannot start deafault website,
I'm gettin unexpected error, but I can succesfully restart IIS....
no idea what to do now
I'll repeat what Marc said: "is there more information in the error
message"?
The fact that there was some error is not enough to diagnose the
problem. Usually the error message gives some hints about the problem
and sometimes even how to fix it.

See if the complete error message rings a bell. If not, post the
complete error message (minus irrelevant private stuff, maybe).

Hans Kesting
 
M

Marc Gravell

See if the complete error message rings a bell. If not, post the
complete error message (minus irrelevant private stuff, maybe).

And check the event-log. That is the default dumping-ground when it
panics.

Marc
 
A

Andy

OK, when I try to start default website I'm getting this error in the event
viewer: source W3SVC

The service could not bind instance 1. The data is the error code.
For additional information specific to this message please visit the
Microsoft Online Support site located at:
http://www.microsoft.com/contentredirect.asp.

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

data:
0000: 40 27 00 00 @'..

I guess because my defalt website is not running I cannot run local host?
On IE I'm getting page not found on localhost. Could SQL Server messed up
something?


thanks
 

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

Top