Search in sources :

Example 1 with Text

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();
}
Also used : XPath(org.jaxen.XPath) Text(javax.xml.soap.Text) SOAPMessage(javax.xml.soap.SOAPMessage)

Example 2 with Text

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();
}
Also used : XPath(org.jaxen.XPath) Text(javax.xml.soap.Text) SOAPMessage(javax.xml.soap.SOAPMessage)

Aggregations

SOAPMessage (javax.xml.soap.SOAPMessage)2 Text (javax.xml.soap.Text)2 XPath (org.jaxen.XPath)2