我使用了以下函数但收到错误:"加载约束违规:loader" com / ibm / ws / classloader / CompoundClassLoader @ 72127212"先前为名称为" org / w3c / dom / DOMConfiguration"的其他类型启动加载由loader" com / ibm / oti / vm / BootstrapClassLoader @ 3d303d30""
定义import javax.xml.soap.SOAPMessage;
import org.apache.axis2.jaxws.core.MessageContext;
private void downloadAttachment() throws AddDocumentException,SOAPException
{
org.apache.axis2.context.MessageContext messagecontext = org.apache.axis2.context.MessageContext.getCurrentMessageContext();
log.info("1");
MessageContext mc=new MessageContext(messagecontext);
log.info("2");
SOAPMessage soapmessage = mc.getMessage().getAsSOAPMessage();
log.info("3");
log.info("SOAP header: "+soapmessage.getSOAPHeader());
log.info("4");
log.info("SOAP Body: "+soapmessage.getSOAPBody());
log.info("5");
log.info("SOAP Part:"+soapmessage.getSOAPPart());
log.info("6");
File fDumpFolder=new File(sDumpLoc);
if(!fDumpFolder.exists())
fDumpFolder.mkdir();
log.info("Count of attachments: "+soapmessage.countAttachments());
if(soapmessage.countAttachments()==0)
throw new AddDocumentException("-11011",pCodes.getString("-11011"),"");
else if(soapmessage.countAttachments()>1)
throw new AddDocumentException("-11012",pCodes.getString("-11012"),"");
else if(soapmessage.countAttachments()==1)
{
Iterator it = soapmessage.getAttachments();
AttachmentPart attachment=(AttachmentPart) it.next();
String sContentType=attachment.getContentType();
log.debug(attachment.getContentId()+", "+attachment.getContentType()+", "+attachment.getContentId());
}
}
答案 0 :(得分:0)
现在通过从axis2
中删除xmlbeans-2.3.0.jar来工作