Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Ticket #189 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

WSDLLiteralRegistry wrongly decodes empty string and nil to Mapping::Object

Reported by: nahi Assigned to: nahi
Priority: highest Milestone: 1.5.6
Component: wsdl4r Version: 1.5
Keywords: Cc:

Description (Last modified by nahi)

Thanks to James.

OK now I am fairly certain I have found a bug-  when the response
contains an empty string of type xsi:type="xs:string" it does not
return an empty string "" in the soap object.  See the PayerBusiness
and Street2 elements, and compare to above:

Wiredump:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:cc="urn:ebay:apis:CoreComponentTypes"
xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility"
xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"
xmlns:ebl="urn:ebay:apis:eBLBaseComponents"
xmlns:ns="urn:ebay:api:PayPalAPI">
<SOAP-ENV:Header>
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext"
xsi:type="wsse:SecurityType">
</Security>
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI"
xsi:type="ebl:CustomSecurityHeaderType">
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents"
xsi:type="ebl:UserIdPasswordType">
<Username xsi:type="xs:string"></Username>
<Password xsi:type="xs:string"></Password>
<Subject xsi:type="xs:string"></Subject>
</Credentials></RequesterCredentials>
</SOAP-ENV:Header>
<SOAP-ENV:Body id="_0">
<GetExpressCheckoutDetailsResponse xmlns="urn:ebay:api:PayPalAPI">
<Timestamp
xmlns="urn:ebay:apis:eBLBaseComponents">2005-12-01T21:14:05Z</Timestamp>
<Ack xmlns="urn:ebay:apis:eBLBaseComponents">Success</Ack>
<CorrelationID
xmlns="urn:ebay:apis:eBLBaseComponents">2d37c81c4a88a</CorrelationID>
<Version xmlns="urn:ebay:apis:eBLBaseComponents">2.000000</Version>
<Build xmlns="urn:ebay:apis:eBLBaseComponents">1.0006</Build>
<GetExpressCheckoutDetailsResponseDetails
xmlns="urn:ebay:apis:eBLBaseComponents"
xsi:type="ebl:GetExpressCheckoutDetailsResponseDetailsType">
	<Token
xsi:type="ebl:ExpressCheckoutTokenType">EC-7FS78690BK099664M</Token>
	<PayerInfo xsi:type="ebl:PayerInfoType">
		<Payer xsi:type="ebl:EmailAddressType">j_s_connell@yahoo.com</Payer>
		<PayerID xsi:type="ebl:UserIDType">WBMSJH384KUFN</PayerID>
		<PayerStatus
xsi:type="ebl:PayPalUserStatusCodeType">unverified</PayerStatus>
		<PayerName xsi:type="ebl:PersonNameType">
			<FirstName xmlns="urn:ebay:apis:eBLBaseComponents">James</FirstName>
			<LastName xmlns="urn:ebay:apis:eBLBaseComponents">Connell</LastName>
		</PayerName>
		<PayerBusiness xsi:type="xs:string"></PayerBusiness>
		<Address xsi:type="ebl:AddressType">
			<Name xsi:type="xs:string">James Connell</Name>
			<Street1 xsi:type="xs:string">1234 Snowbank Ct.</Street1>
			<Street2 xsi:type="xs:string"></Street2>
			<CityName xsi:type="xs:string">San Jose</CityName>
			<StateOrProvince xsi:type="xs:string">CA</StateOrProvince>
			<Country xsi:type="ebl:CountryCodeType">US</Country>
			<CountryName>United States</CountryName>
			<PostalCode xsi:type="xs:string">95123</PostalCode>
			<AddressOwner
xsi:type="ebl:AddressOwnerCodeType">PayPal</AddressOwner>
			<AddressStatus
xsi:type="ebl:AddressStatusCodeType">Unconfirmed</AddressStatus>
		</Address>
		</PayerInfo>
	<InvoiceID xsi:type="xs:string">351</InvoiceID>
</GetExpressCheckoutDetailsResponseDetails>
</GetExpressCheckoutDetailsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Change History

12/04/05 23:09:30 changed by Rup

I confirm this : I found the same thing with the salesforce.com WSDL.

02/05/06 22:00:30 changed by nahi

