0

My requirement is iam working on Windows8 App, i need to send an Registration XML file to MVC4 Application which is acting as a service. Windows8 acts a client and MVC4 acts as Server. In server there will be already an Registration xml file, i need to check with that xml file any Username is already exist or not. If exits then i need send message that "username already exists please chosse other username." If not then I have to add a extra node in the registration.xml at server.

So now i need the Code how to send an XML file as an object in Windows8 App and how to receive/accept xml file in MVC4 Application.

1 Answers1

0

Why do you want to send and receive xml?

Just send the user registration info to the server using standard HTTP POST. Server will check the local xml file, and insert the new user info or return a validation error to the client.

No need to send XML back and fourth.

Also IMHO xml file storage is a poor choice for a server backend data store, the file should be locked frequently to avoid concurrency problems, which will cause performance issues.

My suggestion is to get a free database engine, or even better, Windows Azure Mobile Services.

If you insist, You can pass your xml as a regular string to an MVC action:

public ActionResult Validate(string xmlContent)
{
    XDocument doc1 = XDocument.Parse(xmlContent);

    //Do your manipulation here
}

Here is a link on how to manipulate XML in .NET

As for sending the xml to the server from Windows Phone, I think this answer helps.

Community
  • 1
  • 1
Tamim Al Manaseer
  • 3,554
  • 3
  • 24
  • 33
  • Hi Tamim, First of all thanks for Quick reply but i cant do anything requirement is like that, so i need code how to implement this. It will helpfull for me. Please if you have the code then post it here. – user2603964 Jul 21 '13 at 12:09
  • Hi Tamim,Thanks a lot you saved my time, further if i need your help i will contact you. – user2603964 Jul 22 '13 at 05:10
  • Great to be of service, would be a good idea to vote up and accept the answer :) – Tamim Al Manaseer Jul 22 '13 at 08:45