You need to sign in to do that
Don't have an account?
David98
Unable to find a de-serializer for the type { http://www.w3.org/2001/XMLSchema } anyURI
I'm just getting started with trying to use the Salesforce API, and I will admit I don't quite understand how it all fits together yet. With my first attempt at a simple script:
Code:
I'm receiving the error: "Unable to find a de-serializer for the type {http://www.w3.org/2001/XMLSchema}anyURI"
I have found that if I remove the "http://" from the value of web_reg_dest__c then the lead is successfully created.
Code:
#!/usr/bin/perl -w use strict; use WWW::Salesforce::Simple; # Authenticate with the Salesforce API based on command line parameters. my $sforce = WWW::Salesforce::Simple->new( 'username' => 'x', 'password' => 'x', ); my %lead = ( "type" => "Lead", "Email" => 'test@test.com', "LeadSource" => "Web Registration", "Company" => "Test Co", "Country" => "US", "FirstName" => "Test", "LastName" => "Person", "web_reg_dest__c" => "http://www.test.com/", ); my $result = $sforce->create(%lead); if ($result->result->{"success"} eq "false") { print $result->result->{errors}->{message} . "\n"; }
I'm receiving the error: "Unable to find a de-serializer for the type {http://www.w3.org/2001/XMLSchema}anyURI"
I have found that if I remove the "http://" from the value of web_reg_dest__c then the lead is successfully created.
Message Edited by Kingsley on 02-08-2007 04:59 PM
here is the syntax
$Salesforce::Constants::TYPES{Partner_Offering__c}->{AverageRating__c} = 'xsd:double';
you would change a few things to read:
$Salesforce::Constants::TYPES{Lead}->{web_reg_dest__c} = 'xsd:string';
put this line somewhere after the module USE statement and before the create()
basicaly if the module has to guess the type from the field contents, it uses the default gusser built into SOAP::Lite, which has some types that are not in the Salesforce WSDL
to see the types, refer to your Salesforce WSDL at:
https://na1.salesforce.com/soap/wsdl.jsp?type=*
The object and field names must be in lower case! Salesforce::Constants->type() includes a lc() function, but if you are setting the type this way, it must be in lowercase!
Example:
Object: X30_Day_Trial__c
Field: Postal_Code__c
$WWW::Salesforce::Constants::TYPES{x30_day_trial}->{postal_code__c} = 'xsd:string';