pom 依赖,jdk1.8
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>3.2.0</version>
</dependency>
<!-- Jetty is needed if you're are not using the CXFServlet -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>3.2.0</version>
</dependency>
java代码
JaxWsProxyFactoryBean factoryBean = new JaxWsProxyFactoryBean();
factoryBean.setAddress(webViewUrl);
factoryBean.setUsername(userName);
factoryBean.setPassword(password);
factoryBean.setServiceClass(SiMdmCreMaterial.class);
SiMdmCreMaterial req = (SiMdmCreMaterial)factoryBean.create();
req.siMdmCreMaterial(dtMdmCreMaterial);
webViewUrl:是http地址
userName:账号
password:密码
SiMdmCreMaterial:利用soapUi cxf生产的代码类在这里插入代码片