(from #190)

I thought that 1679 fixed this, but it is not the case.

Here is the wiredump

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <retrieveResponse xmlns="urn:partner.soap.sforce.com">
   <result xsi:type="sf:sObject" xmlns:sf="urn:sobject.partner.soap.sforce.com">
    <sf:type>Account</sf:type>
    <sf:Id>001300000021QoGAAU</sf:Id>
    <sf:Id>001300000021QoGAAU</sf:Id>
    <sf:Name>Burlington Textiles Corp of America</sf:Name>
    <sf:Site xsi:nil="true"/>                                                                     <== PROBLEM IS HERE *****
    <sf:Phone>(336) 222-7000</sf:Phone>
    <sf:Fax>(336) 222-8000</sf:Fax>
    <sf:BillingCity>Burlington</sf:BillingCity>
    <sf:BillingCountry>USA</sf:BillingCountry>
    <sf:BillingPostalCode>27215</sf:BillingPostalCode>
    <sf:BillingStreet>525 S. Lexington Ave</sf:BillingStreet>
   </result>
  </retrieveResponse>
 </soapenv:Body>
</soapenv:Envelope>

where (cf. partner.xsdl.xml) :
            <element name="retrieveResponse">
                <complexType>
                    <sequence>
                        <element name="result" type="ens:sObject" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                    </sequence>
                </complexType>
            </element>

and

            <complexType name="sObject">
                <sequence>
                    <element name="type"               type="xsd:string"/>
                    <element name="fieldsToNull"       type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                    <element name="Id"                 type="tns:ID" nillable="true" />
                    <any namespace="##targetNamespace" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
                </sequence>
            </complexType>

It seems that 'processContents="lax"' is not used to change the behaviour of wsdl4r : am I right ?

Rup

04/21/06 03:00:22 changed by c3

Any update or workaround to this?

10/03/06 23:45:53 changed by nahi

  • description changed.

10/04/06 11:24:57 changed by nahi

  • status changed from new to closed.
  • resolution set to fixed.

[1735] fixed it.

04/29/07 23:35:02 changed by nahi

  • status changed from closed to reopened.
  • resolution deleted.

from soap4r-ml.

I see that <a href="http://dev.ctor.org/soap4r/ticket/189">Ticket
#189</a> is reported as fixed, but I just downloaded trunk from svn and
it deosnt appear to be doing the trick for empty strings.  Is it
because I dont have the nil="true" in the response?  I'm using php_soap
for the server end.

here's dump and mapped object...

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://www.luminapower.com/dba/">
<SOAP-ENV:Body>
<ns1:getPartInfoResponse>
<description>PCB LDD-1500 Main</description>
<description2>Rev 4</description2>
<part_type>0</part_type>
<part_class>MAT</part_class>
<reorder_level>0</reorder_level>
<reorder_amount>50</reorder_amount>
<last_cost>27</last_cost>
<average_cost>27</average_cost>
<lead_time>21</lead_time>
<revision></revision>
<mrp>Y</mrp>
<spec1></spec1>
<spec2></spec2>
<spec3></spec3>
<vendor1></vendor1>
<vendor2></vendor2>
<vendor3></vendor3>
<material_cost>27</material_cost>
<total_standard_cost>27</total_standard_cost>
</ns1:getPartInfoResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

=> #<SOAP::Mapping::Object:0x1c6f2e0
	{}description="PCB LDD-1500 Main"
	{}description2="Rev 4"
	{}part_type="0"
	{}part_class="MAT"
	{}reorder_level="0"
	{}reorder_amount="50"
	{}last_cost="27"
	{}average_cost="27"
	{}lead_time="21"
	{}revision=#<SOAP::Mapping::Object:0x1c68cd8>
	{}mrp="Y"
	{}spec1=#<SOAP::Mapping::Object:0x1c68008>
	{}spec2=#<SOAP::Mapping::Object:0x1c67b6c>
	{}spec3=#<SOAP::Mapping::Object:0x1c6775c>
	{}vendor1=#<SOAP::Mapping::Object:0x1c66f1e>
	{}vendor2=#<SOAP::Mapping::Object:0x1c66564>
	{}vendor3=#<SOAP::Mapping::Object:0x1c6612c>
	{}material_cost="27"
	{}total_standard_cost="27">

from soap4r-ml.

I have the tarball dated 10-22-2006 and am also still having problems
with the CommissionJunction service. The empty UPC fields are returning
SOAP::Mapping::Objects.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body><searchResponse
xmlns="http://DefaultNamespace"><searchReturn
xsi:type="ns1:ProductSearchResponse"
xmlns:ns1="http://product.service.cj.com">
<count xsi:type="xsd:int">10</count><offset
xsi:type="xsd:int">0</offset>
<products>
<products xsi:type="ns1:ProductData">
<advertiserId xsi:type="xsd:int">1442983</advertiserId>
<advertiserName xsi:type="xsd:string">eMusic.com</advertiserName>
<clickUrl
xsi:type="xsd:string">http://www.kqzyfj.com/click-2215333-10364977?url=http%3A%2F%2Fwww.emusic.com%2Fartist%2F11561%2F11561748.html</clickUrl>
<currency xsi:type="xsd:string">USD</currency>
<description xsi:type="xsd:string">Stroller</description>
<imageUrl xsi:type="xsd:string"></imageUrl>
<name xsi:type="xsd:string">Stroller</name>
<price xsi:type="xsd:double">0.0</price>
<sku xsi:type="xsd:string">11561748</sku>
<upc xsi:type="xsd:string"></upc>
</products>
<products xsi:type="ns1:ProductData">
<advertiserId xsi:type="xsd:int">1566996</advertiserId>
<advertiserName xsi:type="xsd:string">Buy.com USA and Buy.com
CA</advertiserName>
<clickUrl
xsi:type="xsd:string">http://www.tkqlhce.com/click-2215333-10387781?url=http%3A%2F%2Fwww.buy.com%2Fretail%2FProduct.asp%3Fsku%3D203015621%26SearchEngine%3DCJaffiliate%26Type%3DCJ%26Keyword%3D203015621%26Category%3DMusicDownloads</clickUrl>
<currency xsi:type="xsd:string">USD</currency>
<description xsi:type="xsd:string">Walk with Stroller</description>
<imageUrl
xsi:type="xsd:string">http://ak.buy.com/db_assets/prod_images/607/203015607.jpg</imageUrl>
<name xsi:type="xsd:string">Walk with Stroller</name>
<price xsi:type="xsd:double">0.89</price>
<sku xsi:type="xsd:string">203015621</sku>
<upc xsi:type="xsd:string">00616892828327</upc>
</products>
<products xsi:type="ns1:ProductData">
<advertiserId xsi:type="xsd:int">1566996</advertiserId>
<advertiserName xsi:type="xsd:string">Buy.com USA and Buy.com
CA</advertiserName>
<clickUrl
xsi:type="xsd:string">http://www.kqzyfj.com/click-2215333-10387778?url=http%3A%2F%2Fwww.buy.com%2Fretail%2FProduct.asp%3Fsku%3D202703353%26SearchEngine%3DCJaffiliate%26Type%3DCJ%26Keyword%3D202703353%26Category%3DToy</clickUrl>
<currency xsi:type="xsd:string">USD</currency>
<description xsi:type="xsd:string">Forerunner Stroller</description>
<imageUrl
xsi:type="xsd:string">http://ak.buy.com/db_assets/prod_images/353/202703353.jpg</imageUrl>
<name xsi:type="xsd:string">Forerunner Stroller</name>
<price xsi:type="xsd:double">169.99</price>
<sku xsi:type="xsd:string">202703353</sku>
<upc xsi:type="xsd:string">00652182052157</upc>
</products><products xsi:type="ns1:ProductData">
<advertiserId xsi:type="xsd:int">15058</advertiserId>
<advertiserName xsi:type="xsd:string">Commission Junction
Demo</advertiserName>
<clickUrl
xsi:type="xsd:string">http://www.jdoqocy.com/click-2215333-10375057?url=http%3A%2F%2Fwww.littlewoods-online.com%2Frf%2Fnavigation%2Fentersite.do%3FredirectTo%3Dsearch%26searchtext%3DUA004L%26aff%3Dcj%26affsrc%3Dd_data</clickUrl>
<currency xsi:type="xsd:string">USD</currency>
<description xsi:type="xsd:string">This chic stroller comes in handy
whenever you want to go shopping. Height adjustable grip handles (not
suitable for carrying children). Age from 3
years.</description><imageUrl
xsi:type="xsd:string">http://www.littlewoods-online.com/images/products/thumbnail/ua/ua004v29t.jpg</imageUrl>
<name xsi:type="xsd:string">stroller</name>
<price xsi:type="xsd:double">20.0</price>
<sku xsi:type="xsd:string">UA004N</sku>
<upc xsi:type="xsd:string"></upc>
</products>
<products xsi:type="ns1:ProductData"><advertiserId
xsi:type="xsd:int">1427466</advertiserId><advertiserName
xsi:type="xsd:string">Maryland Square</advertiserName><clickUrl
xsi:type="xsd:string">http://www.jdoqocy.com/click-2215333-10361686?url=http%3A%2F%2Fwww.marylandsquare.com%2Fredirect.asp%3Fpage%3D4%26tcode%3DMQKB999%26family_id%3D6272%26tcpriority%3D1</clickUrl><currency
xsi:type="xsd:string">USD</currency><description
xsi:type="xsd:string">STROLLER FROM TOE WARMERS Sturdy Commander fabric
uppers shrug off water and wind. Milano linings and RADIANTEX sock
linings reflect heat and wick moisture. Rubber-like outsoles are
1-1/4&quot; at the heels. Made in Canada.</description><imageUrl
xsi:type="xsd:string">http://www.marylandsquare.com/assets/product_images/QB0533744L.jpg</imageUrl><name
xsi:type="xsd:string">STROLLER</name><price
xsi:type="xsd:double">74.95</price><sku
xsi:type="xsd:string">33744</sku><upc
xsi:type="xsd:string"></upc></products><products
xsi:type="ns1:ProductData"><advertiserId
xsi:type="xsd:int">1427466</advertiserId><advertiserName
xsi:type="xsd:string">Maryland Square</advertiserName><clickUrl
xsi:type="xsd:string">http://www.tkqlhce.com/click-2215333-10361686?url=http%3A%2F%2Fwww.marylandsquare.com%2Fredirect.asp%3Fpage%3D4%26tcode%3DMQKB999%26family_id%3D6272%26tcpriority%3D1</clickUrl><currency
xsi:type="xsd:string">USD</currency><description
xsi:type="xsd:string">STROLLER FROM TOE WARMERS Sturdy Commander fabric
uppers shrug off water and wind. Milano linings and RADIANTEX sock
linings reflect heat and wick moisture. Rubber-like outsoles are
1-1/4&quot; at the heels. Made in Canada.</description><imageUrl
xsi:type="xsd:string">http://www.marylandsquare.com/assets/product_images/QB0533744L.jpg</imageUrl><name
xsi:type="xsd:string">STROLLER</name><price
xsi:type="xsd:double">69.95</price><sku
xsi:type="xsd:string">33750</sku><upc
xsi:type="xsd:string"></upc></products><products
xsi:type="ns1:ProductData"><advertiserId
xsi:type="xsd:int">1427466</advertiserId><advertiserName
xsi:type="xsd:string">Maryland Square</advertiserName><clickUrl
xsi:type="xsd:string">http://www.jdoqocy.com/click-2215333-10361686?url=http%3A%2F%2Fwww.marylandsquare.com%2Fredirect.asp%3Fpage%3D4%26tcode%3DMQKB999%26family_id%3D6272%26tcpriority%3D1</clickUrl><currency
xsi:type="xsd:string">USD</currency><description
xsi:type="xsd:string">STROLLER FROM TOE WARMERS Sturdy Commander fabric
uppers shrug off water and wind. Milano linings and RADIANTEX sock
linings reflect heat and wick moisture. Rubber-like outsoles are
1-1/4&quot; at the heels. Made in Canada.</description><imageUrl
xsi:type="xsd:string">http://www.marylandsquare.com/assets/product_images/QB0533744L.jpg</imageUrl><name
xsi:type="xsd:string">STROLLER</name><price
xsi:type="xsd:double">69.95</price><sku
xsi:type="xsd:string">33745</sku><upc
xsi:type="xsd:string"></upc></products><products
xsi:type="ns1:ProductData"><advertiserId
xsi:type="xsd:int">1427466</advertiserId><advertiserName
xsi:type="xsd:string">Maryland Square</advertiserName><clickUrl
xsi:type="xsd:string">http://www.kqzyfj.com/click-2215333-10361686?url=http%3A%2F%2Fwww.marylandsquare.com%2Fredirect.asp%3Fpage%3D4%26tcode%3DMQKB999%26family_id%3D6272%26tcpriority%3D1</clickUrl><currency
xsi:type="xsd:string">USD</currency><description
xsi:type="xsd:string">STROLLER FROM TOE WARMERS Sturdy Commander fabric
uppers shrug off water and wind. Milano linings and RADIANTEX sock
linings reflect heat and wick moisture. Rubber-like outsoles are
1-1/4&quot; at the heels. Made in Canada.</description><imageUrl
xsi:type="xsd:string">http://www.marylandsquare.com/assets/product_images/QB0533744L.jpg</imageUrl><name
xsi:type="xsd:string">STROLLER</name><price
xsi:type="xsd:double">69.95</price><sku
xsi:type="xsd:string">33748</sku><upc
xsi:type="xsd:string"></upc></products><products
xsi:type="ns1:ProductData"><advertiserId
xsi:type="xsd:int">1566996</advertiserId><advertiserName
xsi:type="xsd:string">Buy.com USA and Buy.com
CA</advertiserName><clickUrl
xsi:type="xsd:string">http://www.tkqlhce.com/click-2215333-10387781?url=http%3A%2F%2Fwww.buy.com%2Fretail%2FProduct.asp%3Fsku%3D201894135%26SearchEngine%3DCJaffiliate%26Type%3DCJ%26Keyword%3D201894135%26Category%3DMusicDownloads</clickUrl><currency
xsi:type="xsd:string">USD</currency><description
xsi:type="xsd:string">Caged Heat (Stroller
Version)</description><imageUrl
xsi:type="xsd:string">http://ak.buy.com/db_assets/prod_images/119/201894119.jpg</imageUrl><name
xsi:type="xsd:strin^M
483^M
g">Caged Heat (Stroller Version)</name><price
xsi:type="xsd:double">0.89</price><sku
xsi:type="xsd:string">201894135</sku><upc
xsi:type="xsd:string">00670917074229</upc></products><products
xsi:type="ns1:ProductData"><advertiserId
xsi:type="xsd:int">1566996</advertiserId><advertiserName
xsi:type="xsd:string">Buy.com USA and Buy.com
CA</advertiserName><clickUrl
xsi:type="xsd:string">http://www.anrdoezrs.net/click-2215333-10387780?url=http%3A%2F%2Fwww.buy.com%2Fretail%2FProduct.asp%3Fsku%3D203368518%26SearchEngine%3DCJaffiliate%26Type%3DCJ%26Keyword%3D203368518%26Category%3DSport</clickUrl><currency
xsi:type="xsd:string">USD</currency><description
xsi:type="xsd:string">InSTEP Ultra Runner
Stroller</description><imageUrl
xsi:type="xsd:string">http://ak.buy.com/db_assets/prod_images/518/203368518.jpg</imageUrl><name
xsi:type="xsd:string">InSTEP Ultra Runner Stroller</name><price
xsi:type="xsd:double">159.99</price><sku
xsi:type="xsd:string">203368518</sku><upc
xsi:type="xsd:string">00038675019119</upc></products></products><totalPossible
xsi:type="xsd:int">1519</totalPossible></searchReturn></searchResponse></soapenv:Body></soapenv:Envelope>

05/02/07 23:32:25 changed by nahi

  • component changed from soap4r to wsdl4r.

05/02/07 23:45:00 changed by nahi

I'm very sorry. I confused 'empty' with 'nil'. returning nil works now but empty string doesn't. I'll fix it.

05/03/07 01:01:02 changed by nahi

  • status changed from reopened to closed.
  • resolution set to fixed.

I was wrong.

According to getPartInfoResponse report, getting nil or empty object depends on the service definition. It can be a bug but I cannot look into it without more details. Please file a new ticket.

According to CommissionJunction? report, the result depends on the service that client use is rpc-encoded or doc-literal. (CommissionJunction? service seems to have both service). Please file a new ticket with more details.

Sorry for your confusion.