473,567 Members | 2,897 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 2482
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.co m

<ar*********@gm ail.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.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
2808
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 bc; string s; bc = Request.Browser; ....
8
2066
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: "getProductByID(productID)" from inside another method in the same class. See below. This line throws a null ref exception: While dr.Read() Thanks for...
3
4163
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 dropdownlist to a string var it always returns the first item regardless of what was selected code is simple
4
3020
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; instead of <strong> and so on. Is this a problem with the editor or something else? Does .Net convert it? I had to disable page validate request...
19
3089
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
1854
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
2540
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 data from a query into an array. The intent is that the following code:
1
1953
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++ application which sends a SOAP message to a php server, which in turn sends back a SOAP message that the C++ application will look at and be able to...
0
7688
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8115
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7651
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7960
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6272
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5216
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3648
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2093
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 we have to send another system
1
1205
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.