}
void validate(Object ret, Call call, final String expOrdPattern) throws Exception{
if (null == ret) {
System.out.println("Received null ");
throw new AxisFault("", "Received null", null, null);
}
if (ret instanceof String) {
System.out.println("Received problem response from server: " + ret);
throw new AxisFault("", (String) ret, null, null);
}
Vector vret= (Vector) ret;
if (!(ret instanceof java.util.Vector )) {
//The wrong type of object that what was expected.
System.out.println("Received unexpected type :" +
ret.getClass().getName());
throw new AxisFault("", "Received unexpected type:" +
ret.getClass().getName(), null, null);
}
org.apache.axis.message.RPCElement retrpc= (org.apache.axis.message.RPCElement )
((Vector)ret).elementAt(0);
Document retDoc= org.apache.axis.utils.XMLUtils.newDocument(
new org.xml.sax.InputSource(new java.io.ByteArrayInputStream(
retrpc.toString().getBytes())));
//get at the attachments.
org.apache.axis.attachments.Attachments attachments=
call.getResponseMessage().getAttachmentsImpl();
//Still here, so far so good.
Element rootEl= retDoc.getDocumentElement();
Element caEl= getNextFirstChildElement(rootEl);
//this should be the only child element with the ref to our attachment
// response.
String href= caEl.getAttribute("href");
org.apache.axis.Part p= attachments.getAttachmentByReference(href);
if(null == p)
throw new org.apache.axis.AxisFault("Attachment for ref='"+href+"' not found." );
//Check to see the the attachment were sent in order
String ordPattern= caEl.getAttribute("ordinalPattern");
if(!expOrdPattern.equals(ordPattern))
throw new org.apache.axis.AxisFault(
"Attachments sent out of order expected:'" +expOrdPattern + "', got:'"+ordPattern+"'." );
//now get at the data...
DataHandler dh= ((org.apache.axis.attachments.AttachmentPart)p).getDataHandler();
System.err.println("content-type:" + dh.getContentType());
java.util.Vector rspVector= null;
Object rspObject = dh.getContent();//This SHOULD just return the vector but reality strikes...
if(rspObject == null)
throw new AxisFault("", "Received unexpected object:null", null, null);
else if(rspObject instanceof java.util.Vector) rspVector= (java.util.Vector)rspObject;
else if(rspObject instanceof java.io.InputStream)
rspVector= (java.util.Vector)
new java.io.ObjectInputStream((java.io.InputStream)rspObject ).readObject();
else
throw new AxisFault("", "Received unexpected object:" +
rspObject.getClass().getName(), null, null);
StringBuffer fullmsg= new StringBuffer();
for(java.util.Iterator ri= rspVector.iterator(); ri.hasNext();){
String part= (String)ri.next();