• gmac
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 5
    Replies
I'm using Perl (v 5.8.8), WWW-Salesforce.com , SOAP::Lite.
When I send query to SFDC API server, I get the correct response.


Code:
SOAP::Serializer::envelope: query SOAP::Data=HASH(0x8424e2c)
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x89a71e8)
SOAP::Transport::HTTP::Client::send_receive: POST https://na5-api.salesforce.com/services/Soap/c/13.0/460300D70000000JQJ4 HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 961
Content-Type: text/xml; charset=utf-8
SOAPAction: ""

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<sforce:QueryOptions xmlns:sforce="urn:enterprise.soap.sforce.com">
<batchSize xsi:type="xsd:int">500</batchSize>
</sforce:QueryOptions>
<sforce:SessionHeader xmlns:sforce="urn:enterprise.soap.sforce.com"><sessionId xsi:type="xsd:string">460300D70000000JQJ4!ARgAQD43iHOagg0b0QUjyT23N.A6aM1cVdAghMZLfg5Q21fxIjRB3q8RVxTdkf4dmv0r0nNdtFMVSRjd3.5HEkHTOgsmyDO0</sessionId>
</sforce:SessionHeader>
</soap:Header>
<soap:Body>
<query xmlns="urn:enterprise.soap.sforce.com">
<queryString xsi:type="xsd:string">
Select Id, IsDeleted, MasterRecordId, Name FROM Account WHERE Name like '%Agentur%'
</queryString>
</query>
</soap:Body>
</soap:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x89a6dec)
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
Date: Wed, 22 Oct 2008 13:28:58 GMT
Server:
Content-Type: text/xml; charset=utf-8
Client-Date: Wed, 22 Oct 2008 13:29:02 GMT
Client-Peer: 204.235.24.47:80
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /O=VeriSign Trust Network/OU=VeriSign, Inc./OU=VeriSign International Server CA - Class 3/OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign
Client-SSL-Cert-Subject: /C=US/ST=California/L=San Francisco/O=Salesforce.com, Inc./OU=Applications/OU=Terms of use at www.verisign.com/rpa (c)00/CN=na5-api.salesforce.com
Client-SSL-Cipher: RC4-MD5
Client-SSL-Warning: Peer certificate not verified
Client-Transfer-Encoding: chunked

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope>
<soapenv:Body>
<queryResponse>
<result>
<done>true</done>
<queryLocator xsi:nil="true"/>
<records xsi:type="sf:Account">
<sf:Id>0017000000S7YPAAA3</sf:Id>
<sf:IsDeleted>false</sf:IsDeleted>
<sf:Name>Agentur für Arbeit</sf:Name>
</records>
<size>1</size>
</result>
</queryResponse>
</soapenv:Body>
</soapenv:Envelope>
SOAP::Deserializer::deserialize: ()
SOAP::Parser::decode: ()
SOAP::SOM::new: ()
SOAP::SOM::DESTROY: ()
SOAP::Lite::DESTROY: ()
SOAP::Deserializer::DESTROY: ()
SOAP::Parser::DESTROY: ()
SOAP::Transport::DESTROY: ()
SOAP::Transport::HTTP::Client::DESTROY: ()
SOAP::Serializer::DESTROY: ()
SOAP::Data::DESTROY: ()

When the queryString contains utf-8 encoded characters, my request message turns out ok, but I'm getting an error from the server.


