Version 2

    The Service Implementation

     

    Write the service source code

    The interface:

    public interface MyService extends Remote {
        public DataHandler myService(DataHandler mimepart) throws RemoteException;
    }
    

     

    The method implementation:

        public DataHandler myService(DataHandler mimepart) throws RemoteException
        {
                ...
                // print the recieved file
                InputStream is = mimepart.getInputStream();
    
                ...
                // the file to return
                url = new URL("http://localhost:8080/myservice/resources/attachment_server2client.txt");
    
            ...
            return new DataHandler(url);
        }
    

     

    Write the XML files

    webservice.xml:

      <webservice-description>
        <webservice-description-name>MyService</webservice-description-name>
        <wsdl-file>WEB-INF/wsdl/MyService.wsdl</wsdl-file>
        <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
        <port-component>
          <port-component-name>PortComponent</port-component-name>
          <wsdl-port>MyServicePort</wsdl-port>
          <service-endpoint-interface>org.jboss.ws.example.attachment.MyService</service-endpoint-interface>
          <service-impl-bean>
            <servlet-link>MyService</servlet-link>
          </service-impl-bean>
        </port-component>
      </webservice-description>
    

     

    web.xml:

     <servlet>
       <servlet-name>MyService</servlet-name>
       <servlet-class>org.jboss.ws.example.attachment.MyServiceImpl</servlet-class>
     </servlet>
    
     <servlet-mapping>
       <servlet-name>MyService</servlet-name>
       <url-pattern>/MyService</url-pattern>
     </servlet-mapping>