Ich baue eine Integration von OPSI in unser selbstgebautes Ticketsystem. Dafür muss ich RPC-Commands an OPSI senden. So weit, so gut.
Das Ticketsystem basiert auf PHP, da kommt die php-json-rpc-http library recht gelegen - Wenn es denn funktionieren würde.
Ich habe immer wieder einen "Bad Request"-Fehler von OPSI erhalten, bis ich drauf gekommen bin:
Hier zunächst mal die Spezifikation für JSON-RPC 2.0
Version 1.0 sagt dazu ebenfalls nurid
An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]
The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.
[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.
[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions.
id - The request id. This can be of any type. It is used to match the response with the request that it is replying to.
Meiner Ansicht nach, dürfte dieses Verhalten daher ein Bug sein:
Sende ich einen Request mit der id 0, erhalte ich einen Bad Request Fehler. Mit id 1 klappt das.
Anders gesagt: Ich musste die Library jetzt patchen, damit sie mir OPSI zusammen funktioniert.
Wäre schön, wenn das auf OPSI-Seite korrigiert würde
Sorry, falls ich komplett daneben liege...