6525036 Super Contributor.
Super Contributor.
101 views

Inserting nodes into outgoing soapenvelope with dirxmlscript

Hi,

 

I've got the following data on the subscriber, on its way to a soap endpoint.

Now, I would like to insert mode nodes into the document.

Specifically, I would like to add some nodes and elements under "urn:ReleaionListe"

Is that doable in dirxmlscript, and if so, how do I select the correct node and insert information there?

 

 

 

 

<nds dtdversion="4.0" ndsversion="8.x">
  <source>
    <product edition="Advanced" version="4.5.5.0">DirXML</product>
    <contact>NetIQ Corporation</contact>
  </source>
  <input>
    <soapenv:Envelope xmlns:js="http://www.novell.com/nxsl/ecmascript" xmlns:ns="http://serviceplatformen.dk/xml/wsdl/soap11/Organisation/Bruger/4/" xmlns:ns1="http://serviceplatformen.dk/xml/schemas/CallContext/1/" xmlns:ns2="http://serviceplatformen.dk/xml/schemas/AuthorityContext/1/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:oio:sts:organisation:bruger:1.1.2.0" xmlns:urn1="urn:oio:sagdok:3.0.0" xmlns:urn2="urn:oio:sts:organisation:1.1.2.0">
      <soapenv:Header>
        <ns:RequestHeader>
          <ns:TransactionUUID>8102f28d-f9dc-2c64-1242-dfa9f77b9bb6</ns:TransactionUUID>
        </ns:RequestHeader>
      </soapenv:Header>
      <soapenv:Body>
        <ns1:RetRequest xmlns:ns="http://kombit.dk/xml/schemas/RequestHeader/1/" xmlns:ns1="http://serviceplatformen.dk/xml/wsdl/soap11/Organisation/Bruger/4/" xmlns:ns2="http://serviceplatformen.dk/xml/schemas/CallContext/1/" xmlns:ns3="http://serviceplatformen.dk/xml/schemas/AuthorityContext/1/">
          <ns3:AuthorityContext>
            <ns3:MunicipalityCVR>123456</ns3:MunicipalityCVR>
          </ns3:AuthorityContext>
          <urn:RetInput>
            <urn1:UUIDIdentifikator>1dfa73c7-453c-818a-61ab-b542bc696015</urn1:UUIDIdentifikator>
            <urn1:NoteTekst/>
            <urn:AttributListe>
              <urn:Egenskab>
                <urn1:Virkning>
                  <urn1:FraTidspunkt>
                    <urn1:TidsstempelDatoTid>2019-11-05T00:00:00.000+01:00</urn1:TidsstempelDatoTid>
                  </urn1:FraTidspunkt>
                  <urn1:TilTidspunkt>
                    <urn1:GraenseIndikator>true</urn1:GraenseIndikator>
                  </urn1:TilTidspunkt>
                  <urn1:AktoerRef>
                    <urn1:UUIDIdentifikator>1622cdc3-3443-4909-86a0-797b7df25aee</urn1:UUIDIdentifikator>
                  </urn1:AktoerRef>
                  <urn1:AktoerTypeKode>Organisation</urn1:AktoerTypeKode>
                </urn1:Virkning>
                <urn1:BrugervendtNoegleTekst>2CD1-5437-A8</urn1:BrugervendtNoegleTekst>
                <urn1:BrugerNavn>testebedste01</urn1:BrugerNavn>
              </urn:Egenskab>
            </urn:AttributListe>
            <urn:TilstandListe>
              <urn2:Gyldighed>
                <urn1:Virkning>
                  <urn1:FraTidspunkt>
                    <urn1:TidsstempelDatoTid>2019-11-05T00:00:00.000+01:00</urn1:TidsstempelDatoTid>
                  </urn1:FraTidspunkt>
                  <urn1:TilTidspunkt>
                    <urn1:GraenseIndikator>true</urn1:GraenseIndikator>
                  </urn1:TilTidspunkt>
                  <urn1:AktoerRef>
                    <urn1:UUIDIdentifikator>1622cdc3-3443-4909-86a0-797b7df25aee</urn1:UUIDIdentifikator>
                  </urn1:AktoerRef>
                  <urn1:AktoerTypeKode>Organisation</urn1:AktoerTypeKode>
                </urn1:Virkning>
                <urn2:GyldighedStatusKode>Aktiv</urn2:GyldighedStatusKode>
              </urn2:Gyldighed>
            </urn:TilstandListe>
            <urn:RelationListe>
              <urn1:Tilhoerer>
                <urn1:Virkning>
                  <urn1:FraTidspunkt>
                    <urn1:TidsstempelDatoTid>2019-11-05T00:00:00.000+01:00</urn1:TidsstempelDatoTid>
                  </urn1:FraTidspunkt>
                  <urn1:TilTidspunkt>
                    <urn1:GraenseIndikator>true</urn1:GraenseIndikator>
                  </urn1:TilTidspunkt>
                  <urn1:AktoerRef>
                    <urn1:UUIDIdentifikator>1622cdc3-3443-4909-86a0-797b7df25aee</urn1:UUIDIdentifikator>
                  </urn1:AktoerRef>
                  <urn1:AktoerTypeKode>Organisation</urn1:AktoerTypeKode>
                </urn1:Virkning>
                <urn1:ReferenceID>
                  <urn1:UUIDIdentifikator>1678cdf6-3692-4909-86a0-797b7df25aee</urn1:UUIDIdentifikator>
                </urn1:ReferenceID>
              </urn1:Tilhoerer>
              <urn1:TilknyttedePersoner>
                <urn1:Virkning>
                  <urn1:FraTidspunkt>
                    <urn1:TidsstempelDatoTid>2019-11-05T00:00:00.000+01:00</urn1:TidsstempelDatoTid>
                  </urn1:FraTidspunkt>
                  <urn1:TilTidspunkt>
                    <urn1:GraenseIndikator>true</urn1:GraenseIndikator>
                  </urn1:TilTidspunkt>
                  <urn1:AktoerRef>
                    <urn1:UUIDIdentifikator>1622cdc3-3443-4909-86a0-797b7df25aee</urn1:UUIDIdentifikator>
                  </urn1:AktoerRef>
                  <urn1:AktoerTypeKode>Organisation</urn1:AktoerTypeKode>
                </urn1:Virkning>
                <urn1:ReferenceID>
                  <urn1:UUIDIdentifikator>e56ded61-5341-e658-53de-9b8e6823dfb1</urn1:UUIDIdentifikator>
                </urn1:ReferenceID>
              </urn1:TilknyttedePersoner>
            </urn:RelationListe>
          </urn:RetInput>
        </ns1:RetRequest>
      </soapenv:Body>
    </soapenv:Envelope>
  </input>
</nds>

 

 

 

Labels (1)
0 Likes
1 Reply
6525036 Super Contributor.
Super Contributor.

Re: Inserting nodes into outgoing soapenvelope with dirxmlscript

OK,

 

*[local-name()='Body']/*[local-name()='RetRequest']/*[local-name()='RetInput']/*[local-name()='RelationListe']

Seems to be the correct xpath. Somehow the current node must be <soapenv:Envelope> when we process this kind of document. I figured it was the input node.

And in my original question, it wrote urn:ReleaionListe, it should have been urn:RelationListe

Spelling errors in xpath questions could potentially be counterproductive

And how did I figure that out? you may ask. Since I had no idea what the current node was, I just appended an xml element to .

Like this:

 

<do-append-xml-element expression="." name="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>

 

Then it was quite visible in the trace where "." was.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.