473,386 Members | 1,779 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,386 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 1447
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.