2 Replies Latest reply on Mar 22, 2005 7:34 PM by sirwio

    Attachment problems

    sirwio Newbie

      I'm trying to create an webservice to wich one can upload files. I'm sort of following the wiki trail WSAttachments but instead of generating wsdl from the interfaces I'm writing the wsdl first.

      The service deploys nice but when I access
      http://localhost:8080/ws4ee/services axis throws the following error:

      And now... Some Services
      AXIS error
      Sorry, something seems to have gone wrong... here are the details:
      org.apache.axis.InternalException: java.lang.Exception: The OperationDesc for uploadRestoration was not synchronized to a method of com.cadesthetics.pci.ProductionCenterInterfa
      

      Below is my wsdl
      <?xml version="1.0" encoding="UTF-8"?>
      <wsdl:definitions
       name="ProductionCenterInterface"
       targetNamespace="http://www.cadesthetics.pci"
       xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
       xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
       xmlns:tns="http://www.cadesthetics.pci"
       xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <wsdl:message name="uploadRestorationResponse">
       <wsdl:part name="uploadResponse" type="xsd:string"/>
       </wsdl:message>
       <wsdl:message name="uploadRestorationRequest">
       <wsdl:part name="customerIdentification" type="xsd:string"/>
       <wsdl:part name="restorationData" type="xsd:hexBinary"/>
       </wsdl:message>
       <wsdl:portType name="ProductionCenterInterface">
       <wsdl:operation name="uploadRestoration">
       <wsdl:input message="tns:uploadRestorationRequest"/>
       <wsdl:output message="tns:uploadRestorationResponse"/>
       </wsdl:operation>
       </wsdl:portType>
       <wsdl:binding
       name="ProductionCenterInterfaceBinding"
       type="tns:ProductionCenterInterface">
       <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
       <wsdl:operation name="uploadRestoration">
       <soap:operation
       soapAction=""/>
       <wsdl:input>
       <mime:multipartRelated>
       <mime:part>
       <soap:body
       namespace="http://www.cadesthetics.pci"
       parts="customerIdentification"
       use="literal"/>
       </mime:part>
       <mime:part>
       <mime:content part="restorationData" type="multipart/*"/>
       </mime:part>
       </mime:multipartRelated>
       </wsdl:input>
       <wsdl:output>
       <soap:body
       namespace="http://www.cadesthetics.pci"
       parts="uploadResponse"
       use="literal"/>
       </wsdl:output>
       </wsdl:operation>
       </wsdl:binding>
       <wsdl:service name="ProductionCenterInterfaceService">
       <wsdl:port
       binding="tns:ProductionCenterInterfaceBinding"
       name="ProductionCenterInterfacePort">
       <soap:address
       location="http://localhost:8000/ccx/ProductionCenterInterfaceService"/>
       </wsdl:port>
       </wsdl:service>
      </wsdl:definitions>
      

      If I remove the mime attachment parts as shown below everyting works fine and its possible to call the service from clients... so its seems to be an mime attachment problem.
       <wsdl:operation name="uploadRestoration">
       <soap:operation
       soapAction=""/>
       <wsdl:input>
       <soap:body
       namespace="http://www.cadesthetics.pci"
       parts="customerIdentification restorationData"
       use="literal"/>
       </wsdl:input>
       <wsdl:output>
       <soap:body
       namespace="http://www.cadesthetics.pci"
       parts="uploadResponse"
       use="literal"/>
       </wsdl:output>
       </wsdl:operation>
      

      The interfaces is generated with
      c:>wscompile -import -s src -mapping jaxrpc-mapping.xml -keep config.xml
      


      Development baseline:
      jboss-4.0.1
      jdk-1.5.0_01
      jwsdp-1.5
      XP servicepack 2

        • 1. Re: Attachment problems
          Jason Greene Master

          Are you using a typed parameter on your SEI for the attachment, or are you using Object? Currently you have to use object. I should get a fix for this in soon.

          -Jason

          • 2. Re: Attachment problems
            sirwio Newbie

            wscompile generated a typed parameter for me -> javax.mail.internet.MimeMultipart

            When I manually modified the SEI to use Object instead of MimeMultipart I can finally browse the wsdl of my service... Great!!!

            I actually began coding the interface first and had Object as parameter but didn't succeed in getting wscompile to generate the wsdl file. So I ditched that track and started with the wsdl first approach.

            If I get my simple attachment service to work I would be more than happy to contribute with a sample/doc to the wiki that mere mortals - beginners, can follow. Its a little bit tricky right now to get all the stuff right :-)

            \Magnus