Using XML in Winforms

  • Thread starter Thread starter jed
  • Start date Start date
J

jed

Hello i need to send XML to a webserver from a C# winform. I am afraid
i dont have any code yet on how to do this. I need to send the xml off
then retrieve a xml response from the server is this possible? Thanks
in advance. Any suggestions are welcome
 
Hello i need to send XML to a webserver from a C# winform. I am afraid
i dont have any code yet on how to do this. I need to send the xml off
then retrieve a xml response from the server is this possible? Thanks
in advance. Any suggestions are welcome

It's possible by using a XMLdocument to build a document to send and
receive the XML It's also possible by using Linq with XML to build to send
and receive the XML with a site, if you're using .Net Framework 3.5 and VS
2008.

If this is some 3rd party Web service provider, then you will need
documentation on how to consume the Web service along with the XML schemas
of the XML used by the Web Service provider's site.

Also if this is a 3rd party Web service provider, then they will have
support personnel that will provide everything, even the code, on how to
consume and use the Web site's Web service.

If it's not a 3rd party provider, then you still need the above information
to consume and use the Web service site.


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4074 (20090514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
Hello i need to send XML to a webserver from a C# winform. I am afraid
i dont have any code yet on how to do this. I need to send the xml off
then retrieve a xml response from the server is this possible? Thanks
in advance. Any suggestions are welcome

It's possible by using a XMLdocument to build a document to send and
receive the XML It's also possible by using Linq with XML to build to send
and receive the XML with a site, if you're using .Net Framework 3.5 and VS
2008.

If this is some 3rd party Web service provider, then you will need
documentation on how to consume the Web service along with the XML schemas
of the XML used by the Web Service provider's site.

Also if this is a 3rd party Web service provider, then they will have
support personnel that will provide everything, even the code, on how to
consume and use the Web site's Web service.

If it's not a 3rd party provider, then you still need the above information
to consume and use the Web service site.


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4074 (20090514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
You need to use HTTP POST. Many different ways of doing it.

http://en.csharp-online.net/HTTP_Post

The request submits your XML and if all worked your response will contain
the xml sent back by the server.

I had the classes to do this from a previous work place but have mislaid
them. If I come accross them I will post them.

Damn....



It's possible by using a XMLdocument to build a document to send and
receive the XML


Has anyone got code on how i actually send the xmldocument
 
You need to use HTTP POST. Many different ways of doing it.

http://en.csharp-online.net/HTTP_Post

The request submits your XML and if all worked your response will contain
the xml sent back by the server.

I had the classes to do this from a previous work place but have mislaid
them. If I come accross them I will post them.

Damn....



It's possible by using a XMLdocument to build a document to send and
receive the XML


Has anyone got code on how i actually send the xmldocument
 
Has anyone got code on how i actually send the xmldocument

http://www.devx.com/tips/Tip/41390

The above is how you build it.

You would then make an XML string to send to the Web service.

string strxml = xmldoc.tostring();

You send the strxml to the Web service method   ---  
myclient.webmethod.recvXML(strxml); // It's being recived on the other end

If want to get the response XML from the Web service, then you do this.

XMLDocument  xdoc = new XMLDocument();

xdoc.Load(myclient.webmethod.GetResponse.ToSring());

I'll leave it to you on how to read the XML in the doc, use Google.

What is WSDL?

http://www.developer.com/services/article.php/1602051

Again, you're only getting the basics here, and you need to be in contact
with whoever it is that is responsible for the Web service at the site and
have them guide you on how to consume and use the Web service, because the
above information is just an example and not the gospel

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4075 (20090514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

Thanks to all this has been very useful.
 
Has anyone got code on how i actually send the xmldocument

http://www.devx.com/tips/Tip/41390

The above is how you build it.

You would then make an XML string to send to the Web service.

string strxml = xmldoc.tostring();

You send the strxml to the Web service method   ---  
myclient.webmethod.recvXML(strxml); // It's being recived on the other end

If want to get the response XML from the Web service, then you do this.

XMLDocument  xdoc = new XMLDocument();

xdoc.Load(myclient.webmethod.GetResponse.ToSring());

I'll leave it to you on how to read the XML in the doc, use Google.

What is WSDL?

http://www.developer.com/services/article.php/1602051

Again, you're only getting the basics here, and you need to be in contact
with whoever it is that is responsible for the Web service at the site and
have them guide you on how to consume and use the Web service, because the
above information is just an example and not the gospel

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4075 (20090514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

Thanks to all this has been very useful.
 
Back
Top