function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
adityaaditya 

Sending email messages using Partner WSDL

I am trying to send email messages using Partner wsdl file but getting exception saying that SObject.set_any() doesnot exist in SObject class.
Please sujest any solution or technique to send email messages using Partner wsdl.

Code used is like:
Code:
SObject[] mail = new SObject[1];
   MessageElement[] singleMessage = new MessageElement[8]; 
   singleMessage[0] = newMessageElement("BccAddresses",new String[] {"abc@abc.com", "abc@abc.com" });
   singleMessage[1] = newMessageElement("EmailPriority","EmailPriority.High");
   singleMessage[2] = newMessageElement("ReplyTo","abc@abc.com");
   singleMessage[3] = newMessageElement("SaveAsActivity","true");
   singleMessage[4] = newMessageElement("Subject","Lallan Testing 123");
   singleMessage[5] = newMessageElement("UseSignature","true");
   singleMessage[6] = newMessageElement("PlainTextBody","lallan testing 123.....lallan testing 123");
   singleMessage[7] = newMessageElement("ToAddresses",new String[] {"abc@abc.com"});
   mail[0] = new SObject(); 
   mail[0].setType("SingleEmailMessage"); 
   mail[0].set_any(singleMessage); 

 

Message Edited by aditya on 04-24-2007 05:53 AM

SuperfellSuperfell
The sendEmail api is not SObject based, you don't need to jump through the SObject/MessageElement hoops, it should work exactly the same way as it does for the enterprise wsdl.
adityaaditya
 
When trying to use the classes SingleMailMessage, MassMailMessage etc., we found that these classes are available only with the new API.
Previously, when using earlier version of partner.wsdl everything seemed to run alright.

Using the new WSDL file, we generated stubs using Axis. When we tried to compile the new files with our existing code, we found that SObject has changed and it no longer has functions such as set_any etc., and some of the classes/functions such as  SoapBindingStub are not available in the new API.

Could you please help us or provide any pointers for the above problem?

If anyone could provide us with some sample code that would work with the new API, that too would be very useful to us.

Thanks

SuperfellSuperfell
Are you sure you downloaded the 9.0 partner API WSDL ?
adityaaditya
It has been downloaded from Setup->Integrate->Apex API->Download Partner WSDL
Dan HuranDan Huran
SingleEmailMessage is in the v 10 wsdl.