User Tools

Site Tools


Writing /app/www/public/data/meta/development/applications/ebonding/howto/xpaths.meta failed
development:applications:ebonding:howto:xpaths

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
development:applications:ebonding:howto:xpaths [2017/02/02 09:39] bcoffeydevelopment:applications:ebonding:howto:xpaths [2021/06/25 10:09] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== XPaths ======
 +Author : Brian Coffey
 +\\ Date : 2017-02-01
 +
 +===== XPath Overview =====
 +Xpaths are a powerful method of extracting information from an incoming XML message. 
 +
 +NOTE that tML-Base and tML-TA are replaced in the code as Xpath does not work well with messages like "namespace:tag".
 +
 +The CustomerMessage domain has many CustomerMessageMappings. These CustomerMessageMappings contain customer XPaths which are used to store the location of a particular value within the message e.g premises_access_person is located at 'ModifyRequest/ALocationAccessPerson/Name' within the XML incoming modify request message. 
 +
 +One thing to note on the Xpath location, the message name eg. ModifyAttributesRequest is not needed as this is contained in the parent CustomerMessage.
 +
 +Once this data is obtained using the XPath it is stored in an incomingInformationMap under the Errigal key for that particular CustomerMessageMapping
 +
 +===== XPath Examples =====
 +=== Sample Incoming Message ===
 +<code>
 +<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Header/><SOAP-ENV:Body>
 +<m:processSync xmlns:m="http://eBonding/taservice/send">&lt;?xml version="1.0"?&gt;
 +&lt;tML-TA:ModifyAttributesRequest xsi:schemaLocation="http://www.ansi.org/tML/TA/tML-TAtML-TA.xsd" xmlns="http://www.ansi.org/tML/TA/tML-TA" xmlns:tML-TABase="http://www.ansi.org/tML/TA/tML-TABase" xmlns:tmlta="http://www.ansi.org/tML/TA/tML-TA" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
 +  &lt;tML-TA:RequestId&gt;123&lt;/tML-TA:RequestId&gt;
 +  &lt;tML-TA:Customer&gt;
 +    &lt;tML-TABase:UserId&gt;EXT-M&lt;/tML-TABase:UserId&gt;
 +    &lt;tML-TABase:ServiceProfile&gt;Service Profile&lt;/tML-TABase:ServiceProfile&gt;
 +  &lt;/tML-TA:Customer&gt;
 +  &lt;tML-TA:TargetObjectName&gt;
 +    &lt;tML-TABase:DistinguishedName&gt;
 +      &lt;tML-TABase:RDNSequenceItem&gt;
 +        &lt;tML-TABase:Type&gt;networkID&lt;/tML-TABase:Type&gt;
 +        &lt;tML-TABase:Assertion&gt;EXT&lt;/tML-TABase:Assertion&gt;
 +      &lt;/tML-TABase:RDNSequenceItem&gt;
 +      &lt;tML-TABase:RDNSequenceItem&gt;
 +        &lt;tML-TABase:Type&gt;accountName&lt;/tML-TABase:Type&gt;
 +        &lt;tML-TABase:Assertion&gt;EXT-M&lt;/tML-TABase:Assertion&gt;
 +      &lt;/tML-TABase:RDNSequenceItem&gt;
 +      &lt;tML-TABase:RDNSequenceItem&gt;
 +        &lt;tML-TABase:Type&gt;troubleReportID&lt;/tML-TABase:Type&gt;
 +        &lt;tML-TABase:Assertion&gt;485689&lt;/tML-TABase:Assertion&gt;
 +      &lt;/tML-TABase:RDNSequenceItem&gt;
 +    &lt;/tML-TABase:DistinguishedName&gt;
 +  &lt;/tML-TA:TargetObjectName&gt;
 +  &lt;tML-TA:TroubleReportId&gt;485689&lt;/tML-TA:TroubleReportId&gt;
 +  &lt;tML-TA:ModifyRequest&gt;
 +    &lt;tML-TABase:AdditionalTroubleInfoList&gt;
 +      &lt;tML-TABase:AdditionalTroubleInfoItem&gt;TEST&lt;/tML-TABase:AdditionalTroubleInfoItem&gt;
 +    &lt;/tML-TABase:AdditionalTroubleInfoList&gt;
 +  &lt;/tML-TA:ModifyRequest&gt;
 +&lt;/tML-TA:ModifyAttributesRequest&gt;</m:processSync></SOAP-ENV:Body></SOAP-ENV:Envelope>
 +</code>
 +
 +=== Sample XPaths ===
 +<code>
 +Errigal Key: ticket_id, Customer XPath: TargetObjectName/DistinguishedName/RDNSequenceItem[Type='troubleReportID']/Assertion
 +Errigal Key: att_network_id, Customer XPath: TargetObjectName/DistinguishedName/RDNSequenceItem[Type='networkID']/Assertion
 +Errigal Key: trouble_info, Customer XPath: ModifyRequest/AdditionalTroubleInfoList
 +</code>
 +
 +