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
sk2006sk2006 

how do i use the enterprise wsdl

I am new to Salesforce and SOAP development and having a bit of trouble getting started. I am not sure how I can employ the enterprise.wsdl file so I can start inserting (creating) records for my objects. I've tried, unsuccessfully, to change the Salesforce.pm itself from:

    my $client = SOAP::Lite
        ->deserializer(Salesforce::Deserializer->new)
        ->on_action( sub { return '""' } )
      ->uri('urn:partner.soap.sforce.com')
     ->proxy($self->{address});

to:

    my $client = SOAP::Lite
        ->service('file:/usr/local/lib/perl5/site_perl/5.8.5/enterprise.wsdl');

I am trying to test an insert (code 1 below) but get errors (error 1 below). The reason I thought I needs the wsdl file change in the module because before I was getting some errors without it.

code 1:

#!/usr/local/bin/perl
use CGI;
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use Net::LDAP;
use Net::SMTP;
use SOAP::Lite;
use Salesforce;
use Data::Dumper;

        my $service = new Salesforce::SforceService;
        my $port = $service->get_port_binding('Soap');
        $port->login('username' => 'myusername@mycompany.com','password' => 'secret')
           || die "Could not login to salesforce.com";


        my @results = $port->create( 'type' => "Case",
                                'Contact_Info__c' => "test contact",
                                'Subject' => "test subject",
                                'Version_of_system__c' => "1.0",
                                'Reproduction_Steps__c' => "test 1 2 3",
                                'Always_Reproducible__c' => "true",
                                'What_you_expect_to_see__c' => "expectation",
                                'Expected_behavior_in_documentation__c' => "docsupportexistsval",
                                'Documentation_Reference__c' => "docsupportref",
                                'Additional_Information__c' => "additionalinfo" );
        foreach (@results) {
        print Dumper($_->result);
        }


error 1:

[Thu Mar 23 16:42:08 2006] x: document/literal support is EXPERIMENTAL in SOAP::Lite at /usr/local/lib/perl5/site_perl/5.8.5/SOAP/Lite.pm line 2818.
<h1>Software error:</h1>
<pre>String value expected instead of SOAP::Data reference
</pre>
<p>
For help, please send mail to this site's webmaster, giving this error message
and the time and date of the error.
</p>
<!-- warning: document/literal support is EXPERIMENTAL in SOAP::Lite at /usr/local/lib/perl5/site_perl/5.8.5/SOAP/Lite.pm line 2818. -->
[Thu Mar 23 16:42:09 2006] x: String value expected instead of SOAP::Data reference

 

***************before trying to use the wsdl file***************
code 2: same as code 1

error 2:

$VAR1 = {
          'success' => 'false',
          'errors' => {
                      'fields' => undef,
                      'statusCode' => 'INVALID_TYPE_ON_FIELD_IN_RECORD',
                      'message' => 'Always Reproducible: value not of required type: true'
                    },
          'id' => undef
        };


 

SuperfellSuperfell
I don't think the perl tools support the enterprise wsdl, switch it back to the partner one, then checkout this thread about non-string types.


sk2006sk2006
Thank you. This has helped.