View Javadoc

1   /*
2    * $Id: SoapRequestNoMethodParamTestCase.java 19191 2010-08-25 21:05:23Z tcarlson $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.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.module.cxf;
12  
13  import org.mule.DefaultMuleMessage;
14  import org.mule.api.MuleMessage;
15  import org.mule.module.client.MuleClient;
16  import org.mule.tck.FunctionalTestCase;
17  
18  public class SoapRequestNoMethodParamTestCase extends FunctionalTestCase
19  {
20      private static final String request = "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><soap:Body><receive xmlns=\"http://www.muleumo.org\"><src xmlns=\"http://www.muleumo.org\">Test String</src></receive></soap:Body></soap:Envelope>";
21      private static final String response = "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body><ns1:receiveResponse xmlns:ns1=\"http://services.testmodels.tck.mule.org/\"><ns1:return>Received: null</ns1:return></ns1:receiveResponse></soap:Body></soap:Envelope>";
22  
23      public void testCXFSoapRequest() throws Exception
24      {
25          MuleClient client = new MuleClient(muleContext);
26  
27          MuleMessage msg = client.send("http://localhost:63381/services/TestComponent",
28              new DefaultMuleMessage(request, muleContext));
29  
30          assertNotNull(msg);
31          assertNotNull(msg.getPayload());
32          assertEquals(response, msg.getPayloadAsString());
33      }
34  
35      protected String getConfigResources()
36      {
37          return "soap-request-conf.xml";
38      }
39  
40  }