1
2
3
4
5
6
7
8
9
10
11 package org.mule.test.integration.transport.cxf;
12
13 import org.mule.api.MuleMessage;
14 import org.mule.module.client.MuleClient;
15 import org.mule.tck.FunctionalTestCase;
16
17 import org.custommonkey.xmlunit.XMLAssert;
18
19 public class CxfEnvelopePayloadWithWsdlTestCase extends FunctionalTestCase
20 {
21
22 final String msg = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" "
23 + "xmlns:emop=\"http://www.wcs.com/2010/07/14/emop\">"
24 + " <soapenv:Header>\n"
25 + " <header UserName=\"nothing\" Password=\"important\"/>\n"
26 + " </soapenv:Header>\n"
27 + " <soapenv:Body>\n"
28 + " <emop:ScratchcardValidateAndPayRequestBody>\n"
29 + " <ScratchcardNumber>1</ScratchcardNumber>\n"
30 + " <VirnNumber>2</VirnNumber>\n"
31 + " </emop:ScratchcardValidateAndPayRequestBody>\n"
32 + " </soapenv:Body>\n"
33 + "</soapenv:Envelope>";
34
35 @Override
36 protected String getConfigResources()
37 {
38 return "org/mule/test/integration/transport/cxf/scratchcard-service-config.xml";
39 }
40
41 public void testEnvelopePayloadIsProcessedWhenMessageAndWsdlContainsHeaders() throws Exception
42 {
43 MuleClient client = new MuleClient(muleContext);
44
45 MuleMessage result = client.send("http://localhost:28182/ScratchCardServiceV1", msg, null);
46
47 assertNotNull("The result shouln't have been null", result);
48 final String payloadAsString = result.getPayloadAsString();
49 XMLAssert.assertXMLEqual(msg, payloadAsString);
50 }
51 }