Hi! I am trying to figure out which java library is best to use for a couple adhoc SOAP calls from within a rule. I came across WebservicesClient but that doesnt seem to work consistently for me. I then came across ```
javax.xml.soap.*. but I can’t tell that the library is OOTB for IIQ 8.0. We are currently using Java 8 as well. Any suggestions would be greatly appreciated!
For Additional context, here is my current attempt using webservicesclient but the endpoint seems to not detect the soap action when I send it. Also, can’t seem to find any documentation on webservicesclient either.
import java.util.*;
//import javax.xml.soap.*;
import connector.common.JsonUtil;
import sailpoint.connector.webservices.WebServicesClient;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Log log = LogFactory.getLog("hss.generic");
WebServicesClient client = new WebServicesClient();
Map args = new HashMap();
String URL = "https://global.hgncloud.com/uat_hfss/services/EPM";
args.put(WebServicesClient.ARG_URL, URL);
client.configure(args);
List allowedStatuses = new ArrayList();
allowedStatuses.add("2**");
Map header = new HashMap();
header.put("Content-Type","text/xml; charset=utf-8");
String payload = new StringBuilder()
.append("<soapenv:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" ")
.append("xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:EPM\">\n")
.append(" <soapenv:Header/>\n")
.append(" <soapenv:Body>\n")
.append(" <urn:assignJobDescriptionToUser soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n")
.append(" <credentials xsi:type=\"urn:AuthenticationCredentials\">\n")
.append(" <password xsi:type=\"xsd:string\">password</password>\n")
.append(" <username xsi:type=\"xsd:string\">account</username>\n")
.append(" </credentials>\n")
.append(" <username xsi:type=\"xsd:string\">208381</username>\n")
.append(" <jobDescriptionCode xsi:type=\"xsd:string\">47054-7468</jobDescriptionCode>\n")
.append(" </urn:assignJobDescriptionToUser>\n")
.append(" </soapenv:Body>\n")
.append("</soapenv:Envelope>\n")
.toString();
log.debug("payload = " + payload);
String response = client.executePost(URL, payload, header, allowedStatuses, false, null);
//log.debug("response = " + response);