Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Passing XML Serialized Object between domains

Posted on 2014-02-26
5
Medium Priority
?
394 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

618 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