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 

SelfServiceUser type not available for my org - perl

describeSObject gives me this:

$VAR1 = {
          'Body' => {
                    'Fault' => {
                               'detail' => {
                                           'fault' => bless( {
                                                             'exceptionMessage' => 'sObject type \'SelfServiceUser\' is not supported.',
                                                             'exceptionCode' => 'INVALID_TYPE'
                                                           }, 'InvalidSObjectFault' )
                                         },
                               'faultcode' => 'soapenv:Server',
                               'faultstring' => 'INVALID_TYPE: sObject type \'SelfServiceUser\' is not supported.'
                             }
                  }
        };

describeGlobal also does not list SelfServiceUser as an available type. Any ideas?

SK
SuperfellSuperfell
Which api version are you using ? (what's the last part of the URL)
sk2006sk2006
this is what i have in Salesforce.pm.

    my $client = SOAP::Lite
#       ->service('file:/usr/local/lib/perl5/site_perl/5.8.5/partner.wsdl')
        ->deserializer(Salesforce::Deserializer->new)
        ->on_action( sub { return '""' } )
        ->uri('urn:partner.soap.sforce.com')
        ->proxy($self->{address});



SuperfellSuperfell
What's the version stated in the WSDL ? SelfServiceUser was added in the v6.0 API. You might need to upgrade to the latest API version.
sk2006sk2006
I am at 7.0 it seems based on the wsdl file i downloaded from the SF site/Setup/Integrate page.


<?xml version="1.0" encoding="UTF-8"?>
<!--
Salesforce.com Partner Web Services API Version 7.0
Generated on 2006-03-23 21:24:48 +0000.

Copyright 1999-2006 salesforce.com, inc.
All Rights Reserved
-->

<definitions targetNamespace="urn:partner.soap.sforce.com"
             xmlns="http://schemas.xmlsoap.org/wsdl/"

             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"

             xmlns:xsd="http://www.w3.org/2001/XMLSchema"

             xmlns:fns="urn:fault.partner.soap.sforce.com"

             xmlns:tns="urn:partner.soap.sforce.com"

             xmlns:ens="urn:sobject.partner.soap.sforce.com">
    <types>
SuperfellSuperfell
But is that the wsdl at the location file:/usr/local/lib/perl5/site_perl/5.8.5/partner.wsdl ?
sk2006sk2006
well I am not even referencing it in Salesforce.pm. Its commented out. Do I have to? Problem is if I uncomment it, I run into the same "document/literal support is EXPERIMENTAL" problem for a simple call like this.

#!/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@myorg.com','password' => 'mypass')
   || die "Could not login to salesforce.com";

$result = $port->describeGlobal();

print Dumper($result->valueof());

SuperfellSuperfell
You need to use the 6.0 or later API to get SelfServiceUser. I don't know what that means in terms of the perl stubs. perhaps Ron or Adam can help.
sk2006sk2006
Should I be logging a case to get assistance with such issues? I really need some help here to get going.

regards,

SuperfellSuperfell
I don't believe you can call suport for this, the download for the perl samples says

"..... This project was created and is maintained by the AppExchange open source community - these samples are not supported by salesforce.com, and should be considered experimental. See enclosed documentation for requirements and installation instructions, and route and questions to the AppExchange message boards."
adamgadamg
SK is there any chance we can get you on PHP (5.1+) or Java?  Using Perl with the AppExchange API requires a fair amount of fishing around.
sk2006sk2006
Adam, unfortunately that is not a possiblity for us right now. All I am trying to do is this set up a "Log a Case" form to submit Cases to SF using the API.

- I want to run a query to see a Contact is active for SelfService and if yes, I want to create the new record.
- I have had success running creates with my setup but just cant seem to satisfy the above requirement.

Also while I have your kind attention, I am unable to query the Contact object even using the where clause. For example, this piece of code gives me zip.

$sf = new Salesforce::SforceService->get_port_binding('Soap');
$sf->login( 'username' => 'username@myorg.com','password' => 'secret' );

my $email = 'khehra1@ppllc.com';
$r = $sf->query('query' => "select * from Contact where Email = 'username@ppllc.com'") ;

print Dumper($r->result);


regards,
Sukh
Ron HessRon Hess
I don't thnk you can do "select * from ..."

* is not a valid field name

try "select id,firstname,lastname from ..."


when you say zip, do you get back a fault or zero records?
sk2006sk2006
Ron, I have tried specifying the field names instead of the wildcard to no avail either. I do not get an error with this. The script just ends with no output.
Ron HessRon Hess
in all my work with perl, i do not use the WSDL , instead i use the field defs which are located inside the Saleforce.pm file. 
I'm not sure if that is the problem or not.

it sounds like the simple case of running a query on contacts is not working, what version of SOAP lite are you using ?
are you on ActiveState or is this some flavor of perl on unix?