有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

javajaxws端点服务于字符串xml中的任意数据

是否可以从端点中的xml字符串提供任意数据,而不需要解组/创建类

例如

@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) 个答案