0
我已經使用SOAPConnection
來調用服務,問題是Web服務返回一個cookie作爲響應,我如何保存該cookie以進一步調用?如何保存來自Web服務的cookie響應?
SOAPConnectionFactory sfc = SOAPConnectionFactory.newInstance();
SOAPConnection connection = sfc.createConnection();
String text = new String(
Files.readAllBytes(Paths.get("C:\\Users\\abhinav.malviya\\workspace\\TestWeb\\src\\SOAP.xml")),
StandardCharsets.UTF_8);
SOAPMessage sm = getSoapMessageFromString(text);
URL endpoint = new URL("http://URL/ProSightWS/psPortfoliosSecurity.asmx");
SOAPMessage response = connection.call(sm, endpoint);
printMessage(response);
System.out.println(response.getContentDescription());