cxf 2.x を使用して Web サービスを開発しています。ここに私のWebサービスクラスがあります
@WebService(name = "XXXWS", targetNamespace = "http://www.XXX.com/XXXWS", portName = "XXXWSPort", serviceName = "XXXWSService")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public class XXXWS {
@WebMethod(operationName = "XXXMethod", action = "http://www.XXX.com/XXXWS/XXXX")
public XXXResponse XXXMethod(
@WebParam(name = "XXXRequest") XXXRequest xxxRequest) {
// implement code here
return response;
}
private static String getServiceURL(Environment env, String actionCode){ //<-- RED CROSS here
//implement code here
return url;
}
}
Eclipse では、メソッド getServiceURL に赤十字があります (これは通常のメソッドであり、WEBMETHOD ではありません)。それは言う
Multiple markers at this line
- Document Literal Bare operations must have unique XML elements for the input and output messages across all operations on the
Web Service : '{http://www.XXX.com/XXXWS}getServiceURL'
- Document literal bare methods may have only one non-header IN parameter
したがって、getServiceURL メソッドの入力として 1 つのパラメーターのみを使用するか、SOAPBinding.ParameterStyle.WRAPPED を使用すると、赤い十字が消えます。しかし、ここには 2 つのパラメーターが必要です。
私の質問は、ここで 2 つのパラメーターを使用する必要があり、まだ SOAPBinding.ParameterStyle.BARE を使用する必要がある場合、赤十字を削除するにはどうすればよいですか。この種のエラーを取り除くためにEclipseを設定する方法があると思います