我需要一种方法将dataHandler
字段更改为cid:generated cid
如何从SOAP消息中获取dataHandler
元素?
这种方法行不通:
env.getBody().getElementByID("datahandler")
有帮助吗?
String cid = _messageContext.addAttachment(
dispatchDocumentRequest8.getDataDescription().getDataHandler());
// create SOAP envelope with that payload
org.apache.axiom.soap.SOAPEnvelope env = null;
env = toEnvelope(getFactory(
_operationClient.getOptions().getSoapVersionURI()),
dispatchDocumentRequest8,
optimizeContent(
new javax.xml.namespace.QName(
"dmsSOAP.fiso.denue.fisglobal.com",
"dispatchDocument")));
env.getBody().getElementByID("datahandler"); // this is wrong
信封:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns1:dispatchDocumentRequest>
<dataDescription>
<dataHandler>HERE</dataHandler>
</dataDescription>
</ns1:dispatchDocumentRequest>
</soapenv:Body>
</soapenv:Envelope>
答案 0 :(得分:0)
我认为您应该使用camelCase尝试使用它,而不是
COPYenv.getBody().getElementByID("datahandler")
尝试以下操作:
COPYenv.getBody().getElementByID("dataHandler")
编辑
根据您的评论,我认为您应该尝试:
COPYenv.getBody().getElementByID("dataHandler").setText("something")