php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34788 SOAP Client not applying correct namespace to generated values
Submitted: 2005-10-08 08:19 UTC Modified: 2005-10-09 14:51 UTC
From: marcus at synchromedia dot co dot uk Assigned: dmitry
Status: Closed Package: SOAP related
PHP Version: 5CVS-2005-10-08 (snap) OS: *
Private report: No CVE-ID:
 [2005-10-08 08:19 UTC] marcus at synchromedia dot co dot uk
Description:
------------
I'm creating a SOAP request using a WSDL. Any values I do
not specify are automatically filled in by PHP with an
xsi:nil value, however, PHP fails to attach the appropriate 
namespace to these elements.

In the example given, you can see that the Email, FirstName
and LastName fields are set to values that I submitted, and
they have been correctly asigned the ns1 namespace, but
values that I did not set (HomePhone and MailingCountry) that 
PHP has filled in with nil values have not been assigned this 
namespace

This example also demonstrates bug 34787 - the xsi:nil
values should be "true" not "1".

Reproduce code:
---------------
http://suraski.net/blog/index.php?/archives/5-PHP-5s-SOAP-extension-and-SalesForce.html

Expected result:
----------------
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://
schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance" 
xmlns:ns1="urn:sobject.enterprise.soap.sforce.com" 
xmlns:ns2="urn:enterprise.soap.sforce.com">
    <SOAP-ENV:Header>
        <ns2:SessionHeader>
            
<ns2:sessionId>4aydyZqjp2YXN2fGup36jvv7qsUBPf1EGdfOuTmEB9web
rrmibaB27fvC6s7d750KvHtIWMbxsRqqcH9wSANKxhD2wYHcrlK4SNdGN37z
i4=</ns2:sessionId>
        </ns2:SessionHeader>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <ns2:create>
            <ns2:sObjects xsi:type="ns1:Contact">
                <ns1:Email>someone@example.com</ns1:Email>
                <ns1:FirstName>First</ns1:FirstName>
                <ns1:HomePhone xsi:nil="true" />
                <ns1:LastName>Last</ns1:LastName>
                <ns1:MailingCountry xsi:nil="true" />
            </ns2:sObjects>
        </ns2:create>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


Actual result:
--------------
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://
schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance" 
xmlns:ns1="urn:sobject.enterprise.soap.sforce.com" 
xmlns:ns2="urn:enterprise.soap.sforce.com">
    <SOAP-ENV:Header>
        <ns2:SessionHeader>
            
<ns2:sessionId>4aydyZqjp2YXN2fGup36jvv7qsUBPf1EGdfOuTmEB9web
rrmibaB27fvC6s7d750KvHtIWMbxsRqqcH9wSANKxhD2wYHcrlK4SNdGN37z
i4=</ns2:sessionId>
        </ns2:SessionHeader>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <ns2:create>
            <ns2:sObjects xsi:type="ns1:Contact">
                <ns1:Email>someone@example.com</ns1:Email>
                <ns1:FirstName>First</ns1:FirstName>
                <HomePhone xsi:nil="1" />
                <ns1:LastName>Last</ns1:LastName>
                <MailingCountry xsi:nil="1" />
            </ns2:sObjects>
        </ns2:create>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-08 14:26 UTC] sniper@php.net
Assigned to the maintainer.

 [2005-10-09 14:51 UTC] dmitry@php.net
Fixed in CVS HEAD, PHP_5_1 and PHP_5_0.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 16 22:02:05 2014 UTC