Examples of AttachmentWs


Examples of org.superbiz.attachment.AttachmentWs

        Service service = Service.create(
          new URL("http://127.0.0.1:4204/AttachmentImpl?wsdl"),
          new QName("http://superbiz.org/wsdl", "AttachmentWsService"));
      assertNotNull(service);

      AttachmentWs ws = service.getPort(AttachmentWs.class);
     
      // retrieve the SOAPBinding
        SOAPBinding binding = (SOAPBinding)((BindingProvider)ws).getBinding();
        binding.setMTOMEnabled(true);
       
        String request = "tsztelak@gmail.com";
       
        // Byte array
        String response = ws.stringFromBytes(request.getBytes());
        assertEquals(request, response);
       
        // Data Source
        DataSource source = new ByteArrayDataSource(request.getBytes(), "text/plain; charset=UTF-8");

        // not yet supported !
//        response = ws.stringFromDataSource(source);
//        assertEquals(request, response);
       
        // Data Handler
        response = ws.stringFromDataHandler(new DataHandler(source));
        assertEquals(request, response);
       
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.