Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SECURITY_VIOLATION in production mode #11

Closed
Magellanth opened this issue Jul 26, 2021 · 4 comments
Closed

SECURITY_VIOLATION in production mode #11

Magellanth opened this issue Jul 26, 2021 · 4 comments

Comments

@Magellanth
Copy link

Magellanth commented Jul 26, 2021

Hi,

i tested this library over the last weeks in sandbox mode and everything worked fine, now i tried to switch to production mode and i get an Exception with "SECURITY_VIOLATION" on any soap call.

The login, appID and apiToken i am using is in productive use with another library (petschko) which is using DHL GKV API 2.2 and there it works fine. The Login also works manually on the GKV website and the password is valid for another month. The application is approved and in production for years.

I reduced my test script to:

use ChristophSchaeffer\Dhl\BusinessShipping\Client;

$client = new Client(
    'myAppID',
    'myAppToken',
    'myGkvUsername',
    'myGkvPassword',
    false
);

$request = new \ChristophSchaeffer\Dhl\BusinessShipping\Request\getVersion();
$response = $client->getVersion($request);

The Exception is:

_Uncaught SoapFault exception: [soap:Client] SECURITY_VIOLATION in /.../vendor/christoph-schaeffer/dhl-business-shipping/src/Soap.php:54

Stack trace:

#0 /.../vendor/christoph-schaeffer/dhl-business-shipping/src/Soap.php(54): SoapClient->_call('getVersion', Array)

Am i missing anything here? Is it possible to see the raw request xml when an exception occurs before i get a response?

@christoph-schaeffer
Copy link
Owner

Hello @Magellanth,

first thanks for using the library :-)

You can access the raw request xml on the response object. I'm using the php soap extension and couldn't figure out how to get the xml before sending something, thats why it's in the response object. However this should work in your case either way.

echo $response->rawRequest; // this is the raw xml which has been sent to DHL as a string
echo $response->rawResponse; // this is the raw response which the DHL API returned as an object.

However i think i know what is causing your issue, because i had the same issue as well.

TLDR: You need to contact the DHL "Entwicklerportal" support and tell them to enable your developer account for version 3.1

Long Version:
DHL has an authentication process in their api which locks/unlocks specific versions. I guess this is the case because they plan to deprecate version 2.0 and don't want new users to be able to use that version. For some weird reason this authentication isn't used for the sandbox mode.

The funny part is this happend to me with a brend new account when 3.0 was out... I think it's the same for you.

I contacted their support on the "Entwicklerportal" unfortunaly you can only contact them by opening a ticket. However i highly recommend that you just tell them, that you think your developer account is not unlocked for version 3.1 and leave them your phone number and your usual business hours when you can be called.

They will most likely walk you through setting up soap ui with their test suite to make sure that it is not your implementation that is not working. Which you could actually do by yourself now, too if you want to make sure that i'm correct :-)

Go to https://entwickler.dhl.de/group/ep/testsuite8 their you can find instructions how to get it to work.

For me the issue persisted even in soapUI which made it clear that it was not the implementation but rather an authentication issue.

@christoph-schaeffer christoph-schaeffer pinned this issue Jul 26, 2021
@Magellanth
Copy link
Author

Thank you, i am going to test it with SoapUI and then contact the Support.

@Magellanth
Copy link
Author

Support already responded, they activated 3.x Support - now everything works as expected.

Nice work DHL not communicating this limitation...

@christoph-schaeffer
Copy link
Owner

glad to hear that :-)

Yes, i would prefer to get an error like "your account is not activated for version 3.X" or something similar...

I'm closing the issue since your issue seems to be resolved. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants