471,605 Members | 1,434 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

returning a string back after a HTTP Post

Hi,

I need to have a web application such that other applications should be
able to do send data to it using HTTP Post.
So I created a ASP.NET web service and defined a web method for other
people to POST data to. But the string returned back to the person who
sent the POST message is embedded in XML Tags.

for example
http://mydomain.com/webserver.asmx/S...arameter=Hello World

returns the string as follows:

<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://mydomain.com/">RETURN STRING</string>

But what I want to do is get only the string "Return String" as a
response back from the webserver instead of all the extra xml tags.

I'm not really fimiliar with ASP.NET and therefore do not know which
direction to go to right now.

Thanks
Arfeen

Feb 9 '06 #1
1 2259
Arfeen,

Web services imply that you are going to send XML as part of a POST or
GET (usually a POST) and get a response in XML as well, both of which are
usually converted to a local type representation.

If you want to use web services for this, then you need to have your
clients set web references to the web service, and then make the calls to
the web method. It will handle taking the XML and then extracting the
string from it and returning that to you.

However, if you simply want to allow a POST request and then return a
string which isn't wrapped in XML (and will require some manual processing),
then web services is not what you want. Rather, just create a regular
ASP.NET page, and return the response (you might want to change the content
type to text/plain) as a string.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<ar*********@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Hi,

I need to have a web application such that other applications should be
able to do send data to it using HTTP Post.
So I created a ASP.NET web service and defined a web method for other
people to POST data to. But the string returned back to the person who
sent the POST message is embedded in XML Tags.

for example
http://mydomain.com/webserver.asmx/S...arameter=Hello World

returns the string as follows:

<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://mydomain.com/">RETURN STRING</string>

But what I want to do is get only the string "Return String" as a
response back from the webserver instead of all the extra xml tags.

I'm not really fimiliar with ASP.NET and therefore do not know which
direction to go to right now.

Thanks
Arfeen

Feb 9 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Siamak Zahedi | last post: by
4 posts views Thread by David Lozzi | last post: by
19 posts views Thread by Manish Tomar | last post: by
6 posts views Thread by RThaden | last post: by
13 posts views Thread by Karl Groves | last post: by
1 post views Thread by omgoosh | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

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.