1   /*
2    * $Id: GeneratedClientTestCase.java 12248 2008-07-07 22:08:28Z dandiep $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.transport.cxf.client;
12  
13  import org.mule.api.MuleMessage;
14  import org.mule.module.client.MuleClient;
15  import org.mule.tck.FunctionalTestCase;
16  
17  public class GeneratedClientTestCase extends FunctionalTestCase
18  {
19      public void testEchoService() throws Exception
20      {
21          // URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
22          // assertNotNull(wsdl);
23          // SOAPService service = new SOAPService(wsdl, null);
24          // Greeter soapPort = service.getSoapPort();
25          //        
26          String msg = "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
27                       + "<soap:Body>" + "<test> foo </test>" + "</soap:Body>" + "</soap:Envelope>";
28  
29          MuleClient client = new MuleClient();
30          MuleMessage result = client.send("http://localhost:63081/services/Echo", msg, null);
31          byte[] res = (byte[]) result.getPayload();
32          String resString = new String(res);
33  
34          assertTrue(resString.indexOf("<test> foo </test>") != -1);
35      }
36  
37      protected String getConfigResources()
38      {
39          return "proxy-conf.xml";
40      }
41  
42  }