1
2
3
4
5
6
7
8
9
10
11 package org.mule.module.cxf.testmodels;
12
13 import java.io.IOException;
14 import java.io.InputStream;
15
16 import javax.activation.DataHandler;
17 import javax.activation.FileDataSource;
18 import javax.jws.WebService;
19 import javax.xml.ws.Holder;
20
21 import org.apache.cxf.mime.TestMtom;
22 import org.apache.cxf.mime.types.XopStringType;
23
24 @WebService(serviceName = "TestMtomService", portName = "TestMtomPort", targetNamespace = "http://cxf.apache.org/mime", endpointInterface = "org.apache.cxf.mime.TestMtom", wsdlLocation = "testutils/mtom_xop.wsdl")
25 public class TestMtomImpl implements TestMtom
26 {
27
28 public XopStringType testXopString(XopStringType data)
29 {
30 return data;
31 }
32
33 public void testXop(Holder<String> name, Holder<DataHandler> attachinfo)
34 {
35 name.value = "return detail + " + name.value;
36
37 try
38 {
39 InputStream inputStream = attachinfo.value.getInputStream();
40 while (inputStream.read() != -1);
41 }
42 catch (IOException e)
43 {
44 e.printStackTrace();
45 }
46
47 attachinfo.value = new DataHandler(new FileDataSource("src/test/resources/mtom-conf-service.xml"));
48 }
49
50 }