• GLacordelle
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

Hi,

 

I am trying to decode attachment body with  this code:

 

             foreach($response->records as $attachment){         
                    $attachmentBody = $attachment->Body;
                    echo base64_decode($attachmentBody);                   
                }

But the result is null. 'Echo $attachmentBody' prints some unreadable text. What is the right way to decode attachment body?

 

Thank you,

-O

  • February 23, 2009
  • Like
  • 0

Hello all,

 

I am attempting to make a connection to our SandBox environment programatically with the API.


When I connected to our production environment, I did so using PERL as follows:


use WWW::Salesforce::Simple;

my $sforce = WWW::Salesforce::Simple->new(
    'username' => $user,
    'password' => $pass,
);



the wsdl.jsp file contains the line:

<port binding="tns:SoapBinding" name="Soap">
   <soap:address location="https://www.salesforce.com/services/Soap/c/15.0"/>
</port>

This worked fine.


However, what I want to do is connect to the SandBox environment.


I appended  ".<our sandbox name>"   to the end of the username.
(I was able to login successfully with this username and it's password at https://test.salesforce.com with

a Web browser so I know my credentials are correct).


In the wsdl.jsp file I tried both the above snippet as well as:



<port binding="tns:SoapBinding" name="Soap">
   <soap:address location="https://test.salesforce.com/services/Soap/c/15.0"/>
</port>


My Perl script that I am using to try to connect is:

#!/usr/bin/perl -w
use strict;

use WWW::Salesforce::Simple;


my $user = '<the username I successfully used on Web browser with sandbox name appended>';
my $pass = '<our password>';

my $sforce = WWW::Salesforce::Simple->new(
    'username' => $user,
    'password' => $pass,
);


print "done\n";




When I run this script I get the following error:

INVALID_LOGIN: Invalid username or password or locked out. at ./connect.pl line 10

 

Not sure how to resolve this. Any assistance with this would be greatly appreciated.

 

 

Regards,

 

RanS

  • February 26, 2009
  • Like
  • 0

Hi,

 

I am trying to decode attachment body with  this code:

 

             foreach($response->records as $attachment){         
                    $attachmentBody = $attachment->Body;
                    echo base64_decode($attachmentBody);                   
                }

But the result is null. 'Echo $attachmentBody' prints some unreadable text. What is the right way to decode attachment body?

 

Thank you,

-O

  • February 23, 2009
  • Like
  • 0