JAX-WS Endpoint从String xml提供任意数据

时间:2015-07-22 10:46:55

标签: java xml jax-ws

是否可以从端点中的xml String提供任意数据,而无需解组/创建类?

例如

@WebService(endpointInterface = "java.somewhere")
public class MyService {   
    @Override
    public JAXBElement<?> getOrderData(String id) {
        String response = "<note>
                               <to>Tove</to>
                               <from>Jani</from>
                               <heading>Reminder</heading>
                               <body>Don't forget me this weekend!</body>
                           </note>";

        return response; //how?                       
    }
}

0 个答案:

没有答案