use of javax.xml.soap.Text in project tdi-studio-se by Talend.
the class MsDynamicsWrapper method retrievePolicy.
/**
* Retrieves the MS CRM 2011 policy
*
* @return the policy string
* @throws JaxenException issue with the response format
* @throws IOException generic IO issue
* @throws SOAPException issue with SOAP invocation
*/
public String retrievePolicy() throws IOException, SOAPException, JaxenException {
String msg = FileUtil.readStringFromClasspath("/org/talend/mscrm/login/passport/RetrievePolicy.xml", MsDynamicsWrapper.class);
SOAPMessage response = soap.execute(HTTPS + host + CRM_DISCOVERY_ENDPOINT, msg);
XPath xp = soap.createXPath("//crm:Policy/text()", response);
xp.addNamespace("crm", CRM_DISCOVERY_XMLNS);
Text result = (Text) xp.selectSingleNode(response.getSOAPBody());
return result.getValue();
}
use of javax.xml.soap.Text in project tdi-studio-se by Talend.
the class MsDynamicsWrapper method retrieveCrmTicket.
/**
* Retrieves the CRM ticket
*
* @return CRM ticket
* @throws JaxenException issue with the response format
* @throws IOException generic IO issue
* @throws SOAPException issue with SOAP invocation
*/
public String retrieveCrmTicket() throws IOException, SOAPException, JaxenException {
String msg = FileUtil.readStringFromClasspath("/org/talend/mscrm/login/passport/RetrieveCrmTicket.xml", MsDynamicsWrapper.class);
msg = msg.replace(CRM_ORGANIZATION_PLACEHOLDER, getOrganization());
msg = msg.replace(LIVE_ID_TICKET_PLACEHOLDER, getLiveId());
SOAPMessage response = soap.execute(HTTPS + host + CRM_DISCOVERY_ENDPOINT, msg);
XPath xp = soap.createXPath("//crm:CrmTicket/text()", response);
xp.addNamespace("crm", CRM_DISCOVERY_XMLNS);
Text result = (Text) xp.selectSingleNode(response.getSOAPBody());
return result.getNodeValue();
}
Aggregations