Thank you for your post cigwork. One more question, the XML data that is pulled when I run the SOAP call has a bunch of fields, one of which I need to pull data from.. How do I go about pulling the value from idc:field name="dWfStepName?
I need to filter the list I am returning from the XML data based on the value of that field.
I am trying to pull a list of active workflows based on who is required to perform an action on them. If dWfStepName = Workcell, I don't want the dDocName in the list, otherwise if it contains anything else, I want to populate the list with the dDocName and dCreateDate.
<?xml version="1.0" encoding="utf-8" ?>
- <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
- <SOAP-ENV:Body>
- <idc:service xmlns:idc="http://www.stellent.com/IdcService/" IdcService="SEARCH_WORKFLOWS">
- <idc:document dUser="user">
<idc:field name="SearchAuthor" />
<idc:field name="SearchCID">arf</idc:field>
<idc:field name="SearchAssn" />
- <idc:resultset name="WfDocuments">
- <idc:row dDocName="ARF16-0711" dID="596213" dDocType="JPS_QMARF" dDocTitle="ARF16-0711 AMYWSA3377 Prop Lbl Prod PV Mat LStatn" dDocAuthor="author" dRevClassID="283640" dRevisionID="1" dRevLabel="A0" dIsCheckedOut="0" dCheckoutUser="" dSecurityGroup="Submitted_Forms" dCreateDate="8/23/16 3:10 PM" dInDate="8/23/16 3:10 PM" dOutDate="" dStatus="REVIEW" dReleaseState="E" dFlag1="" dWebExtension="hcsp" dProcessingState="Y" dMessage="" dDocAccount="" dReleaseDate="" dRendition1="" dRendition2="" dIndexerState="" dPublishType="" dPublishState="">
<idc:field name="dWfID">1741</idc:field>
<idc:field name="dWfDocState">INPROCESS</idc:field>
<idc:field name="dWfComputed" />
<idc:field name="dWfCurrentStepID">6168</idc:field>
<idc:field name="dWfDirectory">submitted_forms</idc:field>
<idc:field name="dClbraName" />
<idc:field name="dWorkflowState">R</idc:field>
<idc:field name="dRevRank">0</idc:field>
<idc:field name="xReferenced_By" />
<idc:field name="xNew_Assembly">No</idc:field>
<idc:field name="xNew_Product_Containment" />
<idc:field name="xBay_Number" />
<idc:field name="xWave_Number" />
<idc:field name="xCell_Number" />
<idc:field name="xVendor" />
<idc:field name="xPlant" />
<idc:field name="xIndustry" />
<idc:field name="xAffected_Departments" />
<idc:field name="xIDCPlacement" />
<idc:field name="xProduct_Group" />
<idc:field name="xIDCWatermark">None</idc:field>
<idc:field name="xCustomer">Amway</idc:field>
<idc:field name="xIDCSecureChange" />
<idc:field name="xIDCSecurePrint">Enable</idc:field>
<idc:field name="xIDCSecureSelect" />
<idc:field name="xIDCSecureNotes" />
<idc:field name="xSystem_Internal" />
<idc:field name="xImpacts_EMS" />
<idc:field name="xCustomer_ECO_Number" />
<idc:field name="xDistribution" />
<idc:field name="xCustomer_Deviation" />
<idc:field name="xAssembly_Number">AMYWSA3377</idc:field>
<idc:field name="xPart_Number" />
<idc:field name="xComments" />
<idc:field name="xReference_Documents">,</idc:field>
<idc:field name="xworkflowRouting" />
<idc:field name="xphase" />
<idc:field name="xAssigned">dawkinsd</idc:field>
<idc:field name="xTraining">No</idc:field>
<idc:field name="xVerification">No</idc:field>
<idc:field name="xValidation">Yes</idc:field>
<idc:field name="temp_xcustomer_eco_number" />
<idc:field name="temp_xcustomer_deviation" />
<idc:field name="dWfStepName">Workcell</idc:field>
<idc:field name="dWfStepID">6168</idc:field>
<idc:field name="dWfStepDescription" />
<idc:field name="dWfStepType">:R:</idc:field>
<idc:field name="dWfStepIsAll">0</idc:field>
<idc:field name="dWfStepWeight">1</idc:field>
<idc:field name="dWfName">Amway_JPS_ARF_WF</idc:field>
<idc:field name="dWfDescription" />
<idc:field name="dCompletionDate" />
<idc:field name="dWfStatus">INPROCESS</idc:field>
<idc:field name="dWfType">SubWorkflow</idc:field>
<idc:field name="dProjectID" />
<idc:field name="dIsCollaboration">0</idc:field>
</idc:row>
</idc:resultset>
</idc:document>
</idc:service>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I tried setting up
XmlNode node = xn.SelectSingleNode("idc:field name='dWfStepName'")
but kept getting the following error
'idc:field name='dWfStepName'' has an invalid token.
I apologize for asking what seems to be like simple questions. I am very new to XML. Most of my background is with LabView, C++, C# and SQL.
cigwork edit
Have a look at ... http://www.w3schools.com/xsl/xpath_syntax.asp
In this case you're interested in selecting nodes by attributes and the value is the innertext of the node.
XmlNodeList xnList = document.SelectNodes("//idc:field[@name='dWfStepName']", manager);
int nodes = xnList.Count;
foreach (XmlNode xn in xnList) {
Console.WriteLine("Step Name: {0}",
xn.InnerText);