473,796 Members | 2,645 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 2497
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
2840
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
2084
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 any insight!
3
4203
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
3037
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 because of the tags, is there more? Thanks,
19
3115
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
1863
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
2558
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
1961
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 understand it. Current Result: I have a C++ application which sends a SOAP message to the php...
0
9685
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10461
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10190
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10019
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9057
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6796
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5579
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2928
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.