Forum Discussion

Jason_L__54018's avatar
Jason_L__54018
Icon for Nimbostratus rankNimbostratus
Feb 21, 2008

SNMPConfiguration.set_readonly_community call complains about no deserializer

Hi All,

 

 

This is my first time posting, so hopefully I'm not asking anything too dumb. I am trying to write a simple of proof of concept piece of code to simply set the SNMP readonly string using a SOAP call. I have been successful in making simple calls to functions that don't require any arguments, having worked through the first small hurdle of SOAP over HTTPS. Where I ran into trouble is when I tried to make a call to set_readonly_community that takes an array parameter.

 

 

I've read over similar examples in this forum and studied the Management.SNMPConfiguration.wsdl file intently, yet the call always throws a "no deserializer" type SOAP Fault.

 

 

Below is the XML trace of my client's request:

 

 

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">testStringdefault.1false

 

 

The response is the typical one I get when I've screwed up the message. I just can't seem to figure out why it doesn't like my request:

 

 

xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
  
   soapenv:Server.userException
   org.xml.sax.SAXException: No deserializer for {http://www.w3.org/2001/XMLSchema}anyType
   
    localhost
   
  
 

 

 

Does anyone have any idea as to what's wrong with this request?

4 Replies

  • How did you create your request? The anyType arrayType in the request looks like the culprit. Did you use the iControl library for Java to generate the client request or did you custom bake the WSDL's into your code base?

     

     

    From your fault it's hard to tell if it's Axis complaining about the formation of your request, or the parsing of the response from the BIG-IP. The error is definitely from the Axis libraries, I just can't tell which side (request/response).

     

     

    Any more insights into how you created your client and what the client code looks like will be helpful in diagnosing a solution for this.

     

     

    Just by chance, are your Axis libraries up to date?

     

     

    -Joe
  • Hi Joe,

     

     

    Thank you for the response. I don't presently use any SOAP toolkits, which is probably adding unnecessary grief. I am using Sun's Java EE and coding directly against the WSDL. This might be backwards, but I actually like crawling through the WSDL to understand each vendor's particular implementation.

     

     

    I suspect you are correct about the arrayType, but I literally spent most of the day yesterday trying every conceivable arrayType. Every time I change the arrayType, the SOAP fault complains about not having a deserializer for it, so I'm fairly confident that the error is in regards to my request versus the response.

     

     

    When I have encountered this error in other implementations, it was usually due to me not definining namespaces correctly.

     

     

    Below is the relevant portion of code that generates the request.

     

     

     

    
    SOAPConnectionFactory scFactory = SOAPConnectionFactory.newInstance();
                SOAPConnection con = scFactory.createConnection();
                MessageFactory factory = MessageFactory.newInstance();
                SOAPMessage message = factory.createMessage();
                SOAPPart soapPart = message.getSOAPPart();
                SOAPEnvelope envelope = soapPart.getEnvelope();
                SOAPHeader header = envelope.getHeader();
                SOAPBody body = envelope.getBody();
    MimeHeaders headers = message.getMimeHeaders();
                headers.addHeader( "SOAPAction", "set_readonly_community"); 
                String authorization = Base64Coder.encodeString(username+":"+password);            
                headers.addHeader("Authorization", "Basic " + authorization);
                header.detachNode();
                Name bodyName = envelope.createName("set_readonly_community","", "urn:iControl:Management/SNMPConfiguration"); 
                SOAPBodyElement gul = body.addBodyElement(bodyName); 
                
                //Construct ro_community_info parameter
                Name childName = envelope.createName("ro_community_info");            
                SOAPElement roCommunity = gul.addChildElement(childName);
                Name arrayName = envelope.createName("type","xsi","");
                roCommunity.addAttribute(arrayName,"SOAP-ENC:Array");            
                Name arrayType = envelope.createName("SOAP-ENC:arrayType","","");
                roCommunity.addAttribute(arrayType,"xsd:anyType[1]");     
  • Hi Joe,

     

     

    Thank you for the very detailed response. I'm not actually using Axis anywhere. The reference to Axis you cite above was returned as part of a SOAP fault message (i.e. from the F5). The F5 does not like the way I'm structuring my request, and I think we've gone off in the woods deeper than I really wanted to go.

     

     

    We have two other vendors that present API's exposed via web services, and I've had a fair amount of success in coding against them. Some methods these vendors support require very complex arguments, and I was able to work through them. I was just surprised to be stumped by F5's set_readonly_community method that wants a very straightforward argument.

     

     

    I'll try your advice to use the iControl library as it might save me time in the long run. I was reluctant to do so because I have multiple vendors to support and learning each of their respective SDK's was a more time than I wanted to put in. I'm accustomed to glancing over the WSDL's and coding based on that.

     

     

    The fact that F5 provides an accessible, well-documented API and an active developer forum really speaks alot about the quality of this product. I'm glad my company made the investment in F5 and I am really looking forward to working with our BIG-IP's.

     

     

    Thanks again!
  • We are not using Axis on our end. Our endpoint is very flexible and does not rely on the namespace for deserialization, but dynamically deserializes by element names. The error indicates that it's a server error, but I don't see how it could be. As for the case of the BIG-IP returning anyType in the SOAP Response, that's won't happen since the return code is void and there are no out params. That's why from first glance it looks to me like a client side serialization error in the request before it makes it to the BIG-IP.

     

     

    Have you verified that this is actually making it to the BIG-IP and that this error is on the return trip? You can do so by looking for requests to /iControl/iControlPortal.cgi in the apache logs on the device.

     

     

    -Joe