Java 不使用附件的SOAP消息
我正在使用一个带有二进制数据对象的webservice,该对象是Base64编码的。相应的xsd元素如下所示:Java 不使用附件的SOAP消息,java,xml,web-services,soap,mtom,Java,Xml,Web Services,Soap,Mtom,我正在使用一个带有二进制数据对象的webservice,该对象是Base64编码的。相应的xsd元素如下所示: <xs:element name="Document" maxOccurs="unbounded" xmime:expectedContentTypes="application/octet-stream"> <xs:complexType> <xs:simpleContent>
<xs:element name="Document" maxOccurs="unbounded"
xmime:expectedContentTypes="application/octet-stream">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:base64Binary">
<xs:attribute name="id" type="xs:anyURI" use="required">
<xs:annotation>
<xs:documentation>documentation text...</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
ctx是SOAPMessageContext对象,它被放入SOAPHandler实现的handleMessage方法中。一旦执行此方法,请求中就不会有任何附件。我很好奇getter如何能够禁用整个请求的附件。有什么想法吗?我终于找到了这种行为的原因。有一个无法修复的bug导致了它。相应的票证可在此处找到: 对于解决方法,您可以访问这篇博文,在这里我找到了有关此主题的一些信息:
<ns4:Document id="Document01">dGhpcyBpcyBzYW1wbGUgZG9jdW1lbnQgbm8uIDE=</ns4:Document>
ctx.getMessage();