todvora / eet-client

Client and library for #EET communication - http://www.etrzby.cz/ , written in Java
MIT License
47 stars 26 forks source link

WS-Policy missing in the new version of wsdl #1

Closed Pavithra0705 closed 8 years ago

Pavithra0705 commented 8 years ago

The new wsdl under v3.0 does not have the WS-Policy as a part of its Source. I used to set the Signature and Digest Algorithm based on the policy described in the WSDL file (EETServiceSOAP). Now when i manually copy paste the policy from V2 it doesnot work. The Signature algorithm seem to be SHA1 rather than the required SHA256. Could you let me know if i am missing something? EETServiceSOAP_v3.zip

todvora commented 8 years ago

Hi @Pavithra0705, You are right, the ws-policy is missing in the WSDL v3 indeed. I've already asked why is that and here is the official answer (in Czech):

sekci WS-SecurityPolicy jsme z WSDL služby odstranili na základě negativních zkušeností některých vývojářů s použitím tohoto standardu v jejich vývojových nástrojích. Zralost a stabilita tohoto standardu se ukázala být slabší, než v případě dalších použitých standardů. WS-SecurityPolicy navíc nebylo dostatečně modernizováno a stále vynucuje RSA-SHA1 pro vlastní digitální podpis, což je nekompatibilní s požadavky popisu datového rozhraní.

Proto jsme se rozhodli nahradit použití WS-SecurityPolicy popisem požadovaných parametrů WS-Security v textu dokumentu „Formát a struktura údajů o evidované tržbě a popis datového rozhraní pro příjem datových zpráv evidovaných tržeb“.

The ws-policy has been removed intentionally, because some developers had problems with it and the standard itself seems not to be modern enough, forcing SHA1 instead of SHA256, for example.

You are basically as an implementer on your own in this matter. You have to provide all those security details yourself (they are provided in the official documentation - CZ / EN). I'm doing in in this way: https://github.com/todvora/eet-client/blob/bdff099b36a13574b03114d293d9ebc8c19bf596/src/main/java/cz/tomasdvorak/eet/client/security/SecureEETCommunication.java#L161

Let me know, if it works for you.

Regards, Tomas