Code:
SOAP::Serializer::envelope: query SOAP::Data=HASH(0x8424e2c)
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x89b8610)
SOAP::Transport::HTTP::Client::send_receive: POST https://na5-api.salesforce.com/services/Soap/c/13.0/460300D70000000JQJ4 HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 958
Content-Type: text/xml; charset=utf-8
SOAPAction: ""

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<sforce:QueryOptions xmlns:sforce="urn:enterprise.soap.sforce.com">
<batchSize xsi:type="xsd:int">500</batchSize>
</sforce:QueryOptions><sforce:SessionHeader xmlns:sforce="urn:enterprise.soap.sforce.com"><sessionId xsi:type="xsd:string">460300D70000000JQJ4!ARgAQD43iHOagg0b0QUjyT23N.A6aM1cVdAghMZLfg5Q21fxIjRB3q8RVxTdkf4dmv0r0nNdtFMVSRjd3.5HEkHTOgsmyDO0</sessionId></sforce:SessionHeader>
</soap:Header>
<soap:Body>
<query xmlns="urn:enterprise.soap.sforce.com">
<queryString xsi:type="xsd:string">
Select Id, IsDeleted, MasterRecordId, Name FROM Account WHERE Name like '%für%'
</queryString>
</query>
</soap:Body>
</soap:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x89b91bc)
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error
Date: Wed, 22 Oct 2008 13:29:06 GMT
Server:
Content-Type: text/xml; charset=utf-8
Client-Date: Wed, 22 Oct 2008 13:29:11 GMT
Client-Peer: 204.235.24.47:80
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /O=VeriSign Trust Network/OU=VeriSign, Inc./OU=VeriSign International Server CA - Class 3/OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign
Client-SSL-Cert-Subject: /C=US/ST=California/L=San Francisco/O=Salesforce.com, Inc./OU=Applications/OU=Terms of use at www.verisign.com/rpa (c)00/CN=na5-api.salesforce.com
Client-SSL-Cipher: RC4-MD5
Client-SSL-Warning: Peer certificate not verified
Client-Transfer-Encoding: chunked

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope>
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>
The element type "soap:Envelope" must be terminated by the matching end-tag "</soap:Envelope>".
</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
SOAP::Deserializer::deserialize: ()
SOAP::Parser::decode: ()
SOAP::SOM::new: ()
The element type "soap:Envelope" must be terminated by the matching end-tag "</soap:Envelope>". at testAPI.pl line 37
SOAP::SOM::DESTROY: ()
SOAP::Lite::DESTROY: ()
SOAP::Deserializer::DESTROY: ()
SOAP::Parser::DESTROY: ()
SOAP::Transport::DESTROY: ()
SOAP::Transport::HTTP::Client::DESTROY: ()
SOAP::Serializer::DESTROY: ()
SOAP::Data::DESTROY: ()

Everything is encoded with utf-8. My orgernization setting from 'describeGlobal' says server expects encoding 'utf-8'. The fault strings says my message is not well formed xml, besides that I noticed there was a '500 Internal Server Error' when I'm getting the response for the query with unicode.

I'm also able to get query results from the server which contains unicode characters.

Help is appreciated.



  • October 22, 2008
  • Like
  • 0
I'm using Perl (v 5.8.8), WWW-Salesforce.com , SOAP::Lite.
When I send query to SFDC API server, I get the correct response.


Code:
SOAP::Serializer::envelope: query SOAP::Data=HASH(0x8424e2c)
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x89a71e8)
SOAP::Transport::HTTP::Client::send_receive: POST https://na5-api.salesforce.com/services/Soap/c/13.0/460300D70000000JQJ4 HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 961
Content-Type: text/xml; charset=utf-8
SOAPAction: ""

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<sforce:QueryOptions xmlns:sforce="urn:enterprise.soap.sforce.com">
<batchSize xsi:type="xsd:int">500</batchSize>
</sforce:QueryOptions>
<sforce:SessionHeader xmlns:sforce="urn:enterprise.soap.sforce.com"><sessionId xsi:type="xsd:string">460300D70000000JQJ4!ARgAQD43iHOagg0b0QUjyT23N.A6aM1cVdAghMZLfg5Q21fxIjRB3q8RVxTdkf4dmv0r0nNdtFMVSRjd3.5HEkHTOgsmyDO0</sessionId>
</sforce:SessionHeader>
</soap:Header>
<soap:Body>
<query xmlns="urn:enterprise.soap.sforce.com">
<queryString xsi:type="xsd:string">
Select Id, IsDeleted, MasterRecordId, Name FROM Account WHERE Name like '%Agentur%'
</queryString>
</query>
</soap:Body>
</soap:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x89a6dec)
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
Date: Wed, 22 Oct 2008 13:28:58 GMT
Server:
Content-Type: text/xml; charset=utf-8
Client-Date: Wed, 22 Oct 2008 13:29:02 GMT
Client-Peer: 204.235.24.47:80
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /O=VeriSign Trust Network/OU=VeriSign, Inc./OU=VeriSign International Server CA - Class 3/OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign
Client-SSL-Cert-Subject: /C=US/ST=California/L=San Francisco/O=Salesforce.com, Inc./OU=Applications/OU=Terms of use at www.verisign.com/rpa (c)00/CN=na5-api.salesforce.com
Client-SSL-Cipher: RC4-MD5
Client-SSL-Warning: Peer certificate not verified
Client-Transfer-Encoding: chunked

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope>
<soapenv:Body>
<queryResponse>
<result>
<done>true</done>
<queryLocator xsi:nil="true"/>
<records xsi:type="sf:Account">
<sf:Id>0017000000S7YPAAA3</sf:Id>
<sf:IsDeleted>false</sf:IsDeleted>
<sf:Name>Agentur für Arbeit</sf:Name>
</records>
<size>1</size>
</result>
</queryResponse>
</soapenv:Body>
</soapenv:Envelope>
SOAP::Deserializer::deserialize: ()
SOAP::Parser::decode: ()
SOAP::SOM::new: ()
SOAP::SOM::DESTROY: ()
SOAP::Lite::DESTROY: ()
SOAP::Deserializer::DESTROY: ()
SOAP::Parser::DESTROY: ()
SOAP::Transport::DESTROY: ()
SOAP::Transport::HTTP::Client::DESTROY: ()
SOAP::Serializer::DESTROY: ()
SOAP::Data::DESTROY: ()

