# Address Cleanse Using CUSTOM SoT

### Enable the CUSTOM Validation Module

Note that this is a separately licensable module. Add the below snippet in Harmony\_home/config/scrubbing/scrubbing\_pdp.xml to enable the custom validation.

```
<msi:pdp msi:model="ADDRESS_DATA">

    <msi:pdp-name>CustomValidationTUI</msi:pdp-name>

    <msi:pdp-class>com.mastersoft.harmony.customvalidation.pdp.CustomValidationPDP</msi:pdp-class>

  </msi:pdp>
```

You can then assign the new PDP above to the tui-custom-role like so:&#x20;

<div align="left"><figure><img src="https://2735524619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fhp3nSGDGzW6K0AYaMW45%2Fuploads%2FRVRAgnJdebUvgeSgpSO2%2Fimage.png?alt=media&#x26;token=10e0e696-cbb2-46cd-9904-0ee28cb79432" alt=""><figcaption></figcaption></figure></div>

### Cleanse an Address via Harmony Management Console

You can then check using the Harmony Management Console if the module is working accordingly.

<figure><img src="https://2735524619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fhp3nSGDGzW6K0AYaMW45%2Fuploads%2FLPOw3pQEMkWHpZiHMiKf%2Fimage.png?alt=media&#x26;token=948630d4-d737-4d5c-a2e2-79daa643ad45" alt=""><figcaption></figcaption></figure>

### Sample SOAP Request and Response

<details>

<summary>Request: parseCustomerData</summary>

```json
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:mastersoft.com.au:harmony:cai:ServiceEndpointInterface" xmlns:urn1="urn:msi.com.au:harmony:msiparty:1" xmlns:xlin="http://www.w3.org/1999/xlink" xmlns:urn2="urn:msi.com.au:harmony:export:1" xmlns:urn3="urn:oasis:names:tc:ciq:xpil:3" xmlns:urn5="urn:oasis:names:tc:ciq:xnl:3" xmlns:urn4="urn:oasis:names:tc:ciq:xal:3" xmlns:urn6="urn:msi.com.au:harmony:partyrelations:1">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:DataParsingRequest>
         <urn:HarmonyServiceConfig>
		  <property name="role" value="tui-custom-role"/>
  		  <property name="locale" value="NEW_ZEALAND"/>        
         </urn:HarmonyServiceConfig>
         <ParserInputs>
            <urn:RawDataInput>
			<FreeText dataModel="ADDRESS_LINE_1" >1/10 PHOENIX PLACE, PAPATOETOE, AUCKLAND 2025</FreeText>  
            </urn:RawDataInput>
         </ParserInputs>
      </urn:DataParsingRequest>
   </soapenv:Body>
</soapenv:Envelope>


```

</details>

<details>

<summary>Response: parseCustomerData</summary>

```json
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <ns9:DataParsingResponse xmlns:a="urn:oasis:names:tc:ciq:xal:3" xmlns:ex="urn:msi.com.au:harmony:export:1" xmlns:m="urn:msi.com.au:harmony:partyrelations:1" xmlns:mp="urn:msi.com.au:harmony:msiparty:1" xmlns:n="urn:oasis:names:tc:ciq:xnl:3" xmlns:ns10="http://www.w3.org/1999/xlink" xmlns:ns9="urn:mastersoft.com.au:harmony:cai:ServiceEndpointInterface" xmlns:p="urn:oasis:names:tc:ciq:xpil:3">
         <ParseResult>
            <mp:Party>
               <p:Addresses>
                  <a:Address>
                     <a:FreeTextAddress>
                        <a:AddressLine>FLAT 1 10 PHOENIX PLACE, PAPATOETOE, AUCKLAND 2025</a:AddressLine>
                     </a:FreeTextAddress>
                     <a:AdministrativeArea>
                        <a:Name/>
                        <a:SubAdministrativeArea>AUCKLAND</a:SubAdministrativeArea>
                     </a:AdministrativeArea>
                     <a:Locality>
                        <a:Name>PAPATOETOE</a:Name>
                     </a:Locality>
                     <a:Thoroughfare>
                        <a:Number>10</a:Number>
                        <a:NameElement a:NameType="NameOnly">PHOENIX</a:NameElement>
                        <a:NameElement a:NameType="Type">PLACE</a:NameElement>
                     </a:Thoroughfare>
                     <a:Premises>
                        <a:NameElement a:NameType="BuildingName"/>
                        <a:SubPremises>
                           <a:Number>1</a:Number>
                           <a:NameElement a:NameType="ReferenceLocation">SUBDWELLING</a:NameElement>
                           <a:NameElement a:NameType="PremisesType">FLAT</a:NameElement>
                        </a:SubPremises>
                        <a:SubPremises>
                           <a:NameElement a:NameType="PremisesType"/>
                           <a:Number/>
                           <a:NameElement a:NameType="ReferenceLocation">FLOOR</a:NameElement>
                        </a:SubPremises>
                     </a:Premises>
                     <a:PostCode>
                        <a:Identifier>2025</a:Identifier>
                     </a:PostCode>
                     <a:GML>
                        <gml:Point xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink">
                           <gml:pos>174.84010315 -36.97443008</gml:pos>
                        </gml:Point>
                     </a:GML>
                  </a:Address>
               </p:Addresses>
            </mp:Party>
         </ParseResult>
      </ns9:DataParsingResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
```

</details>
