I need help to create a xml GetCaseInformationResponseMessage message below from objXmlSimpleTypeDoc xml document.
I am trying to find SimpleTypeCompanion/EnumerationValue/@code node that matches the CourtNCIC value.
To get CourtNCIC, I am passing a case number to a method that finds CourtNCIC number.
Here is that method
objXmlMNCISData = Library.v4.Case.GetIxmlForCaseNumber(strCaseNumber, "CourtCaseHeaderGroup", False)
'Get CourtNCIC from the object
strCourtNCIC = objXmlMNCISData.DocumentElement.SelectSingleNode("Case/Court/CourtNCIC").InnerText
XML that I want to create
<GetCaseInformationResponseMessage>
<CourtLocation>
<CourtName>McKnight County</CourtName>
<ORINumber>MN010015J</ORINumber >
<MNCISNodeID>222</MNCISNodeID>
<PhoneNumber>800-001-7127</PhoneNumber>
</CourtLocation>
</GetCaseInformationResponseMessage>
objXmlSimpleTypeDoc xml document
<SimpleTypeCompanion enumerates="CourtLocationTextType">
<EnumerationValue code="DC27ZAPPY">
<Text>Zapy County</Text>
<AssociatedValue type="MNCISNodeID">
<Text>130</Text>
</AssociatedValue>
<AssociatedValue type="CountyName">
<Text>Zapy</Text>
</AssociatedValue>
<AssociatedValue type="JudicialDistrict">
<Text>40th</Text>
</AssociatedValue>
</EnumerationValue>
<EnumerationValue code="MN010015J">
<Text>McKnight County</Text>
<AssociatedValue type="MNCISNodeID">
<Text>222</Text>
</AssociatedValue>
<AssociatedValue type="CountyName">
<Text>Passaic</Text>
</AssociatedValue>
<AssociatedValue type="JudicialDistrict">
<Text>11st</Text>
</AssociatedValue>
<AssociatedValue type="PhoneNumber">
<Text>800-001-7127</Text>
</AssociatedValue>
<AssociatedValue type="FaxNumber">
<Text>800-001-5555</Text>
</AssociatedValue>
<AssociatedValue type="Street1">
<Text>234 Stension St</Text>
</AssociatedValue>
<AssociatedValue type="City">
<Text>Spruce</Text>
</AssociatedValue>
<AssociatedValue type="State">
<Text>WY</Text>
</AssociatedValue>
<AssociatedValue type="Zip">
<Text>84327</Text>
</AssociatedValue>
</EnumerationValue>
</SimpleTypeCompanion>
What I have tried:
VB.NET code that I have tried
Public Shared Sub ProcessGetCaseInformationRequestMessage(ByRef aobjBroker As ServiceCatalog.Library.v4.Broker, ByRef aobjXmlContentDoc As System.Xml.XmlDocument, ByRef aobjXmlNamespaceManager As System.Xml.XmlNamespaceManager)
Dim objXmlMNCISData As XmlDocument
Dim strCaseNumber As String
Dim strCourtName As String
Dim objXmlCourtLocationNode As XmlNode
Dim objXmlResponseDoc As XmlDocument
Dim strORINumber As String
Dim strMNCISNodeID As String
Dim strPhoneNumber As String
Dim strCourtNCIC As String
Dim objXmlSimpleTypeDoc As System.Xml.XmlDocument
strCaseNumber =
aobjXmlContentDoc.DocumentElement.SelectSingleNode("m:CourtFileNumber", aobjXmlNamespaceManager).InnerText
objXmlResponseDoc = New XmlDocument
objXmlResponseDoc.AppendChild(objXmlResponseDoc.CreateElement("GetCaseInformationResponseMessage", aobjXmlNamespaceManager.LookupNamespace("m")))
Try
objXmlMNCISData = Library.v4.Case.GetIxmlForCaseNumber(strCaseNumber, "CourtCaseHeaderGroup", False)
strCourtNCIC = objXmlMNCISData.DocumentElement.SelectSingleNode("Case/Court/CourtNCIC").InnerText
objXmlSimpleTypeDoc = Msc.Integration.CourtXml.Library.v4.SimpleType.GetCompanionFile("CourtLocationTextType")
objXmlCourtLocationNode = objXmlResponseDoc.CreateElement("CourtLocation", aobjXmlNamespaceManager.LookupNamespace("m"))
objXmlCourtLocationNode.AppendChild(objXmlResponseDoc.CreateElement("CourtName", aobjXmlNamespaceManager.LookupNamespace("m")))
objXmlSimpleTypeDoc.DocumentElement.SelectSingleNode("m:EnumerationValue[@code=" + strCourtNCIC]/Text", aobjXmlNamespaceManager).InnerText = strCourtName
'ORINumber
objXmlCourtLocationNode.AppendChild(objXmlResponseDoc.CreateElement("ORINumber", aobjXmlNamespaceManager.LookupNamespace("m")))
objXmlSimpleTypeDoc.DocumentElement.SelectSingleNode("m:CourtName", aobjXmlNamespaceManager).InnerText = strORINumber
'MNCISNode ID SimpleTypeCompanion\EnumerationValue\AssociatedValue\Text
objXmlCourtLocationNode.AppendChild(objXmlResponseDoc.CreateElement("CourtName", aobjXmlNamespaceManager.LookupNamespace("m")))
objXmlSimpleTypeDoc.DocumentElement.SelectSingleNode("m:CourtName", aobjXmlNamespaceManager).InnerText = strMNCISNodeID
'PhoneNumber
objXmlCourtLocationNode.AppendChild(objXmlResponseDoc.CreateElement("PhoneNumber", aobjXmlNamespaceManager.LookupNamespace("m")))
objXmlSimpleTypeDoc.DocumentElement,SelectSingleNode("m:CourtName", aobjXmlNamespaceManager).InnerText = PhoneNumber
End Sub