Hello,
I am converting xCBL Order data from xml string to xCBL Order document using xmlStringToXMLNode and then xmlNodeToDocument. To validate the generated document against WmxCBL3.5rder document(i.e. WmxCBL.com.commerceone.XCBL35.n1_0rder), the simple elements should be converted to documents and some complex element to document list. Hence I have set the list of such simple elements in “documents” input param of xmlNodeToDocument service, and complex elements in “arrays” input param of xmlNodeToDocument service. But I have certain complex type in Order document that I wish to convert to document list. e.g. “StructuredNote” element. When I do not receive any child element value for such complex element in input xml string, the xmlNodeToDocument service will generate this element just as string list and not as document list. As a result, my order doc fails validation against WmxCBL3.5 Order document type.
Here is the part of xCBL 3.5 Order.xsd that refers to above mentioned comlpex element “StructuredNote” (I have removed starting tag of xsd so that it can be viewed properly in browser):
If you set “StructuredNote” in the “arrays” also set makeArrays=true in the xmlNodeToDocument and specify the documentTypeName(XCBL Order doc fully qualified path)this should take care of the rest.
Thanks for response RMG.
But if I give documentTypeName name for the service xmlNodeToDocument, makeArrays should be false and arrays should not be set. I tried that way but could not get such element as document list if its child element are not appearing.
Is it just me or is this a major defect in webMethods, that regularly bites us in the behind? Why can’t this very basic service actually work when passed the doc type name?
nodeToDocument (use webMethods IS document name)
documentToXMLString (use same webMetods IS document name)
xmlStringToNode
nodeToDocument (use webMethods IS document name)
Output should have proper structure as per webMethods IS document.
This was also an issue for us. If you have this package in your system: WmIPRoot, you can use this service: wm.ip.util:documentToRecord, two input parameters (they are invisible, you need to type in):
makeArrays: set to “false”
recordName: set to “WmxCBL…”
This service works better in most cases than xmlNodeToDocument (it handle the list type of nodes properly).
HTH,
Tong