473,396 Members | 1,846 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,396 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 19 '05 #1
3 1400
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 19 '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 19 '05 #3
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 19 '05 #4

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...
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 ...
1
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...
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.