Search in sources :

Example 1 with ResultGetLead

use of com.marketo.mktows.ResultGetLead in project components by Talend.

the class MarketoSOAPClientTest method getGetLeadResult.

public SuccessGetLead getGetLeadResult() {
    SuccessGetLead result = new SuccessGetLead();
    ResultGetLead res = new ResultGetLead();
    res.setCount(1);
    ArrayOfLeadRecord leadrecords = new ArrayOfLeadRecord();
    LeadRecord r = new LeadRecord();
    r.setId(objectFactory.createLeadRecordId(12345));
    r.setEmail(objectFactory.createLeadRecordEmail("email@email.com"));
    r.setForeignSysPersonId(objectFactory.createLeadRecordForeignSysPersonId("foreignSysPersonId"));
    r.setForeignSysType(objectFactory.createLeadRecordForeignSysType(ForeignSysType.SFDC));
    ArrayOfAttribute aoa = objectFactory.createArrayOfAttribute();
    Attribute attr = new Attribute();
    attr.setAttrName("attrName");
    attr.setAttrValue("attrValue");
    aoa.getAttributes().add(attr);
    r.setLeadAttributeList(objectFactory.createActivityRecordActivityAttributes(aoa));
    leadrecords.getLeadRecords().add(r);
    QName qname = new QName("http://www.marketo.com/mktows/", "leadAttributeList");
    JAXBElement<ArrayOfLeadRecord> attrList = new JAXBElement(qname, LeadRecord.class, leadrecords);
    res.setLeadRecordList(attrList);
    result.setResult(res);
    return result;
}
Also used : ArrayOfLeadRecord(com.marketo.mktows.ArrayOfLeadRecord) ArrayOfAttribute(com.marketo.mktows.ArrayOfAttribute) ArrayOfLeadRecord(com.marketo.mktows.ArrayOfLeadRecord) LeadRecord(com.marketo.mktows.LeadRecord) ArrayOfAttribute(com.marketo.mktows.ArrayOfAttribute) Attribute(com.marketo.mktows.Attribute) QName(javax.xml.namespace.QName) SuccessGetLead(com.marketo.mktows.SuccessGetLead) ResultGetLead(com.marketo.mktows.ResultGetLead) JAXBElement(javax.xml.bind.JAXBElement)

Aggregations

ArrayOfAttribute (com.marketo.mktows.ArrayOfAttribute)1 ArrayOfLeadRecord (com.marketo.mktows.ArrayOfLeadRecord)1 Attribute (com.marketo.mktows.Attribute)1 LeadRecord (com.marketo.mktows.LeadRecord)1 ResultGetLead (com.marketo.mktows.ResultGetLead)1 SuccessGetLead (com.marketo.mktows.SuccessGetLead)1 JAXBElement (javax.xml.bind.JAXBElement)1 QName (javax.xml.namespace.QName)1