Query regarding pubwebdocumentToRecord

Hi,
I have an XML document (see example below) that I would like to map to a record structure. I’ve tried doing pub.web:stringToDocument (convert XML to node) and then pub.web:documentToRecord (convert node to record).
It seems that only the last <member> element (i.e. name = “grade”) is mapped onto the record but not the other <member> elements (where name == “studentId”, “subjectId”, “subjectName”, “score”). Any clues how to resolve this problem?

<?xml version=‘1.0’?>
<methodResponse>
<params>
<param>
<value><array><data>
<value><struct>
<member>
<name>studentId</name>
<value><string>S200208</string></value>
</member>
<member>
<name>subjectId</name>
<value><int>500</int></value>
</member>
<member>
<name>subjectName</name>
<value><string>HISTORY</string></value>
</member>
<member>
<name>score</name>
<value><double>85.0</double></value>
</member>
<member>
<name>grade</name>
<value><string>A+</string></value>
</member>
</struct></value>
</data></array></value>
</param>
</params>
</methodResponse>

regards…
Victor

Hello Victor,

Could you please let us know what are the other parameters that you have set for pub.web:documentToRecord and pub.web:stringToDocument. This I am asking because without any parameters being set, it works properly, with all the elements being displayed.

-Rajesh Rao

Victor,

I hope you have created IS document type for methodResponse in webMethods Developer/Integrator tool.

So once you are done with stringToDocument step in the next follow step
documentToRecord (set these params makeArrays=false and also set recordName(folder.subfolder:methodResponse)fully qualified record Name and map the output boundNode to a recordReference (methodResponse).

And step thru the flow and see the results tab after the documentToRecord step,you should see all the <memeber>iterations in the methodResponse record.

let us know the results.

HTH,
RMG

Thanks all. This works fine now.
I had originally created a record structure that consists of 5 “member” records. This didn’t map correctly from the XML.
So I created a “member” recordlist and this works now.

Cheers…
Victor