J
Jon Maz
Hi All,
I'm at the "Hello World" stage of learning about web services (just to warn
you), and have what is I think a simple question.
I have created a basic HelloWorld.asmx, which has the following Web Method:
[WebMethod]
public string HelloWorldDemo(string stuff)
{
return "Hello World " + stuff;
}
I have added the following to web.config:
<webServices>
<protocols>
<add name="HttpSoap" />
<add name="HttpGet" />
<add name="HttpPost" />
</protocols>
</webServices>
So far, I have got this to work using GET:
http://localhost/ExampleWebService/HelloWorld.asmx/HelloWorldDemo?stuff=test
returns:
<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">Hello World test</string>
but I have a problem with POST. If I POST key:stuff value:test to
http://localhost/ExampleWebService/HelloWorld.asmx/HelloWorldDemo,
the only response I get back is:
<!-- Thu May 26 14:12:19 UTC+0100 2005 -->
HOWEVER exactly the same post DOES work if I POST to the following url (note
the?wdsl appended to the end)
http://localhost/ExampleWebService/HelloWorld.asmx/HelloWorldDemo?wdsl
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://tempuri.org/">Hello World test</string>
The only difference I can see is in the Returned Headers:
http://localhost/ExampleWebService/HelloWorld.asmx/HelloWorldDemo
gives
Content-Type: text/xml; charset=utf-8
whereas
http://localhost/ExampleWebService/HelloWorld.asmx/HelloWorldDemo?wdsl
gives
Content-Type: text/html
Can anyone help tell me what's going on? As far as I know I should
*not* have to put "?wdsl" in the url to get a POST to work...
TIA,
JON
I'm at the "Hello World" stage of learning about web services (just to warn
you), and have what is I think a simple question.
I have created a basic HelloWorld.asmx, which has the following Web Method:
[WebMethod]
public string HelloWorldDemo(string stuff)
{
return "Hello World " + stuff;
}
I have added the following to web.config:
<webServices>
<protocols>
<add name="HttpSoap" />
<add name="HttpGet" />
<add name="HttpPost" />
</protocols>
</webServices>
So far, I have got this to work using GET:
http://localhost/ExampleWebService/HelloWorld.asmx/HelloWorldDemo?stuff=test
returns:
<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">Hello World test</string>
but I have a problem with POST. If I POST key:stuff value:test to
http://localhost/ExampleWebService/HelloWorld.asmx/HelloWorldDemo,
the only response I get back is:
<!-- Thu May 26 14:12:19 UTC+0100 2005 -->
HOWEVER exactly the same post DOES work if I POST to the following url (note
the?wdsl appended to the end)
http://localhost/ExampleWebService/HelloWorld.asmx/HelloWorldDemo?wdsl
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://tempuri.org/">Hello World test</string>
The only difference I can see is in the Returned Headers:
http://localhost/ExampleWebService/HelloWorld.asmx/HelloWorldDemo
gives
Content-Type: text/xml; charset=utf-8
whereas
http://localhost/ExampleWebService/HelloWorld.asmx/HelloWorldDemo?wdsl
gives
Content-Type: text/html
Can anyone help tell me what's going on? As far as I know I should
*not* have to put "?wdsl" in the url to get a POST to work...
TIA,
JON