Forum Discussion

Gavin_104961's avatar
Gavin_104961
Icon for Nimbostratus rankNimbostratus
Mar 21, 2011

How can i use soapUI direct adding a pool

Hi Folks,

 

 

I am tring to use the soapUI (http://www.soapui.org/) add a pool with pool members, does anyone know how should i do change the following XML to add a pool by soap direct?

 

 

Thanks!

 

 

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pool="urn:iControl:LocalLB/Pool" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">

 

<soapenv:Header/>

 

<soapenv:Body>

 

<pool:create soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

 

<pool_names xsi:type="urn:Common.StringSequence" soapenc:arrayType="xsd:string[]" xmlns:urn="urn:iControl"/>

 

<lb_methods xsi:type="urn:LocalLB.LBMethodSequence" soapenc:arrayType="urn:LocalLB.LBMethod[]" xmlns:urn="urn:iControl"/>

 

<members xsi:type="urn:Common.IPPortDefinitionSequenceSequence" soapenc:arrayType="urn:Common.IPPortDefinitionSequence[]" xmlns:urn="urn:iControl"/>

 

</pool:create>

 

</soapenv:Body>

 

</soapenv:Envelope>

 

  • I haven't used soapUI before, so I'm not sure how the UI works. Your SOAP message is missing all of the parameter elements (they are all empty). Here's the trace of a create call using perl's SOAP::Lite for a pool named "foopool" with a lb method of "LB_METHOD_ROUND_ROBIN" and an initial member of "10.10.10.10:80".

    Hope this helps...

    
    < ?xml version="1.0" encoding="UTF-8"?>
    < soap:Envelope
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      < soap:Body>
        < create xmlns="urn:iControl:LocalLB/Pool">
          < pool_names soapenc:arrayType="xsd:string[1]" xsi:type="soapenc:Array">
            < item xsi:type="xsd:string">foopool< /item>
          < /pool_names>
    
          < lb_methods soapenc:arrayType="xsd:string[1]" xsi:type="soapenc:Array">
            < item xsi:type="xsd:string">LB_METHOD_ROUND_ROBIN< /item>
          < /lb_methods>
    
          < members soapenc:arrayType="soapenc:Array[1]" xsi:type="soapenc:Array">
            < item soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array">
              < item>
                < address xsi:type="xsd:string">10.10.10.10< /address>
    
                < port xsi:type="xsd:int">80< /port>
              < /item>
            < /item>
          < /members>
        < /create>
      < /soap:Body>
    < /soap:Envelope>

    -Joe

  • Thanks Joe, it works.

     

     

    My code is copied from soapUI GUI after i imported the WSDL file into it, i have no idea to fill the info in to it, now i can learn from your code, that's cool~

     

     

    thanks again!
  • And here is my code, we can use SoapUI show iControl's power directly.

     

     

    <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pool="urn:iControl:LocalLB/Pool" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">

     

    <soapenv:Header/>

     

    <soapenv:Body>

     

    <pool:create soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

     

    <pool_names xsi:type="urn:Common.StringSequence" soapenc:arrayType="xsd:string[]" xmlns:urn="urn:iControl">

     

    <item>Pool1</item>

     

    <item>Pool2</item>

     

    <item>Pool3</item>

     

    </pool_names>

     

    <lb_methods xsi:type="urn:LocalLB.LBMethodSequence" soapenc:arrayType="urn:LocalLB.LBMethod[]" xmlns:urn="urn:iControl">

     

    <item>LB_METHOD_LEAST_SESSIONS</item>

     

    <item>LB_METHOD_LEAST_SESSIONS</item>

     

    <item>LB_METHOD_LEAST_SESSIONS</item>

     

    </lb_methods>

     

    <members xsi:type="urn:Common.IPPortDefinitionSequenceSequence" soapenc:arrayType="urn:Common.IPPortDefinitionSequence[]" xmlns:urn="urn:iControl">

     

    <item>

     

    <item>

     

    <address>10.10.10.10</address>

     

    <port>80</port>

     

    </item>

     

    <item>

     

    <address>10.10.10.11</address>

     

    <port>80</port>

     

    </item>

     

    <item>

     

    <address>10.10.10.12</address>

     

    <port>80</port>

     

    </item>

     

    </item>

     

    <item>

     

    <item>

     

    <address>10.10.10.10</address>

     

    <port>80</port>

     

    </item>

     

    <item>

     

    <address>10.10.10.11</address>

     

    <port>80</port>

     

    </item>

     

    <item>

     

    <address>10.10.10.12</address>

     

    <port>80</port>

     

    </item>

     

    </item>

     

    <item>

     

    <item>

     

    <address>10.10.10.10</address>

     

    <port>80</port>

     

    </item>

     

    <item>

     

    <address>10.10.10.11</address>

     

    <port>80</port>

     

    </item>

     

    <item>

     

    <address>10.10.10.12</address>

     

    <port>80</port>

     

    </item>

     

    </item>

     

    </members>

     

    </pool:create>

     

    </soapenv:Body>

     

    </soapenv:Envelope>