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
MrdiniMrdini 

PHP - Incorrect XML output from PEAR::SOAP?

Hi,

At the moment, I'm trying to talk to the Salesforce server. Retrieving data works fine - no problems there. However, the problem starts when I try to either update or create a new record.

After a bit of googling round, I THINK it's due to the fact that is missing xsi:type="string". However, I'm a bit at a loss as to how to fix this.

The code is pretty standard...
---
require_once("../SalesforceClient.php");
include_once("salesforce.conf");
...
$client = new SalesforceClient($SESSION);
$client->_endpoint = $_COOKIE['sf_endpoint'];
....
$FIELDS = array(
'type'=>'lead',
'FirstName'=>'newtest',
'LastName'=>'test',
'Company'=>'testthis');

$client->create($FIELDS);
print_r($client);
----

Any ideas? The output from the (trimmed) SOAP stuff follows....
Deepest thanks for any help you folks are able to give,

Y.

-----
salesforceclient Object
(
[sessionId] => REMOVED
[_endpoint] => https://na1-api.salesforce.com/services/Soap/c/7.0
[_portName] =>
[__endpointType] =>
[xml] => sf:INVALID_TYPEINVALID_TYPE: Must send a concrete entity type.INVALID_TYPEMust send a concrete entity type.-1-1
[wire] => OUTGOING:



xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:enterprise.soap.sforce.com"
>



REMOVED

phpClient/1.0





lead
newtest
test
testthis




INCOMING

HTTP/1.0 500 Internal Server Error
Server:
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 693
Date: Tue, 07 Mar 2006 04:47:51 GMT





sf:INVALID_TYPE
INVALID_TYPE: Must send a concrete entity type.


INVALID_TYPE
Must send a concrete entity type.
-1
-1





[__last_request] =>

xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:enterprise.soap.sforce.com"
>



I7wr3taEgP5ReEZqGfymwTx7JzNTlrD8E2bUGXrgBWA9ej2dYoLIJuQ3T25Sg.Fs.v2X2btzFhou02X3IyD57WpYnKO9AsNCSeX5jsUoLXQ=

phpClient/1.0





lead
newtest
test
testthis



[__last_response] => HTTP/1.0 500 Internal Server Error
Server:
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 693
Date: Tue, 07 Mar 2006 04:47:51 GMT

sf:INVALID_TYPEINVALID_TYPE: Must send a concrete entity type.INVALID_TYPEMust send a concrete entity type.-1-1
[__options] => Array
(
[trace] => 1
[curl] => Array
(
[84] => 1.0
)

[timeout] => 3600
[input] => parse
[result] => parse
[parameters] =>
[namespace] => urn:enterprise.soap.sforce.com
[soapaction] =>
[style] => document
[use] => literal
)

[_encoding] => UTF-8
[headersIn] =>
[__proxy_params] => Array
(
)

[_soap_transport] => soap_transport_http Object
(
[_XMLSchema] => Array
(
[0] => http://www.w3.org/2001/XMLSchema
[1] => http://www.w3.org/1999/XMLSchema
)

[_XMLSchemaVersion] => http://www.w3.org/2001/XMLSchema
[_typemap] => Array
(
[http://www.w3.org/2001/XMLSchema] => Array
(
[string] => string
[boolean] => boolean
[float] => float
[double] => float
[decimal] => float
[duration] => integer
[dateTime] => string
[time] => string
[date] => string
[gYearMonth] => integer
[gYear] => integer
[gMonthDay] => integer
[gDay] => integer
[gMonth] => integer
[hexBinary] => string
[base64Binary] => string
[normalizedString] => string
[token] => string
[language] => string
[NMTOKEN] => string
[NMTOKENS] => string
[Name] => string
[NCName] => string
[ID] => string
[IDREF] => string
[IDREFS] => string
[ENTITY] => string
[ENTITIES] => string
[integer] => integer
[nonPositiveInteger] => integer
[negativeInteger] => integer
[long] => integer
[int] => integer
[short] => integer
[byte] => string
[nonNegativeInteger] => integer
[unsignedLong] => integer
[unsignedInt] => integer
[unsignedShort] => integer
[unsignedByte] => integer
[positiveInteger] => integer
[anyType] => string
[anyURI] => string
[QName] => string
)

[http://www.w3.org/1999/XMLSchema] => Array
(
[i4] => integer
[int] => integer
[boolean] => boolean
[string] => string
[double] => float
[float] => float
[dateTime] => string
[timeInstant] => string
[base64Binary] => string
[base64] => string
[ur-type] => string
)

[http://schemas.xmlsoap.org/soap/encoding/] => Array
(
[base64] => string
[array] => array
[Array] => array
[Struct] => array
)

)

[_defaultObjectClassname] => stdClass
[_namespaces] => Array
(
[http://schemas.xmlsoap.org/soap/envelope/] => SOAP-ENV
[http://www.w3.org/2001/XMLSchema] => xsd
[http://www.w3.org/2001/XMLSchema-instance] => xsi
[http://schemas.xmlsoap.org/soap/encoding/] => SOAP-ENC
)

[_namespace] =>
[_xmlEntities] => Array
(
[&] => &
[ <
[>] => >
['] => '
["] => "
)

[_doconversion] =>
[__attachments] => Array
(
)

[_wsdl] =>
[_section5] => 1
[_auto_translation] =>
[_type_translation] => Array
(
)

[_debug_flag] =>
[_debug_data] =>
[_encodings] => Array
(
[0] => ISO-8859-1
[1] => US-ASCII
[2] => UTF-8
)

[_myfaultcode] => HTTP
[fault] =>
[_debug] =>
[_default_error_mode] =>
[_default_error_options] =>
[_default_error_handler] =>
[_error_class] => SOAP_Fault
[_expected_errors] => Array
(
)

[headers] => Array
(
)

[cookies] =>
[timeout] => 3600
[urlparts] => Array
(
[scheme] => https
[host] => na1-api.salesforce.com
[path] => /services/Soap/c/7.0
[port] => 443
)

[url] => https://na1-api.salesforce.com/services/Soap/c/7.0
[incoming_payload] => HTTP/1.0 500 Internal Server Error
Server:
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 693
Date: Tue, 07 Mar 2006 04:47:51 GMT

sf:INVALID_TYPEINVALID_TYPE: Must send a concrete entity type.INVALID_TYPEMust send a concrete entity type.-1-1
[_userAgent] => PEAR-SOAP 0.8.0RC4-devel
[encoding] => UTF-8
[result_encoding] => UTF-8
[result_content_type] => text/xml
[result_headers] => Array
(
[server] =>
[cache-control] => private
[content-type] => text/xml; charset=utf-8
[content-length] => 693
[date] => Tue, 07 Mar 2006 04
)

[result_cookies] => Array
(
)

[outgoing_payload] =>

xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:enterprise.soap.sforce.com"
>



I7wr3taEgP5ReEZqGfymwTx7JzNTlrD8E2bUGXrgBWA9ej2dYoLIJuQ3T25Sg.Fs.v2X2btzFhou02X3IyD57WpYnKO9AsNCSeX5jsUoLXQ=

phpClient/1.0





lead
newtest
test
testthis



[response] => sf:INVALID_TYPEINVALID_TYPE: Must send a concrete entity type.INVALID_TYPEMust send a concrete entity type.-1-1
[attachments] =>
)

[_XMLSchema] => Array
(
[0] => http://www.w3.org/2001/XMLSchema
[1] => http://www.w3.org/1999/XMLSchema
)

[_XMLSchemaVersion] => http://www.w3.org/2001/XMLSchema

Message Edited by Mrdini on 03-14-2006 09:11 AM

MrdiniMrdini
No-one has any ideas? *sighs* Even a pointer as to where to look (i.e. in the WSDL code or in the Salesforce code, or in the PEAR code would help greatly)
SuperfellSuperfell
Its hard to tell with all the broken formatting, but based on the error, you're missing an xsi:type="sf:Account" (or whatever type you're using) on the sObjects element. I have no idea though how you tell PEAR to add this. There's at least 3 php samples floating around, have you looked at those for inspiration ?