christoph-schaeffer / dhl-business-shipping

An unofficial library for the DHL business shipping soap API (Version 3.3) and the dhl shipment tracking rest API written in PHP.
MIT License
29 stars 8 forks source link

Problem to track multiple packages in production mode - single one works #29

Open Flaschenzug opened 1 year ago

Flaschenzug commented 1 year ago

Still working on the tracking, but another problem - so I thought it might be better to open a new issu.

I try to check more than one tracking ID at the same time (see the request at the end of this post) If I only track one ID, it works.

[pieceStatus] => -1000 [pieceStatusDesc] => Ein technischer Fehler ist aufgetreten! Bitte kontaktieren Sie den Support!

Another problem or something that I am missing? I know that in sandbox mode only one package is possible, but I am in production mode.

print_r($pieces); -> 
Array
(
    [0] => ChristophSchaeffer\Dhl\BusinessShipping\Resource\Tracking\PieceData Object
        (
            [pieceCode] => 00340434492098429236
            [zipCode] => 
            [internationalShipment] => 
        )

    [1] => ChristophSchaeffer\Dhl\BusinessShipping\Resource\Tracking\PieceData Object
        (
            [pieceCode] => 00340434492098429229
            [zipCode] => 
            [internationalShipment] => 
        )

    [2] => ChristophSchaeffer\Dhl\BusinessShipping\Resource\Tracking\PieceData Object
        (
            [pieceCode] => 00340434492098429205
            [zipCode] => 
            [internationalShipment] => 
        )
)
christoph-schaeffer commented 1 year ago

I haven't really tested checking multiple shipment numbers, but i think this should work... have you tried looking at the xml again? does it look weird or different than what you see in the dhl api doku?

You could try to open a ticket at entwickler.dhl.de again as the error message says

the dhl documentation also says that its possible to check multiple shipments with getPieceDetail. You just have to put them in the same field as the single one and seperate them with a semicolon.

But my lib doesn't support that yet and expects only a single shipment. For now im not really planning to implement that aswell, however im definetly open for pull requests for that feature

Flaschenzug commented 1 year ago

[rawRequest] => <?xml version="1.0" encoding="UTF-8"?><data request="get-status-for-public-user" appname="REMOVED" password="REMOVED" language-code="de"><data piece-code="00340434492098429243"></data><data piece-code="00340434492098429236"></data></data>

You could try to open a ticket at entwickler.dhl.de again as the error message says

I will do that.

Flaschenzug commented 1 year ago

DHL Support told me, that it is working like this:

<?xml version="1.0" encoding="UTF-8" ?><data appname="zt*****" password=***********" request="get-status-for-public-user" language-code="de"><data piece-code="358944658984;00340434299870737684" international-shipment="false"></data></data>

That would be like you wrote, id's separated with a semicolon.

christoph-schaeffer commented 1 year ago

Allright. I guess the implementation i did in the lib is wrong for that then. Does it work if you just seperate it with semicolons?

Flaschenzug commented 1 year ago

Sorry, I wasn't able to modify the code, so that it returns the rawRequest in only one tag with the semicolons. If you let me know how i can modify that, I am glad to test it for you.