Solved

Passing XML Serialized Object between domains

Posted on 2014-02-26
5
380 Views
Last Modified: 2014-02-27
I am attempting to set up a "data sharing" scenario between my company and another company we work with. I want this data sharing to be automated with as little human interaction as possible. Both companies use .net programming platforms. I am trying to use XMLSerializer to convert the array of objects to xml form and I have this working. I am stumped by how to set up the actual exchange of the xml. I am currently writing the xml to a file and have verified the file contains the correct data.

Can someone help me with how best to go about sending the xml to our partner company in a way that allows them to load it into their system as easily and quickly as possible?

We are the recipient of data in a similar setup and our receiving code looks as follows:

List<TournyApprovedTeam> TournyTeams;
using (StringReader reader = new StringReader(HttpUtility.HtmlDecode Request.Form["XmlTeams"].ToString())))
{
                XmlSerializer serializer = new XmlSerializer(typeof(List<TournyApprovedTeam>), new XmlRootAttribute("TournyApprovedTeams"));
                TournyTeams = (List<TournyApprovedTeam>)serializer.Deserialize(reader);
 }

I need to know how this is being sent to us because I need to use the same type of code ...
0
Comment
Question by:davProg67
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39889013
Have you considered creating a web service at either end? The code you show above appears to belong to a web page (as indicated by the Request.Form bit). If you like, you could repeat that, but a web service would be more computer-friendly. You could use WCF or REST to build your service. WCF is a bit more involved, but tends to work out-of-the-box. What version of Visual Studio are you working with?
0
 

Author Comment

by:davProg67
ID: 39889073
I am working with 2010. I have no experience with web services or wcf but would love to learn it. Can you help?
0
 

Author Comment

by:davProg67
ID: 39889095
I need a working solution quickly as I am under heavy pressure for this. Any help is appreciated and I am open to all possibilities and am relying on the experts! I have researched this a lot and am just at an analysis paralysis state ...
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39889120
They are not topics that are conducive to be laid out in a comment, but there are numerous tutorials on the web for such. For plain WCF, you can start with:

http://msdn.microsoft.com/en-us/library/bb386386.aspx
http://msdn.microsoft.com/en-us/library/bb412178(v=vs.110).aspx
http://www.codeproject.com/Articles/406096/A-beginners-tutorial-for-understanding-Windows

For REST-based services, you can use a variation on WCF:

http://msdn.microsoft.com/en-us/magazine/dd315413.aspx
http://www.codeproject.com/Articles/571813/A-Beginners-Tutorial-on-Creating-WCF-REST-Services
http://msdn.microsoft.com/en-us/library/dd203052.aspx

...or you can use the newer Web API framework (that you must install separately in 2010):

http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api
http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api

If you go the Web API route, it is installed in VS 2012 by default, so you'll have a headstart on projects you create if you update VS versions. Web API is built around the MVC concept, so you'll also be able to jump into MVC projects should the need arise.
0
 

Author Closing Comment

by:davProg67
ID: 39892643
kaufmed provided exactly what I needed in his links. I got things working using a plain wcf web service. Thanks kaufmed, you rock!
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question