Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7695299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:31:00+00:00 2026-05-31T21:31:00+00:00

Let me set the scene: I’m a PHP developer that needs to take info

  • 0

Let me set the scene:

I’m a PHP developer that needs to take info from a web form and send it into a clients Salesforce. At first I though it was as simple as using Web2Lead. However the client has a Salesforce developer in house.

The in house developer has sent me partner.wsdl and CatalystWebservice.wsdl files along with login details to their sandbox to run all this on. The in house developer has basically said I need to use the SOAP API of Salesforce and once connected and logged in I need to call ->makeContact("FormField1", "FormField2", "etc...");

So after spending all day trying many things and hitting many problems I have finally hit a wall I cannot climb. Here is my PHP code I have now:

<pre>
<?php
define("SOAP_CLIENT_BASEDIR", "../soapclient");
$USERNAME = '******@********' ;
$PASSWORD = '******************************' ;
require_once (SOAP_CLIENT_BASEDIR.'/SforcePartnerClient.php');
require_once (SOAP_CLIENT_BASEDIR.'/SforceHeaderOptions.php');

try {

    $mySforceConnection = new SforcePartnerClient();
    $mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/partner2.wsdl.xml');
    $loginResult = $mySforceConnection->login($USERNAME, $PASSWORD);

    $location = $mySforceConnection->getLocation();
    $session_ID = $mySforceConnection->getSessionId();

    $client = new SoapClient(SOAP_CLIENT_BASEDIR.'/CatalystWebservice.wsdl.xml');
    $sforce_header = new SoapHeader("http://soap.sforce.com/schemas/class/CatalystWebservice", "SessionHeader", array( "sessionId" => $session_ID ) );
    $client->__setSoapHeaders( array( $sforce_header ) );

    $client->makeContact("*****", "*****", "Address1", "Address2", "London", "****", "no-one@****", "0123456789", "07891236456", "New Build Homebuy", "This is my question\n\nAnd an other line", "1", "Test");

} catch (Exception $e) {
    print_r($e);
}
?>
</pre>

I have starred out sensitive information for here. When I run the above code I get the following output:

SoapFault Object
(
    [message:protected] => UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: ***********-*** (***********)
    [string:Exception:private] => 
    [code:protected] => 0
    [file:protected] => /home/******/public_html/********/test/partner.php
    [line:protected] => 23
    [trace:Exception:private] => Array
        (
            [0] => Array
.....

And the CatalystWebservice.wsdl.xml file

The in house developer has developed something in C# to test his WebService and it works perfectly fine so it must be something I am not doing right. What am I doing incorrectly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T21:31:01+00:00Added an answer on May 31, 2026 at 9:31 pm

    I found the solution… I had to make sure I was sending the data as an associative array like so:

    $response = $client->makeContact
                    (
                        array
                        (
                            "sLastName" => (string) $wpcf7_data->posted_data['last-name'],
                            "sFirstName" => (string) $wpcf7_data->posted_data['first-name'],
                            "sAddress1" => (string) $wpcf7_data->posted_data['address-one'],
                            "sAddress2" => (string) $wpcf7_data->posted_data['address-two'],
                            "sCity" => (string) $wpcf7_data->posted_data['town-city'],
                            "sPostcode" => (string) $wpcf7_data->posted_data['post-code'],
                            "sEmail" => (string) $wpcf7_data->posted_data['email-address'],
                            "sPhone" => (string) $wpcf7_data->posted_data['telephone'],
                            "sMobile" => (string) "",
                            "sEnquiries" => (string) $wpcf7_data->posted_data['enquiry'],
                            "sComment" => (string) $wpcf7_data->posted_data['comments'],
                            "sPropertyID" => (string) wpcf7_special_mail_tag_for_post_data( "", "_post_id" ),
                            "sPropertyName" => (string) wpcf7_special_mail_tag_for_post_data( "", "_post_title" ),
                        )
                    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let me set the stage here. I'm a very junior developer who's recently made
Let X be the set of all sets that do not contain themselves. Is
Let S be a set of n>0 distinct integers.Assume that n is a power
Given a set of real numbers drawn from a unknown continuous univariate distribution (let's
This is maybe unusual so let me set the scene: We have an SVN
I have a form that people can use to send emails to our clients.
I have a minimal program that does little more than let me set two
Let me set the scene.. You can open files in a specific mode like
This is quite an interesting question so let me set the scene. I work
This is my quandary. Let me just set the scene: I have a grid

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.