我正在提出请求。我应该返回一个字符串。
我的答案应该是:
<GETSOMETHING>
<result>
1
</result>
</GETSOMETHING>
我的答案是:
<GETSOMETHING>
<Nothing here>
<result>
1
</result>
</Nothing here>
</GETSOMETHING>
My Wrapper课程:
@XmlRootElement(name="Nothing here")
public class Result_Response_WRAPPER_XML_Object implements Serializable {
private String fields = "";
public Result_Response_WRAPPER_XML_Object () {
}
@XmlElement(name="result")
public String getFields() {
return fields;
}
public void setFields(String fields) {
this.fields = fields;
}
}
我的网络服务就是这样:
// Web方法应该返回一个字符串。
@WebMethod(operationName = "get_result")
@Produces(MediaType.APPLICATION_XML)
public void get_result(@WebParam(name = "requests") RequestObject obj,
@WebParam(name = "GETSOMETHING", mode = WebParam.Mode.OUT) Holder<String> response,
{
//Call my string from class Operation
String result= operation.getResult(obj);
如何摆脱标签?