Forum Discussion

AKUMA_234040's avatar
Icon for Nimbostratus rankNimbostratus
Apr 29, 2019

How to use irule or iRule LX to call external soap web service which use wss4j for security

How to use irule or iRule LX to call external soap web service, the web service which use wss4j for authentication, the following is the soapenv:Envelope which can be used to call the webservice:"; xmlns:xsd=";"; xmlns:wsu="; ? ?



2 Replies

  • If you just want to do the POST and do something with the data you can use iRulesLX. It could look like something like this. Please note, that this is just an example. This code is not tested and will need probably need some modification to fit your needs.




    when SOME_EVENT {
        set var1 "var1"
        set var2 "var2"
        set var3 "var3"
        set rpc_handle [ ILX::init xml_plugin ext_xml ]
        if {[ catch { ILX::call $rpc_handle sendXML $var1 $var2 $var3 } result ] } {
            log local0. "sendXML failed, ILX failure: $result"
         do something with the result
        log local0. "Result: $result"



    const http = require("http");
    var f5 = require("f5-nodejs");
    var ilx = new f5.ILXServer();
    ilx.addMethod('sendXML', function(req, res) {
        var var1 = req.params()[0];
        var var2 = req.params()[1];
        var var3 = req.params()[2];
        var postData = ' ... ';
        var options = {
            hostname: '',
            port: 80,
            path: '/cmit/services/dataService.dataServiceHttpSoap11Endpoint/',
            method: 'POST',
            headers: {
               'Content-Type': 'text/xml',
               'Content-Length': postData.length,
        var request = http.request(options, (response) => {
            response.on('data', (d) => {
                /* data received, maybe do something with the data */
                return res.reply('successful');
        request.on('error', (e) => {
            return res.reply('failed');
    • Nikoolayy1's avatar
      Icon for MVP rankMVP

      That is great and if Content-Type is changed to something like

      then also REST calls probably could be send as I see no issues! Just postData should also be json not xml.