473,326 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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(object sender, events e)
{
manipulate the data and respond to the post with
"<response>success</response>"
}

Feb 9 '06 #1
4 1790
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(ByVal 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*********************@g44g2000cwa.googlegro ups.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(object sender, events e)
{
manipulate the data and respond to the post with
"<response>success</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.Load(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.googlegr oups.com...
what if I wanted to send xmldata as a string (that is formated in xml),
receive this string and do a

xmlDocument.Load(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(that 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:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://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.com"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
targetNamespace="http://www.jaystest.com"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <s:schema elementFormDefault="qualified"
targetNamespace="http://www.jaystest.com">
- <s:element name="HelloWorld">
<s:complexType />
</s:element>
- <s:element name="HelloWorldResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="HelloWorldResult"
type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="JayTest">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="strMyName"
type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="JayTestResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="JayTestResult"
type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
- <wsdl:message name="HelloWorldSoapIn">
<wsdl:part name="parameters" element="tns:HelloWorld" />
</wsdl:message>
- <wsdl:message name="HelloWorldSoapOut">
<wsdl:part name="parameters" element="tns:HelloWorldResponse" />
</wsdl:message>
- <wsdl:message name="JayTestSoapIn">
<wsdl:part name="parameters" element="tns:JayTest" />
</wsdl:message>
- <wsdl:message name="JayTestSoapOut">
<wsdl:part name="parameters" element="tns:JayTestResponse" />
</wsdl:message>
- <wsdl:portType name="Service1Soap">
- <wsdl:operation name="HelloWorld">
<wsdl:input message="tns:HelloWorldSoapIn" />
<wsdl:output message="tns:HelloWorldSoapOut" />
</wsdl:operation>
- <wsdl:operation name="JayTest">
<wsdl:input message="tns:JayTestSoapIn" />
<wsdl:output message="tns:JayTestSoapOut" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="Service1Soap" type="tns:Service1Soap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
- <wsdl:operation name="HelloWorld">
<soap:operation soapAction="http://www.jaystest.com/HelloWorld"
style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="JayTest">
<soap:operation soapAction="http://www.jaystest.com/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">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/" />
- <wsdl:port name="Service1Soap" binding="tns:Service1Soap">
<soap:address
location="http://localhost/WebServiceTest/Service1.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
-----------------------------------------------------------

Feb 9 '06 #5

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

Similar topics

12
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...
2
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.