Forum Discussion

Conrad_Link_166's avatar
Conrad_Link_166
Icon for Nimbostratus rankNimbostratus
Oct 29, 2004

problem using add_string_class_member

I'm having trouble using the new v9 add_string_class_member.

 

 

Here's the code snippet:

 

use SOAP::Lite;

 

import SOAP::Data 'name';

 

 

$soap = SOAP::Lite

 

-> uri('urn:iControl:LocalLB/Class')

 

-> readable(1)

 

-> proxy("https://$sHost:$sPort/iControl/iControlPortal.cgi");

 

 

$soap_response = $soap->add_string_class_member(

 

name('class_members' =>

 

[name('name' => $sClass), name('members' => [$sString])]

 

));

 

 

 

The error I'm getting is:

 

SOAP-ENV:Server Could not find element by name: name

 

 

What am I doing wrong here?

 

 

-Conrad
  • Try this code out

     

     

    $soap = SOAP::Lite     
        -> uri('urn:iControl:LocalLB/Class')     
        -> readable(1)     
        -> proxy("https://$sHost:$sPort/iControl/iControlPortal.cgi");     
            
        $class_members = { name => $sClass, members => [$sString] };    
            
        $soap_response =    
          $soap->add_string_class_member    
          (     
            SOAP::Data->name(class_members => [$class_members)])    
          );

     

     

    At one point I think I tried putting single quotes around the member names in like you have in your sample and I think that caused problems because the single quotes were being sent with as part of the name itself. In our server code we reference elements by name so an exact string match is important. The message that the server couldn't find the element 'name' implies the parameter names aren't getting sent up properly. You can also enable debugging tracing by setting your "use" line to the following

     

     

    use SOAP::Lite + trace => qw(method debug);

     

     

    This way the full SOAP messages will be spit to stdout and you will be able to see what SOAP::Lite is serializing the request as.

     

     

    -Joe
  • Still the same error. I tried your code snippet and got a different error. Here's the SOAP message:

     

          
      
        SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
       xmlns:xsd="http://www.w3.org/1999/XMLSchema" 
       xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" 
       xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" 
       xmlns:namesp2="http://xml.apache.org/xml-soap" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> 
             
          
                xmlns:namesp1="urn:iControl:LocalLB/Class">      
                    xsi:type="SOAP-ENC:Array">      
                    
                      
                  .png 
                      
                images 
               
            
          
        
      
     

     

     

    Here's the error I get back:

     

          
        xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">      
             
               
           SOAP-ENV:Server      
           Exception caught in LocalLB::Class::add_string_class_member()      
              Exception: Common::OperationFailed      
                     primary_error_code   : 16908342 (0x01020036)      
                     secondary_error_code : 0      
                     error_string         : 01020036:3: The requested string class member (images .png) was not found. 
                 
               
             
      
     
    -Conrad
  • I'm working remotely today so I'm going to have to pass this one off to one of my developers later this afternoon. We'll get back to you as soon as we have something for you.

     

     

    -Joe
  • BTW, how do I create the nice formatted "code" sections why I post. I can't find the "help" feature for these forums.

     

     

    -Conrad
  • This is all new software and we are still working out the kinks. One of them is formatting of HTML/XML within posts. Hopefully this should be available soon.

     

     

    -Joe
  • I've verified that this is a bug in version 9.0.1 and have submitted a change request to development to get this addressed. It is my understanding that this will make it into 9.0.3.

     

     

    I'll verify the release and post it back here when staff is back in the office on Monday.

     

     

    -Joe

     

  • Loc_Pham_101863's avatar
    Loc_Pham_101863
    Historic F5 Account

    This is a known bug, and is already fixed in the upcoming 9.0.2 and 9.0.3 releases.

     

    Regards,

     

     

    Loc