Forum Discussion

E_Lenny_Brown_1's avatar
E_Lenny_Brown_1
Icon for Nimbostratus rankNimbostratus
Oct 05, 2004

Odd request

In my hard-headed attempt to implement an iControl framework in python (perl gives me headaches and java is on the to-do list) I have run into a minor difficulty.

 

 

In implementing the ITCMGlobalLB.Wideip.add_pool_virtual_server method, I can't seem to get my structures correct. I get :

 

 

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

 

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

 

xmlns:xsd="http://www.w3.org/2001/XMLSchema">

 

 

 

xsi:type="xsd:string">SOAPException : &Could not find element by name: addr&

 

xsi:type="xsd:string">SOAP-ENV:Server

 

 

 

 

 

What I could really use is a dump of the XML that is sent for a correctly formatted request. If you want, I can post my incorrect XML dump.

 

 

Lenny
  • I'm sorry but I can't help you with Python, but I can get you the SOAP Request:

     

     

    struct VirtualServerAttribute {  
          IPPortDefinition source,  
          IPPortDefinition translated,  
          IPPortDefinition [] depends,  
          long ratio,  
          EnableStatus status,  
          StatColor state  
      };  
        
      void ITCMGlobal::Wideip::add_pool_virtual_server(  
          in String wideip_name,  
          in String pool_name,  
          in VirtualServerAttribute vs  
      );  
      

     

     

    If invoking the following code (from C):

     

     

    ITCMGlobalLBVirtualServerAttribute vsAttr = new ITCMGlobalLBVirtualServerAttribute();  
      vsAttr.source = new ITCMGlobalLBIPPortDefinition();  
      vsAttr.source.addr = "10.10.10.10";  
      vsAttr.source.port = 80;  
      vsAttr.translated = new ITCMGlobalLBIPPortDefinition();  
      vsAttr.translated.addr = "20.20.20.20";  
      vsAttr.translated.port = 80;  
      vsAttr.depends = new ITCMGlobalLBIPPortDefinition[0];  
      vsAttr.ratio = 1;  
      vsAttr.status = 0;  
      vsAttr.state = 0;  
      iWideip.add_pool_virtual_server(sWideip,sPool, vsAttr);

     

     

    It will produce the following SOAPRequest:

     

     

      
        xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"  
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"  
      xmlns:tns="urn:iControl"  
      xmlns:types="urn:iControl/encodedTypes"  
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
      xmlns:xsd="http://www.w3.org/2001/XMLSchema">  
        soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">  
        
      my_wideip  
      my_pool  
        
        
        
      1  
      0  
      0  
        
        
        
        
        
        
      80  
      20.20.20.20  
        
        
      80  
      10.10.10.10  
        
        
        
      

     

     

    You may have to move around those idrefs to make sense of this.

     

     

    Hope this helps...

     

     

    -Joe