Friday, December 30, 2011

update multiple lines by appending in a single Soap Envelope

function button1_Click(eventObject)
{

var parentRequest=ParentNodeXML.XMLDocument.cloneNode(true);
var rowObj=EOB_TRA_Employee_AgreementGroup.getRows();
for(var i=0;i<rowObj.length;i++)
{
var rowIdx=rowObj[i].index;
var childRequest=childNode.XMLDocument.cloneNode(true);
cordys.setNodeText(childRequest,".//*[local-name()='EA_User_Id']",ea_user_id[rowIdx].value);
cordys.setNodeText(childRequest,".//*[local-name()='EA_Employment_Agreement_Type']", ea_employment_agreement_type[rowIdx].value);
cordys.setNodeText(childRequest,".//*[local-name()='EA_Employee_Agreement_Date']",ea_employee_agreement_date[rowIdx].value);
cordys.setNodeText(childRequest,".//*[local-name()='EA_Part_Or_Fulltime']",ea_part_or_fulltime[rowIdx].value);
cordys.setNodeText(childRequest,".//*[local-name()='EA_Employee_Type']",ea_employee_type[rowIdx].value);
cordys.setNodeText(childRequest,".//*[local-name()='EA_Hire_Date']",ea_hire_date[rowIdx].value);
cordys.setNodeText(childRequest,".//*[local-name()='EA_Probation_End_Date']",ea_probation_end_date[rowIdx].value);
cordys.setNodeText(childRequest,".//*[local-name()='EA_Department']",ea_department[rowIdx].value);
cordys.setNodeText(childRequest,".//*[local-name()='EA_Position']",ea_position[rowIdx].value);
cordys.setNodeText(childRequest,".//*[local-name()='EA_FTE']",ea_fte[rowIdx].value);
cordys.setNodeText(childRequest,".//*[local-name()='EA_Hours_Per_Week']",ea_hours_per_week[rowIdx].value);
cordys.setNodeText(childRequest,".//*[local-name()='EA_Days_Per_Week']",ea_days_per_week[rowIdx].value);
cordys.setNodeText(childRequest,".//*[local-name()='EA_Backgroundcheck_Status']",ea_backgroundcheck_status[rowIdx].value);
cordys.setNodeText(childRequest,".//*[local-name()='EA_Offer_Status']",ea_offer_status[rowIdx].value);
parentRequest.selectSingleNode(".//UpdateEOB_TRA_Employee_Agreement").appendChild(childRequest.selectSingleNode(".//tuple"));
}
alert(parentRequest.xml)
DummyModel.setMethodRequest(parentRequest);
DummyModel.reset();
}






<xml>
<xml id="ParentNodeXML">
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP:Body>
<UpdateEOB_TRA_Employee_Agreement xmlns="http://schemas.cordys.com/HRMS_Hiring_Metadata" reply="yes" commandUpdate="no" preserveSpace="no" batchUpdate="no" />
</SOAP:Body>
</SOAP:Envelope>
</xml>
<xml id="childNode">
<tuple>
<new>
<EOB_TRA_Employee_Agreement qAccess="0" qConstraint="0" qInit="0" qValues="">
<EA_User_Id />
<EA_Employment_Agreement_Type />
<EA_Employee_Agreement_Date />
<EA_Part_Or_Fulltime />
<EA_Employee_Type />
<EA_Hire_Date />
<EA_Probation_End_Date />
<EA_Department />
<EA_Position />
<EA_FTE />
<EA_Hours_Per_Week />
<EA_Days_Per_Week />
<EA_Backgroundcheck_Status />
<EA_Offer_Status />
</EOB_TRA_Employee_Agreement>
</new>
</tuple>
</xml>
</xml>

No comments:

Post a Comment