1 17 package org.apache.servicemix.itests; 18 19 import java.io.ByteArrayOutputStream ; 20 import java.io.InputStream ; 21 import java.io.OutputStream ; 22 import java.net.URL ; 23 import java.net.URLConnection ; 24 25 import org.apache.servicemix.jbi.util.FileUtil; 26 import org.apache.servicemix.tck.SpringTestSupport; 27 import org.apache.xbean.spring.context.ClassPathXmlApplicationContext; 28 import org.springframework.context.support.AbstractXmlApplicationContext; 29 30 public class HttpJmsRoundtripTest extends SpringTestSupport { 31 32 @Override 33 protected AbstractXmlApplicationContext createBeanFactory() { 34 return new ClassPathXmlApplicationContext("org/apache/servicemix/itests/httpjms.xml"); 35 } 36 37 public void test() throws Exception { 38 URLConnection connection = new URL ("http://localhost:8192/Service/").openConnection(); 39 connection.setDoOutput(true); 40 connection.setDoInput(true); 41 OutputStream os = connection.getOutputStream(); 42 InputStream fis = getClass().getResourceAsStream("soap-request.xml"); 44 FileUtil.copyInputStream(fis, os); 45 InputStream is = connection.getInputStream(); 47 ByteArrayOutputStream baos = new ByteArrayOutputStream (); 48 FileUtil.copyInputStream(is, baos); 49 System.err.println(baos.toString()); 50 } 51 52 } 53 | Popular Tags |