1 Reply Latest reply on Sep 22, 2005 7:35 PM by Thomas Diesler

    4.0.2 attachment problem?

    Tim Biernat Newbie

      following the wiki post on ws attachments, i defined a service as follows:

      <?xml version="1.0" encoding="UTF-8"?>
      
      <definitions name="attachService" targetNamespace="urn:ssn/service"
       xmlns:tns="urn:ssn/service" xmlns="http://schemas.xmlsoap.org/wsdl/"
       xmlns:types="urn:ssn/service/types"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema"
       xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
       xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/">
      
       <types/>
      
       <message name="Request">
       <part name="fileId" type="xsd:string"/>
       <part name="fileContent" type="xsd:hexBinary"/>
       </message>
       <message name="Response">
       <part name="fileReceipt" type="xsd:string"/>
       </message>
      
       <portType name="ServicePort">
       <operation name="process">
       <input message="tns:Request"/>
       <output message="tns:Response"/>
       </operation>
       </portType>
      
       <binding name="ServiceBinding" type="tns:ServicePort">
       <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
       style="rpc"/>
       <operation name="process">
       <soap:operation soapAction=""/>
       <input>
       <mime:multipartRelated>
       <mime:part>
       <soap:body part="fileId" use="literal" namespace="urn:ssn/service"/>
       </mime:part>
       <mime:part>
       <mime:content part="fileContent" type="application/octet-stream"/>
       </mime:part>
       </mime:multipartRelated>
       </input>
       <output>
       <soap:body use="literal" namespace="urn:ssn/service"/>
       </output>
       </operation>
       </binding>
      
       <service name="Service">
       <port name="ServicePort" binding="tns:ServiceBinding">
       <soap:address location="http://localhost:8080/attach/service"/>
       </port>
       </service>
      
      </definitions>
      


      after wscompiling, i have a test client sending this request:

      POST /attach/service HTTP/1.1
      Content-Type: multipart/related; type="text/xml"; boundary="----=_Part_0_4121220.1126741198058"
      Content-Length: 674
      SOAPAction: ""
      User-Agent: Java/1.5.0_04
      Host: 127.0.0.1:8081
      Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
      Connection: keep-alive

      ------=_Part_0_4121220.1126741198058
      Content-Type: text/xml; charset=utf-8

      <?xml version="1.0" encoding="UTF-8"?>
      <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="urn:ssn/service">
      <env:Body>
      <ns0:process>
      <fileId>test</fileId>
      </ns0:process>
      </env:Body>
      </env:Envelope>------=_Part_0_4121220.1126741198058Content-Type: application/octet-streamContent-Id:
      <fileContent=6ebba353-5a6d-4f18-9295-fed0c16a3c3f@jaxrpc.sun.com>this is a test file------=_Part_0_4121220.1126741198058--


      but at the service port implementation, the second parameter (DataHandler type) is always null!

      am i missing something obvious here, or is this a known issue for jboss?