java动态获取WebService的两种方式(复杂参数类型)
第一种:
@Override
public OrderSearchListRes searchOrderList(Order_FlightOrderSearchRequest request) {
Object myAllMessage;
OrderSearchListRes response = null;
try {
String endpoint = carGlobalSetting.getEndpoint();
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
org.apache.cxf.endpoint.Client client = dcf
.createClient(endpoint);
QName name = new QName(carGlobalSetting.getNamespaceURI(), "searchOrderList");
Object person = Thread.currentThread().getContextClassLoader().loadClass("com.uni.webservice.service.neworder.inter.OrderSearchReq").newInstance();
Method m1 = person.getClass().getMethod("setSalesChannel", String.class);
Method m2 = person.getClass().getMethod("setPassportId", Long