My service implements Provider<SAXSource> in PAYLOAD service mode. The
following is my invoke method:

 public SAXSource invoke(SAXSource request) throws WebServiceException {
                
          try {
                SAXSource response1 = (SAXSource)operationImpl.invoke(request); 
                StreamResult output = new StreamResult(new
OutputStreamWriter(System.out));
                TransformerFactory xformFactory = 
TransformerFactory.newInstance();
                Transformer idTransform = xformFactory.newTransformer();
                idTransform.transform(response1, output);
                
                SAXSource response2 = (SAXSource)operationImpl.invoke(request);
                XMLInputFactory factory = XMLInputFactory.newInstance();
                XMLStreamReader reader = 
factory.createXMLStreamReader(response2);
                while (reader.hasNext()) {
                        int eventType = reader.next();
                        System.out.println("**** event type="+eventType);
                        if (reader.isStartElement()) {
                                System.out.println("**** 
name="+reader.getName());
                        }
                }
                        
                SAXSource response3 = (SAXSource)operationImpl.invoke(request);
                return response3;
                        
        } catch (WebServiceException e){
                throw e;
        } catch (Exception e) {
                String errorMsg = "Retrieve operation failed -
"+helper.getDataServiceName();
                throw createInternalErrorFault(e, errorMsg);
        }
}

response1, response2 and response3 are the same SAXSource. The output of
response1 and response2 on my console are not empty. However, I got an empty
Outbound Message for response3. Based on the trace, I noticed that the SAX
parser was invoked after the response3 was returned.

Does anybody know what causes this problem?

Xinxin Wang
Associate
 
Booz | Allen | Hamilton
________________________________

151 Industrial Way, Rm. 129
Eatontown, NJ 07724
 
(732) 935-5315 (office)
(732) 935-5220 (fax)
[email protected]

-- 
View this message in context: 
http://www.nabble.com/Provider%3CSource%3E-returns-empty-response-tp24047730p24047730.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to