Description
Hi,
I'm trying to connect an application to the Dutch Chamber of Commerce (KvK) dataservice using python 3.7.3 and zeep==3.4.0
. This appears to be a bit of a pain.
The wsdl for this service is available via http://schemas.kvk.nl/contracts/kvk/dataservice/catalogus/2015/02/. No problems there yet.
wsa is added automatically, probably due to data found in the wsdl. The wsa
headers are added twice when I add the WsAddressingPlugin
via the plugins
parameter at initialization of the Client
instance. I'll try to add a reproducer later on.
There's a requirement in the docs saying the service is unable to process messages that contain a MessageID
which is prefixed by urn
. I think a lot of developers would be happier when the service would be able to process messages containing that prefix instead of documenting this issue, but that's out of my control. Here's an excerpt in Dutch, but I'm guessing that's not an issue for you ;)
LET OP: sommige IDE tooling zoals bijvoorbeeld Microsoft Visual Studio voegt “urn:” voor “uuid:”. De Handelsregister Dataservice controles zullen een request met deze syntax afwijzen!
(https://www.kvk.nl/sites/aansluitendataservice/index.html#/webservice-werkingsprincipes)
Is there a way to remove the urn
prefix from the MessageID
? Do I need to override the plugin somewhere?
Activity
bastbnl commentedon Jun 12, 2019
Reproducer for the double wsa headers for python 3:
Expected output:
Actual output:
bastbnl commentedon Jun 12, 2019
It gets a bit more confusing when you attempt to override via
_soapheaders
and use theplugins
. You'll end up with additional headers found in_soapheaders
.renevdkooi commentedon Aug 3, 2019
@bastbnl were you able to fix this at any point? I'm trying to connect to the same service, but I'm not even getting a response form the service.
bastbnl commentedon Aug 3, 2019
@renevdkooi I'm able to connect to the preprod environment and retrieve data, but not using zeep. Happy to discuss how I did it.
renevdkooi commentedon Aug 3, 2019
Would love to see how you did it or put me in the right direction. I tried with PHP, but got nothing working. So I tried moving to python and using this ZEEP, but don't seem to get any data.
Any way to contact you?
bastbnl commentedon Aug 3, 2019
Sure, contact me via bastbnl@pm.me. It'll take me some time to respond though.
zeyadmbk commentedon Mar 19, 2020
Hi @bastbnl I'm working on a project that involves KvK dataservices and I'm using PHP. Although I'm able to connect but I'm struggling to retrieve any data and I always get "Not Authorized". I was able to get the data using SoapUI but not with PHP. So, I was thinking to use another language like Python and after researching I stumbled upon this post. So I'm wondering how were you able to solve this.
renevdkooi commentedon Mar 19, 2020
I was actually able to get this to work under php. It was easier than I thought. You can use normal soap requests, but you need to play with the security.
zeyadmbk commentedon Mar 19, 2020
@renevdkooi Thanks a lot for your feedback. I agree I reached out to KvK support and they said it something has to do with security and message signing but they cannot see any issue with the SOAP XML. Unfortunately they cannot help further with PHP. I've been playing around for days with the security but without any success. Would it possible if you can share some code sample that worked for you?
bastbnl commentedon Mar 19, 2020
@zeyadmbk just letting you know I didn't use PHP, so I'm afraid I can't help with PHP code. I used the
requests
module to send the message because I was unable to find a way to provide the CSA using zeep.Make sure you're signing
Body
,To
,MessageID
,Action
andTimestamp
in the message you're sending. Also make sure you're usinghttp://www.w3.org/2005/08/addressing
and not a newer version.renevdkooi commentedon Mar 20, 2020
@zeyadmbk You can contact me at renevdkooi@hotmail.com
WSA plugin: allow custom prefix for MessageID.
Merinorus commentedon Dec 8, 2022
Hi,
I encountered the same problem. Will make a PR on this one! Feel free to review it.
WSA plugin: allow custom prefix for MessageID.
gk965 commentedon Mar 6, 2024
Hi, this was already a while ago but I am trying to test the KvK dataservice using Postman and running into the authorization issue. A couple people in this thread mentioned they managed to figure it out so is it possible for me to contact someone to get some help?