davidtsadler / ebay-sdk-php

An eBay SDK for PHP. Use the eBay API in your PHP projects.
Apache License 2.0
350 stars 346 forks source link

uploadSiteHostedPictures fails with XML Parse error #231

Closed ZielinskiLukasz closed 4 years ago

ZielinskiLukasz commented 6 years ago

I'm getting the following error when trying to upload an external image url to the ebay's server using uploadSiteHostedPictures from the trading service.

[ShortMessage] => XML Parse error. 
[LongMessage] => XML Error Text: "{0}". 
[date] => 2018-10-03 08:22:41.621000 
[timezone_type] => 2 

This is a serious problem because I cannot upload ANY images to eBay.

Here's the request sent using the latest version of SDK:

DTS\eBaySDK\Trading\Types\UploadSiteHostedPicturesRequestType Object ( [values:DTS\eBaySDK\Types\BaseType:private] => Array ( [RequesterCredentials] => DTS\eBaySDK\Trading\Types\CustomSecurityHeaderType Object ( [values:DTS\eBaySDK\Types\BaseType:private] => Array ( [eBayAuthToken] => <cut> ) [attachment:DTS\eBaySDK\Types\BaseType:private] => Array ( [data] => [mimeType] => ) ) [PictureSet] => Supersize [PictureName] => Picture [ExternalPictureURL] => DTS\eBaySDK\Types\RepeatableType Object ( [data:DTS\eBaySDK\Types\RepeatableType:private] => Array ( [0] => <URL>

                        )

                    [position:DTS\eBaySDK\Types\RepeatableType:private] =&gt; 0
                    [class:DTS\eBaySDK\Types\RepeatableType:private] =&gt; DTS\eBaySDK\Trading\Types\UploadSiteHostedPicturesRequestType
                    [property:DTS\eBaySDK\Types\RepeatableType:private] =&gt; ExternalPictureURL
                    [expectedType:DTS\eBaySDK\Types\RepeatableType:private] =&gt; string
                )

        )

    [attachment:DTS\eBaySDK\Types\BaseType:private] =&gt; Array
        (
            [data] =&gt; 
            [mimeType] =&gt; 
        )

)
michabbb commented 6 years ago

maybe this helps (searching for existing issues helps, too)

ZielinskiLukasz commented 6 years ago

Thanks, but it didn't help. Plus, that thread refers to older version is SDK.= and I'm reporting a problem in the current one. (sorry about a duplicate anyway)

michabbb commented 6 years ago

without testing: i believe this upload problem is "still" there, in older and new versions 🤔

Tizianoz93 commented 5 years ago

I've just create a new PR #252 that fixes this issue. Try to delete the double quotes in file as I wrote in #252

ZielinskiLukasz commented 5 years ago

@Tizianoz93: thank you but in my case it was was a problem with detecting that the request has an attachment. Changing quotes around boundary does not help.