Problem in creating document list out of xmlNodeToDocument

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):

xsd:element name=“ListOfStructuredNote” type=“ListOfStructuredNote”/
xsd:complexType name=“StructuredNote”
xsd:sequence
xsd:element minOccurs=“0” name=“GeneralNote” type=“xsd:string”/
xsd:element minOccurs=“0” name=“NoteID” type=“xsd:string”/
xsd:element minOccurs=“0” ref=“Agency”/
xsd:element minOccurs=“0” name=“NoteURL” type=“xsd:anyURI”/>
xsd:element minOccurs=“0” name=“TextTypeCoded” type=“TextTypeCode”/>
xsd:element minOccurs=“0” name=“TextTypeCodedOther” type=“xsd:string”/>
/xsd:sequence>
/xsd:complexType>

Kindly suggest some way to convert this element (StructuredNote) into document list and not string list in the output of xmlNodeToDocument service.

Ashu,

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.

HTH,
RMG

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.

Ashu,

yes you are right,still wondering what could be the problem.

Normally if you set documentName it should take care of doclists in the output,for complex arrays,if u specify “arrays” elements it should work.

Regards,

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?

Hi,

Were you able to resolve this problem ??
I am stuck in exact same issue and have not been able to figure out the solution.

Please help

Regards
Namita

PLease try following steps -

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