Hi,

I see a following effect by using Dispatch interface:

             QName serviceName = new QName("http://org.apache.cxf";,
                           "stockQuoteReporter");
             Service s = Service.create(serviceName);
             QName portName = new QName("http://org.apache.cxf";,
                           "stockQuoteReporterPort");
             s.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, 
"http://localhost:8080/sbb/services/Invoke";);
             Dispatch<SAXSource> dispatch = s.createDispatch(portName,
                           SAXSource.class, Service.Mode.MESSAGE);
             try {
                    FileInputStream fis = new 
FileInputStream("c:/1/request.xml");
                    XMLStreamReader request = 
XMLInputFactory.newInstance().createXMLStreamReader(fis);
                    SAXSource response = dispatch.invoke(new 
StaxSource(request));
                    System.out.println(response);
             } catch
             ...

       }
File request.xml contains XML comments in body. As far as I send using this 
code, comments are removed from request and don't arrive provider.
If I use StreamSource with input stream for Dispatch<> comments are preserved.
Does it work as designed?

Regards,
Andrei.

Reply via email to