Forum Discussion
Jason_L__54018
Feb 22, 2008Nimbostratus
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]");