我在尝试调用需要附件的web服务时遇到了一个相当令人沮丧的问题。
这是错误:
java.lang.Object对象
class=“com.sun.xml.ws.client.sei.ResponseBuilder$AttachmentBuilder”
file=“ResponseBuilder.java”line=“250”
方法=“createAttachmentBuilder”
web代理给我的方法是:
public Reply putDocument(
@WebParam(targetNamespace="uri:put.document", partName="request", name="request")
StoreType request,
@WebParam(targetNamespace="", partName="put", name="put")
Object put);
我搞不清楚的是“put”应该传递什么,它只被定义为一个对象。
我试过:
byte[]
String
DataHandler(ByteArrayDataSource)
uri.put_document.ObjectFactory.createPut(byte[])
AttachmentPart
我也尝试过寻找代码,但至今没有运气。
编辑:WSDL如下所示。
<?xml version="1.0" encoding="UTF-8" ?>
<definitions targetNamespace="urn:fer"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="urn:fer"
xmlns:get="uri:get.document"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/">
<types>
<xsd:schema>
<xsd:import namespace="uri:get.document"
schemaLocation="../xsd/getDocument.xsd"/>
</xsd:schema>
</types>
<message name="putDocument">
<part name="request" element="put:request"/>
<part name="put" element="put:put"/>
</message>
<message name="putDocumentReply">
<part name="reply" element="put:reply"/>
</message>
<portType name="FrontEndRepository">
<operation name="putDocument">
<input message="tns:putDocument"/>
<output message="tns:putDocumentReply"/>
</operation>
</portType>
<binding name="frontEndRepositoryPortSOAP11Binding"
type="tns:FrontEndRepository">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="putDocument">
<soap:operation style="document"
soapAction="putDocument"/>
<input>
<mime:multipartRelated>
<mime:part>
<soap:body use="literal" parts="request"/>
</mime:part>
<mime:part>
<mime:content part="put" type="binary"/>
</mime:part>
</mime:multipartRelated>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="FrontEndRepository">
<port name="FrontEndRepository"
binding="tns:frontEndRepositoryPortSOAP11Binding">
<soap:address location="http://localhost:7101/FER-FrontEndrepository-context-root/frontEndRepositoryPort"/>
</port>
</service>
</definitions>