Extended Operations

In CallReply mode, the DSMLv2 SOAP Connector can send DSMLv2 extended operations. You can know further about this through the information provided here.

Extended operations are identified by their Operation Identifier (OIDs). For example, the OID of the extended operation for retrieving a part of the log file of the IBM® Security Directory Server is 1.3.18.0.2.12.22.

Extended operations can also have a value property, which is a data structure containing input data for the corresponding operation. The value property of the extended operation must be Basic Encoding Rules (BER) encoded and then base-64 encoded in the DSMLv2 message. The user of the DSMLv2 SOAP Connector is responsible only for BER encoding the value property. The Connector will automatically base-64 encode the data when creating the DSMLv2 message.

Two classes are used for BER encoding and decoding: BEREncoder and BERDecoder, located in thecom.ibm.asn1 package.

The following example illustrates sending a DSMLv2 extended operation request and the processing of the response:

  1. Place the following script code in Output Map for attribute dsml.extended.requestvalue:
    enc = new Packages.com.ibm.asn1.BEREncoder();
    serverFile = 1;  //slapdErrors log file
    
    nFirstLine = new java.lang.Integer(7200);  
    nLastLine = new java.lang.Integer(7220);
    
    seq_nr = enc.encodeSequence();
    enc.encodeEnumeration(serverFile);   
       
    enc.encodeInteger(nFirstLine);
    enc.encodeInteger(nLastLine);
    
    enc.endOf(seq_nr);
    var myByte = enc.toByteArray();
    
    ret.value = myByte;
  2. Place the following script code in the After CallReply hook of the Connector:
    var ba = conn.getAttribute("dsml.response").getValue(0);
    bd = new Packages.com.ibm.asn1.BERDecoder(ba);
    
    main.logmsg("SLAPD log file:");
    main.logmsg(new java.lang.String(bd.decodeOctetString()));