XML class to EnsLib.EDI.XML.Document?

I have used Studio's schema wizard to create classes representing my XML structure as defined in an xsd file and then I use the main class of that set of classes as parameter in my Ensemble web service.

 

Let's say I have a web method signature like this:

Method myMethod(message As My.Schema) As %String [ WebMethod ]

How do in that method take this message and convert it into a EnsLib.EDI.XML.Document?

My.Schema extends both %Persistent and %XML.Adaptor so I guess there should be some simple way to create an instance of EnsLib.EDI.XML.Document out of it?

 

EnsLib.EDI.XML.Document has for instance a method ImportFromString so maybe I should somehow first convert that message to string or what should I do?

  • 0
  • 0
  • 199
  • 2
  • 0

Comments

Why do you need EnsLib.EDI.XML.Document?  If you already have persistent classes, then you can use the persistent classes in many places where EnsLib.EDI.XML.Document can be used.

One place you can't use persistent classes is where you need to obtain such things as a count of repeating elements in a Routing Rule, at least while using "native" rule functionality. EnsLib.EDI.XML.Document supports that in a way that's consistent with other document types.