Home > Back-end >  CXF client transfer the webservice interface is not applicable to the maven which jar to import unde
CXF client transfer the webservice interface is not applicable to the maven which jar to import unde

Time:10-22

3.2.9, for example, the following jar package is necessary:

CXF - core - 3.2.9. Jar
CXF - rt - bindings - soap - 3.2.9. Jar
CXF - rt - databinding - jaxb - 3.2.9. Jar
CXF - rt - frontend - jaxws - 3.2.9. Jar
CXF - rt - frontend - simple - 3.2.9. Jar
CXF - rt - transports - HTTP - 3.2.9. Jar
CXF - rt - WSDL - 3.2.9. Jar

The client call way:
Public static void main (String [] args) {
JaxWsDynamicClientFactory DCF model=JaxWsDynamicClientFactory. NewInstance ();
//webService WSDL address
The Client Client=DCF model. CreateClient (" http://test/services/WebService? WSDL ");
//namespace, the method name
QName name=new QName (" http://service.test.com ", "test1");
//parameter values
String startDate="2020/09/01";
String endDate="2020/09/06";

Object [] objects;
Try {
Objects=client. Invoke (name, startDate, startDate);
//can be strong, but the path of the targetNamespace antitone must be the client's Order and Order_date package path, otherwise the following strong client calls turn error
List OrderList=(List) Objects [0].
System. The out. Println (orderList. Get (0). GetChannel_id ());
System. The out. Println (objects [0]. The toString ());
System. The out. Println (orderList. ToString ());
} the catch (Exception e) {
e.printStackTrace();
}
}
  • Related