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
GrahamGraham 

Attach using Partner wsdl?

Dave- (or anyone else)
Using sforce API 2.5, VB.net 2003 and vis studio.net 2003. I had a similar problem with dates (few hours ago) and you said:



DevAngel wrote:

Hi Graham,

Because the partner api doesn't have the "smart" serialization that is the result of the Enterprise WSDL, the date needs to be specified as a string.






I totally understand the symptom and the workaround, but now I am faced with sending attachments. I obviously can't convert the doc to a string, so I have to legitimately set the type to base64. What's the easiest way to tackle this?

Thanks again for your help!
Graham

BTW My boss John told me to mention that I'm with Pragmatech, working on that eProposal integration.
DevAngelDevAngel

Hi Grahm,

There are libraries in .Net that support conversions to and from base64.  The process will be to open the file as a binary file and convert the bytes to a base64 string.  You set the body element to the base64 string.  The reverse is also true.  When obtaining an attachment (or document) you will recieve a base64 string that you need to convert to binary.

Check the Convert class.  It has Convert.ToBase64String and so forth.

GrahamGraham
Great - I'll check that out. Thanks again.