Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Communication between modules based on XML messages

xml communication

  • Please log in to reply
2 replies to this topic

#1 MegaMan123

MegaMan123

    CC Lurker

  • New Member
  • Pip
  • 5 posts

Posted 21 September 2012 - 10:47 AM

Hello guys!

At work I was able to join the team that creates quite a large and complicated system. Before implementation, I would like to have my own thoughts and a little more understanding of the subject.

Could you read few questions ?

1 )

I have to create a module which can communicate with that system, and perform some necessary actions. Whole communication between system and all modules are based on XML messages, which can have very different forms ( only header is constant ). The simplest message can be XML with one node, while another could have three of them . What do you think about it ? Could you guide me, how to parse those messages in the most elegant way ? Maybe I should try to keep some templates of those messages in external files?

2 )

The system gives the ability to listen for new messages, receive and interpret them. Here comes the next question about architecture. In this case we have to create an additional thread that will only listen to the "mailbox", and if a message was detected it will pass it to the main thread where it can be interpreted. Do you think it’s a good idea ?

3 )

The last thing I would like to ask you guys, is application architecture where the action is based on the “question / answer” ? Give me a second and I will explain myself : Before module can perform any action, it has to communicate with the system. Please, check the “chip” example ;- )

Module: Can I go home ?
System: Yes, you can
Module: Then please give me the keys
System: Here you are
Module: Thanks, got them!

So to take any action, you must first speak a little with a system. I don’t have any clue, how to implement this in right way. Maybe some kind of machine state ?

I don’t ask for any code, but for guide so I can implement this with my own power :D

So, Please. Could you give me your wise hand ? :- ))
  • 0

#2 lespauled

lespauled

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1360 posts
  • Programming Language:C, C++, C#, JavaScript, PL/SQL, Delphi/Object Pascal, Visual Basic .NET, Pascal, Transact-SQL, Bash

Posted 21 September 2012 - 10:54 AM

Sounds like a simple case of webservices/WCF.
  • 0
My Blog: http://forum.codecal...699-blog-77241/
"Women and Music: I'm always amazed by other people's choices." - David Lee Roth

#3 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts
  • Location:Argentina
  • Programming Language:C, C++, C#, PHP, JavaScript, Transact-SQL, Bash, Others
  • Learning:Java, Others

Posted 21 September 2012 - 05:25 PM

Just as lespauled said you need to read a little about webservices, wcf or soap

here is a little code about it, i just have my mind working in the part you said the system need to handle new messages, i wonder what exactly did you mean, if about messages or about protocol-like, since when you work on webservices you need to manifest the messages to the server so they can be routed and validated ...
  • 0





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download