When the queryString contains utf-8 encoded characters, my request message turns out ok, but I'm getting an error from the server.


Code:
SOAP::Serializer::envelope: query SOAP::Data=HASH(0x8424e2c)
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x89b8610)
SOAP::Transport::HTTP::Client::send_receive: POST https://na5-api.salesforce.com/services/Soap/c/13.0/460300D70000000JQJ4 HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 958
Content-Type: text/xml; charset=utf-8
SOAPAction: ""

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<sforce:QueryOptions xmlns:sforce="urn:enterprise.soap.sforce.com">
<batchSize xsi:type="xsd:int">500</batchSize>
</sforce:QueryOptions><sforce:SessionHeader xmlns:sforce="urn:enterprise.soap.sforce.com"><sessionId xsi:type="xsd:string">460300D70000000JQJ4!ARgAQD43iHOagg0b0QUjyT23N.A6aM1cVdAghMZLfg5Q21fxIjRB3q8RVxTdkf4dmv0r0nNdtFMVSRjd3.5HEkHTOgsmyDO0</sessionId></sforce:SessionHeader>
</soap:Header>
<soap:Body>
<query xmlns="urn:enterprise.soap.sforce.com">
<queryString xsi:type="xsd:string">
Select Id, IsDeleted, MasterRecordId, Name FROM Account WHERE Name like '%für%'
</queryString>
</query>
</soap:Body>
</soap:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x89b91bc)
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error
Date: Wed, 22 Oct 2008 13:29:06 GMT
Server:
Content-Type: text/xml; charset=utf-8
Client-Date: Wed, 22 Oct 2008 13:29:11 GMT
Client-Peer: 204.235.24.47:80
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /O=VeriSign Trust Network/OU=VeriSign, Inc./OU=VeriSign International Server CA - Class 3/OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign
Client-SSL-Cert-Subject: /C=US/ST=California/L=San Francisco/O=Salesforce.com, Inc./OU=Applications/OU=Terms of use at www.verisign.com/rpa (c)00/CN=na5-api.salesforce.com
Client-SSL-Cipher: RC4-MD5
Client-SSL-Warning: Peer certificate not verified
Client-Transfer-Encoding: chunked

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope>
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>
The element type "soap:Envelope" must be terminated by the matching end-tag "</soap:Envelope>".
</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
SOAP::Deserializer::deserialize: ()
SOAP::Parser::decode: ()
SOAP::SOM::new: ()
The element type "soap:Envelope" must be terminated by the matching end-tag "</soap:Envelope>". at testAPI.pl line 37
SOAP::SOM::DESTROY: ()
SOAP::Lite::DESTROY: ()
SOAP::Deserializer::DESTROY: ()
SOAP::Parser::DESTROY: ()
SOAP::Transport::DESTROY: ()
SOAP::Transport::HTTP::Client::DESTROY: ()
SOAP::Serializer::DESTROY: ()
SOAP::Data::DESTROY: ()

Everything is encoded with utf-8. My orgernization setting from 'describeGlobal' says server expects encoding 'utf-8'. The fault strings says my message is not well formed xml, besides that I noticed there was a '500 Internal Server Error' when I'm getting the response for the query with unicode.

I'm also able to get query results from the server which contains unicode characters.

Help is appreciated.



  • October 22, 2008
  • Like
  • 0
All , I am new to salesforce , We are trying to connect to salesforce from PERL using WWW::Salesforce::Simple;
 
I am getting the following error when i run the code
500 Server closed connection without sending any data back at //pkgs/linux/intel/perl/5.8.8.rhas3.x86/lib/site_perl/5.8.8/WWW/Salesforce.pm line 469
 
But we are able to connec to the salesforce site using the same username and password and also we are able to ping the salesforce site from the unix machine.
 
Is there any steps i should follow before coding , i used the steps mentioned in http://www.oreillynet.com/pub/a/network/2006/11/27/using-the-salesforcecom-api.html  , Do i need to put any wsdl file in the perl path , if yes can you tell me where should i place the wsdl file and the steps to connect to salesforce.
 
Thanks,
Prasanna
  • September 17, 2008
  • Like
  • 0
Hi

I downloaded the module Salesforce-0.57 & also WWW-Salesforce-0.082, with installing it into, directly use the modules in the sample script and tring to login.
But it fails.
I don't know what i am missing out.

Could any body please help me.

We i went through the documents on developer.force.com i can see the step for java and .net only.
If any body got links or documents for Perl, will help me great.

Thanks
Balaji