嘿,我想用SAAJ调用soap web服务

我用野蝇10

我试图将此系统属性添加到standalone.xml,但无法工作

20: 53:08208错误[stderr](默认任务-21),原因是:java.io.IOException:IOException调用

https://myip:port/b2cgw/PAGOS_B2C

:https URL主机名与客户端信任库中服务器证书上的公用名(CN)不匹配。确保服务器证书正确,或者要禁用此检查(不建议用于生产),请将CXF客户端TLS配置属性“disableCNCheck”设置为true。

私有静态响应Entity callSoapWebService(字符串soapEndpointUrl、字符串soapAction、字符串apikey、长时间戳){

试试看{

//创建SOAP连接

SOAPConnectionFactory SOAPConnectionFactory=SOAPConnectionFactory.newInstance();

SOAPConnection SOAPConnection=soapConnectionFactory.createConnection();

// Send SOAP Message to SOAP Server

SOAPMessage soapResponse = soapConnection.call(createSOAPRequest(soapAction, apikey, timestamp), soapEndpointUrl);

// Print the SOAP Response

System.out.println("Response SOAP Message:");

soapResponse.writeTo(System.out);

System.out.println();

soapConnection.close();

return new ResponseEntity(org.springframework.http.HttpStatus.OK);

} catch (Exception e) {

System.err.println("\nError occurred while sending SOAP Request to Server!\nMake sure you have the correct endpoint URL and SOAPAction!\n");

e.printStackTrace();

return new ResponseEntity(org.springframework.http.HttpStatus.BAD_REQUEST);

}

}

请帮忙,我没有任何cxf配置文件

更多推荐