WsdlToPhp / PackageGenerator

Generates a PHP SDK based on a WSDL, simple and powerful, WSDL to PHP
https://providr.io
MIT License
426 stars 73 forks source link

Package Generation fails for Ebay Finding WSDL #222

Closed lewislarsen closed 3 years ago

lewislarsen commented 4 years ago

I am attempting to generate the classes for Ebay's Finding Service API for a project of mine, however, I am encountering a couple of errors when attempting to do so. I am relatively unfamiliar with SOAP and I was wondering whether you would be able to shed any light on the errors I'm encountering?

The first error seems rather generic and it doesn't really point to any solutions. The .wsdl file is from eBay itself so I would have thought it would've worked with no issues.

Command:

$ wsdltophp generate:package \
    --urlorpath="http://developer.ebay.com/webservices/finding/latest/FindingService.wsdl" \
    --destination="./ebay" \
    --namespace="App\Libraries\Ebay" \
    --composer-name="myproject/mysdk" \
    --force

Errors:

In GeneratorSoapClient.php line 33:
Unable to load WSDL at "http://developer.ebay.com/webservices/finding/latest/FindingService.wsdl"!                                                      

In AbstractSoapClientBase.php line 82:
SOAP-ERROR: Parsing WSDL: Missing <portType>/<operation> with name 'findItemsByImage'                                                                                                                                          

I appreciate any help you are able to provide! Lewis

mikaelcom commented 4 years ago

This seems to be sadly an error from eBay, look to this analyzer result: http://www.wsdl-analyzer.com/service/service/1050506279?version=1, sorry...

If you find what has to be fixed to be loaded correctly, I recommend to download the WSDL locally, fix the WSDL locally and use it to generate the package and later to send the request. It should then work as it will still send the request to the eBay Soap Server.

lewislarsen commented 4 years ago

I believe I've solved it!

Added the following lines to the <wsdl:portType name="FindingServicePortType"> structure.

        <wsdl:operation name="findItemsByImage">
            <wsdl:input message="tns:findItemsByImageRequest"/>
            <wsdl:output message="tns:findItemsByImageResponse"/>
        </wsdl:operation>
        <wsdl:operation name="findItemsForFavoriteSearch">
            <wsdl:input message="tns:findItemsForFavoriteSearchRequest"/>
            <wsdl:output message="tns:findItemsForFavoriteSearchResponse"/>
        </wsdl:operation>
mikaelcom commented 4 years ago

:clap: