473,692 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Web service that is able to receive a xml "POST" and process it

Jay
Hello all,

I was wondering if someone can point me to a tutorial that show me how
I can set up a web service that can listen for me to send a POST from a
client? like so

Client sends http POST to http://www.mysite.com/processTheRequest. The
data being sent across is XML like so "<request><data >alot of text data
that I will manipulate and save to the sql database</data></request>"
the serverside should have some function to receive this data.

receiveData(obj ect sender, events e)
{
manipulate the data and respond to the post with
"<response>succ ess</response>"
}

Feb 9 '06 #1
4 1805
Jay,

That's what a webservice does by default. Just create the webservice method
and have it accept an xml parameter. XML is easily converted to and from a
dataset which is safe for sending in a webservice (data must be
serializable). In .NET 2.0 DataTables are also serializable. So you could do
something like this:

<WebMethod()> _
Public Sub XMLAcceptor(ByV al xmlDataset As Data.DataSet)

End Sub

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Jay" <jd******@gmail .com> wrote in message
news:11******** *************@g 44g2000cwa.goog legroups.com...
Hello all,

I was wondering if someone can point me to a tutorial that show me how
I can set up a web service that can listen for me to send a POST from a
client? like so

Client sends http POST to http://www.mysite.com/processTheRequest. The
data being sent across is XML like so "<request><data >alot of text data
that I will manipulate and save to the sql database</data></request>"
the serverside should have some function to receive this data.

receiveData(obj ect sender, events e)
{
manipulate the data and respond to the post with
"<response>succ ess</response>"
}

Feb 9 '06 #2
Jay
what if I wanted to send xmldata as a string (that is formated in xml),
receive this string and do a

xmlDocument.Loa d(xmldata);
any examples or step by step tutorials?

Feb 9 '06 #3
Jay,

You may certainly send the xml as a string just use ByVal xmlString As
String instead of the dataset.

Then load the string into an xml document like this:

xmldoc.LoadXml( sXML)

After that there are plenty of examples like this (do a google search on
"asp.net xmldoc" to see plenty more):

http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=213

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Jay" <jd******@gmail .com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
what if I wanted to send xmldata as a string (that is formated in xml),
receive this string and do a

xmlDocument.Loa d(xmldata);
any examples or step by step tutorials?

Feb 9 '06 #4
Jay
so I get to the point where I created a web service and it comes up to
this page when I push play. I can also click on jaytest and it will
take me to an invoke page... but when I try to send a transaction from
another application(tha t I have sent thousands of WebRequest Post to
our linux jboss server) it does not work.

---
The following operations are supported. For a formal definition, please
review the Service Description.

JayTest

HelloWorld
----------

SERVICE DECRIPTION CONTENT
-----------------------------------------------------------
<?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitio ns xmlns:http="htt p://schemas.xmlsoap .org/wsdl/http/"
xmlns:soap="htt p://schemas.xmlsoap .org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/"
xmlns:tns="http ://www.jaystest.co m"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="htt p://schemas.xmlsoap .org/wsdl/mime/"
targetNamespace ="http://www.jaystest.co m"
xmlns:wsdl="htt p://schemas.xmlsoap .org/wsdl/">
- <wsdl:types>
- <s:schema elementFormDefa ult="qualified"
targetNamespace ="http://www.jaystest.co m">
- <s:element name="HelloWorl d">
<s:complexTyp e />
</s:element>
- <s:element name="HelloWorl dResponse">
- <s:complexTyp e>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="HelloWorl dResult"
type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="JayTest">
- <s:complexTyp e>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="strMyName "
type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="JayTestRe sponse">
- <s:complexTyp e>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="JayTestRe sult"
type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
- <wsdl:message name="HelloWorl dSoapIn">
<wsdl:part name="parameter s" element="tns:He lloWorld" />
</wsdl:message>
- <wsdl:message name="HelloWorl dSoapOut">
<wsdl:part name="parameter s" element="tns:He lloWorldRespons e" />
</wsdl:message>
- <wsdl:message name="JayTestSo apIn">
<wsdl:part name="parameter s" element="tns:Ja yTest" />
</wsdl:message>
- <wsdl:message name="JayTestSo apOut">
<wsdl:part name="parameter s" element="tns:Ja yTestResponse" />
</wsdl:message>
- <wsdl:portTyp e name="Service1S oap">
- <wsdl:operati on name="HelloWorl d">
<wsdl:input message="tns:He lloWorldSoapIn" />
<wsdl:output message="tns:He lloWorldSoapOut " />
</wsdl:operation>
- <wsdl:operati on name="JayTest">
<wsdl:input message="tns:Ja yTestSoapIn" />
<wsdl:output message="tns:Ja yTestSoapOut" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="Service1S oap" type="tns:Servi ce1Soap">
<soap:binding transport="http ://schemas.xmlsoap .org/soap/http"
style="document " />
- <wsdl:operati on name="HelloWorl d">
<soap:operati on soapAction="htt p://www.jaystest.co m/HelloWorld"
style="document " />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operati on name="JayTest">
<soap:operati on soapAction="htt p://www.jaystest.co m/JayTest"
style="document " />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="Service1" >
<documentatio n xmlns="http://schemas.xmlsoap .org/wsdl/" />
- <wsdl:port name="Service1S oap" binding="tns:Se rvice1Soap">
<soap:address
location="http://localhost/WebServiceTest/Service1.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definition s>
-----------------------------------------------------------

Feb 9 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
2660
by: Assaf | last post by:
Hi all, My client is using an online service provider that processes survey responses. After a user fills survey.aspx and presses the OK button, 2 things need to happen: 1. the data has to be posted behind the scenes to the provider's URL (e.g., http://www.surveyprocessingprovider.com/srvy1?field1=response1&field2=response2) 2. the user has to be redirected to thankyou.aspx.
2
1354
by: =?Utf-8?B?TGlzYUNvbnN1bHQ=?= | last post by:
I have 2 web services and they are on different servers. I am supposed to POST a serialized XML document from one site to the other. I've looked around, but I'm totally confused. Can anyone provide a concrete example of how to send it and then on the other side, how does the other service receive it? Thanks.
0
9086
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
8803
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
7629
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...
1
6459
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5820
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
4324
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
4557
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2241
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1959
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.