473,326 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Basic problem with WebService POST

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/H...emo?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/H...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/H...WorldDemo?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/H...HelloWorldDemo
gives
Content-Type: text/xml; charset=utf-8

whereas

http://localhost/ExampleWebService/H...WorldDemo?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


Nov 23 '05 #1
2 1445
Beg pardon, I got the last part of my posting (the bit about Returned
Headers) the wrong way round.

Here are the Returned Headers I get:

http://localhost/ExampleWebService/H...WorldDemo?wdsl
gives
Content-Type: text/xml; charset=utf-8

whereas

http://localhost/ExampleWebService/H...HelloWorldDemo
gives
Content-Type: text/html
The mystery remains, and I welcome any answers!

Cheers,

JON

Nov 23 '05 #2
Jon - ever learn any more about this issue? Facing the same thing when I
move my web services from local XP pro IIS to Server 2003 IIS.
Thanks.
Bob

"Jon Maz" wrote:
Beg pardon, I got the last part of my posting (the bit about Returned
Headers) the wrong way round.

Here are the Returned Headers I get:

http://localhost/ExampleWebService/H...WorldDemo?wdsl
gives
Content-Type: text/xml; charset=utf-8

whereas

http://localhost/ExampleWebService/H...HelloWorldDemo
gives
Content-Type: text/html
The mystery remains, and I welcome any answers!

Cheers,

JON

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Programatix | last post by:
Hi, I'm working on a project which includes WebServices and Windows Form application. The Windows Form application will call the WebServices to retrieve data from database. The data will be...
6
by: Davie | last post by:
I want to authorise a user of a web service by using the AuthHeaderValue for some reason I keep getting a null reference exception when I try to run the following code: It seems to work fine on a...
3
by: Jon Maz | last post by:
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...
13
by: Pete | last post by:
I'm cross posting from mscom.webservices.general as I have received no answer there: There has been a number of recent posts requesting how to satisfactorily enable BASIC authorization at the...
3
by: Old Man | last post by:
using c# in a windows application. I am developing a webservice to run on our extranet SSL server. The company policy is that this server log everybody in. I am going to use the WSE security,...
0
by: Det | last post by:
Hi there I am somewhat stuck with calling a WebService from out of a VB App. My Goal: - Get a WebService invoked under MS - Access 2002, not using the MS-SOAP-Toolkit but the .net - Framework ...
6
by: fiziwig | last post by:
Hi, I've written my first attempt at basic authentication and it doesn't work. I thought I understood the specs, but I must be missing something obvious. Can anyone give me a hint as to what...
0
by: cataztrophe | last post by:
I have an ASP.NET/VB.NET program. There is a webservice does processing in a separate project which does not return any values. The webservice is executed upon clicking the run button on a certain...
0
by: =?Utf-8?B?UHZkYl9CQQ==?= | last post by:
Hi all, I have a problem with accessing a webservice from Access2000 (=VBA). I hope I can place this question in this group. If no, please give me an better place it. So, i'm try to connect...
7
by: Nick | last post by:
Hi there, Is it possible to tell how a WebMethod was invoked? For example I would like to determin if it was invoked via SOAP or HTTP Post. Other than creating 2 methods I am no sure if I can...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.