-1

I'm trying to read data from WSDL file and get stuck, because there could be a big hierarchical tree and I don't know what kind data structure use to get inputs and outputs, because they can have input as a object and object can point to couple simple inputs and second object... this could go on and on. So I don't know what to use. Maybe tree, maybe indexes. What is the best practise and can you give small example how data could be controlled?

P.S. I'm developing automated tests generation tool, whose will use WSDL files for generation.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
krapstuke
  • 1
  • 1

2 Answers2

0

Your best bet is to use good old classes. First thing to do is to use utility like svcutils.exe (Code generator tool) to create the client code from WSDL. Form this you will get the idea about how deep the tree is going to be.

Once you have Object View of the structure then start creating Classes and apply OOP design patterns. This will help with at least two things:

  1. Avoiding code duplication and
  2. When you start constructing your object in the code it will give you idea which node comes under which parent etc.

Hope this helps.

Another thing also to consider is use some sort of object serialization meach. Serialization will help you in great deal when dealing with complex tree like data from XML to objects and vice a versa.

activebiz
  • 6,000
  • 9
  • 41
  • 64
  • serilization itself is a pretty broad topic. A good example in word is "teleporting" in star trek term :). Try looking at following... http://stackoverflow.com/questions/10824431/how-does-serialize-and-de-serialize-work-internally; http://stackoverflow.com/questions/3984476/what-is-serialization-all-about – activebiz Nov 08 '12 at 12:04
0

WSDL is based on XML, which already is a tree structure. Not sure why you want to read it into objects first -- just use Linq to XML to read the WSDL directly.

Eren Ersönmez
  • 38,383
  • 7
  • 71
  • 92
  • I'm building application whose is generating automated tests from WSDL. So i need to get data to use it for generation, letting user to select inputs and so on. – krapstuke Nov 08 '12 at 10:30