在SoapUI中以base64Binary格式发送文件附件

在SoapUI中以base64Binary格式发送文件附件,soap,base64,wsdl,soapui,xop,Soap,Base64,Wsdl,Soapui,Xop,有一个元素,在WSDL中定义为base64Binary。我附加了ContentID为ref1的文件,并将其添加到SOAP请求中,如下所示: <docBytes><xop:Include href="cid:ref1" xmlns:xop="http://www.w3.org/2004/08/xop/include"/></docBytes> 尝试发送时收到以下错误消息: cvc类型.3.1.2:元素“docByte

有一个元素,在WSDL中定义为
base64Binary
。我附加了ContentID为
ref1
的文件,并将其添加到SOAP请求中,如下所示:

<docBytes><xop:Include href="cid:ref1" xmlns:xop="http://www.w3.org/2004/08/xop/include"/></docBytes>

尝试发送时收到以下错误消息:

cvc类型.3.1.2:元素“docBytes”是一个简单类型,因此它必须具有 无元素信息项[子项]


当我在标签之间粘贴base64编码字符串时,它工作正常。

没错,我有发送PDF的服务,我将文档作为base64字节数组存储在如下属性中:

def docContent = new File("path/to/file")
def encodedDoc = docContent.bytes.encodeBase64().toString()
testRunner.testCase.setPropertyValue("encodedDoc", encodedDoc)
然后将其用于:

<docBytes>${#TestCase#encodedDoc}</docBytes>
${TestCase}encodedDoc}
在请求中