2 Replies Latest reply on Jul 1, 2004 6:36 AM by diegomemo

    Image

    diegomemo Newbie

      Hi,
      i'm developing a simple service:

      public class Hello
      {
      public Hello() { }
      public Image getImage()throws Exception
      {
      Image image=Toolkit.getDefaultToolkit().getImage("C.......");
      return image;
      }
      }

      How can the Client extract the image?

      this is my client:

      import org.apache.axis.client.Call;
      import org.apache.axis.client.Service;
      import org.apache.axis.encoding.XMLType;
      import javax.xml.rpc.ParameterMode;

      public class Client {
      public static void main(String [] args) {

      String url_server ="http://localhost:8080/jboss-net/services/Hello";
      String MetodName = "getImage";
      Service service = new Service();
      Call call = (Call) service.createCall();
      call.setTargetEndpointAddress( new java.net.URL(url_server) );
      call.setOperationName(MetodName);
      call.addParameter("name",org.apache.axis.Constants.XSD_STRING,ParameterMode.IN);
      call.setReturnType(?????????);
      ?????? IncomingImage = (?????) call.invoke( new Object[] {new String(Hello Image)});
      }
      }

      But an any one other way is right.

      thanks....bye

      sorry for my bad english.


        • 1. Re: Image
          Lance Nehring Newbie

          I'm not an expert on the Image object, but it would need to be a Serializable object to send across the network as a SOAP attachment (MIME or DIME).

          If you were to send common image files, such as JPeg, GIF, PNG, etc, then you could Base64 encode the image file content and send it as XSD_BASE64. However, it would be more efficient to attach the image files as DIME attachments.

          This may not be the answer you're looking for. Maybe someone else has a better idea....

          • 2. Re: Image
            diegomemo Newbie

            thanks for your reaply.