title: Call web service with attachment
body: <p>I am having a rather frustrating issue trying to call a web service that requires an attachment.</p>
  
  <p>This is the error:</p>
  
  <blockquote>
    <p>Unexpected Attachment type =class
    java.lang.Object</p>
  </blockquote>
  
  <p>from here:</p>
  
  <blockquote>
    <p>class="com.sun.xml.ws.client.sei.ResponseBuilder$AttachmentBuilder"
    file="ResponseBuilder.java" line="250"
    method="createAttachmentBuilder"</p>
  </blockquote>
  
  <p>The method the web proxy gives me is this:</p>
  
  <pre><code>  public Reply putDocument(
      @WebParam(targetNamespace="uri:put.document", partName="request", name="request")
        StoreType request,
      @WebParam(targetNamespace="", partName="put", name="put")
        Object put);
  </code></pre>
  
  <p>What I cannot figure out is what to pass in for "put", which is only defined as an Object.</p>
  
  <p>I have tried:</p>
  
  <pre><code>byte[]
  String
  DataHandler(ByteArrayDataSource)
  uri.put_document.ObjectFactory.createPut(byte[])
  AttachmentPart
  </code></pre>
  
  <p>I have also tried looking for the code but haven't had luck so far.</p>
  
  <p>EDIT: WSDL is as follows.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;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/"&gt;
    &lt;types&gt;
        &lt;xsd:schema&gt;
          &lt;xsd:import namespace="uri:get.document"
                      schemaLocation="../xsd/getDocument.xsd"/&gt;
        &lt;/xsd:schema&gt;
    &lt;/types&gt;
    &lt;message name="putDocument"&gt;
      &lt;part name="request" element="put:request"/&gt;    
      &lt;part name="put" element="put:put"/&gt;
    &lt;/message&gt;
    &lt;message name="putDocumentReply"&gt;
      &lt;part name="reply" element="put:reply"/&gt;    
    &lt;/message&gt;
    &lt;portType name="FrontEndRepository"&gt;
      &lt;operation name="putDocument"&gt;
        &lt;input message="tns:putDocument"/&gt;
        &lt;output message="tns:putDocumentReply"/&gt;
      &lt;/operation&gt;
    &lt;/portType&gt;
    &lt;binding name="frontEndRepositoryPortSOAP11Binding"
             type="tns:FrontEndRepository"&gt;
      &lt;soap:binding style="document"
                    transport="http://schemas.xmlsoap.org/soap/http"/&gt;
      &lt;operation name="putDocument"&gt;
        &lt;soap:operation style="document"
                        soapAction="putDocument"/&gt;
        &lt;input&gt;
          &lt;mime:multipartRelated&gt;
            &lt;mime:part&gt;
              &lt;soap:body use="literal" parts="request"/&gt;
            &lt;/mime:part&gt;
            &lt;mime:part&gt;
              &lt;mime:content part="put" type="binary"/&gt;
            &lt;/mime:part&gt;
          &lt;/mime:multipartRelated&gt;
        &lt;/input&gt;
        &lt;output&gt;
          &lt;soap:body use="literal"/&gt;
        &lt;/output&gt;
      &lt;/operation&gt;
    &lt;/binding&gt;
    &lt;service name="FrontEndRepository"&gt;
      &lt;port name="FrontEndRepository"
            binding="tns:frontEndRepositoryPortSOAP11Binding"&gt;
        &lt;soap:address location="http://localhost:7101/FER-FrontEndrepository-context-root/frontEndRepositoryPort"/&gt;
      &lt;/port&gt;
    &lt;/service&gt;
  &lt;/definitions&gt;
  </code></pre>