473,498 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2475
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1328
by: ehilario | last post by:
Thanks Mark, That 's better than internal server error. This is what came back, which is confusing because when its called locally it comes back fine. Am I missing something? -Ed
4
2799
by: Earl T | last post by:
When I try to get the netscape version for version 7, I get the HttpBrowserCapabilities class returning the version as 5 and not 7. (see code and output below) CODE HttpBrowserCapabilities...
8
2057
by: bidllc | last post by:
I have a funtion that works fine and dandy when called from anywhere in my app. It will NOT work when called from inside the class in which it resides. This is the function I'm calling:...
3
4137
by: Siamak Zahedi | last post by:
Hi, weird problem I'm having cant seem to figure out what is going on. I have a dropdownlist that gets populated from db and a button that causes a post back when I assign the value of the...
4
3009
by: David Lozzi | last post by:
Howdy, I'm using a WYSIWYG editor called TinyMCE. When I edit some text and then save it back to my SQL server using a SQLCommand, all HTML characters are changed to HTML code, i.e. &gt;strong&lt;...
19
3074
by: Manish Tomar | last post by:
Hi All, The following code as per my knowledge should not work: int* some() { int b = 10; return &b; }
6
1847
by: RThaden | last post by:
Hi together, I am a bit clueless about the following problem: In the following code excerpt std::string getStr() { std::string bla="asdfsa";
13
2531
by: Karl Groves | last post by:
I'm missing something very obvious, but it is getting late and I've stared at it too long. TIA for responses I am writing a basic function (listed at the bottom of this post) that returns...
1
1946
by: omgoosh | last post by:
Hello! I'm new here so feel free to criticize me if my question is worded poorly, or if I'm asking too much, or if you just don't like me thats fine too! Desirable Result: I'm trying to make a C++...
1
6891
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7381
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5465
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,...
1
4916
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4595
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
293
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.