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