[mythtv] Backend Services V2
Stuart Auchterlonie
stuarta at squashedfrog.net
Mon Jun 21 08:42:40 UTC 2021
On 20/06/2021 20:56, Peter Bennett wrote:
> Hi Stuart
>
> I have converted one method of one service to the new server
> (Video/GetVideo)
>
> The old service on port 6544 has the following problems:
>
> 1. The wsdl is incomplete (missing definition of type castmember and
> type genre). After commenting those types in the output I can use the wsdl.
>
> 2. "Cast" never gets populated in the output (when it is not commented).
> The code to populate it seems not to have been done.
>
Those were obviously bugs
> The new service on port 6744 has the following problems:
>
> 1. No wsdl
There is a skeleton there, but it is known to incomplete.
Some work on the wsdl generator should resolve this for
all api endpoints
>
> 2. If you invoke with a POST it gives error 405. The old service on 6544
> works with a POST or a GET. The old service only rejects you if you use
> a GET when it wants a POST, not the other way around. I don't know what
> is the approved bahaviour, but I can confirm that I have on occasion
> used a POST when a GET was expected and my application worked fine. If
> this is no longer allowed some people may get an unpleasant surprise.
>
The general rule is things changing data should POST otherwise a GET
should be performed
The new code a section defines what methods are acceptable when.
An example of this is here
https://github.com/MythTV/mythtv/blob/devel/http/mythtv/programs/mythfrontend/services/mythfrontendservice.h#L48
> 3. You can call the service using call syntax as follows:
> http://rocinante:6744/Video/GetVideo?Id=9 and it gives a good result.
> However it does not accept SOAP syntax, for example this works on port
> 6544 and gives expected results but on port 6744 it gives error 405:
>
> POST http://rocinante:6744/Video HTTP/1.1
> Accept-Encoding: gzip,deflate
> Content-Type: text/xml;charset=UTF-8
> SOAPAction: "http://mythtv.org/Video/GetVideo"
> Content-Length: 281
> Host: rocinante:6744
> Connection: Keep-Alive
> User-Agent: Apache-HttpClient/4.5.5 (Java/11.0.11)
>
>
> <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:myt="http://mythtv.org">
> <soapenv:Header/>
> <soapenv:Body>
> <myt:GetVideo>
> <!--Optional:-->
> <myt:Id>9</myt:Id>
> </myt:GetVideo>
> </soapenv:Body>
> </soapenv:Envelope>
Support for this clearly needs adding.
>
> I tried commenting out the code that checks for GET (which is creating
> the 405 error), and I then get a 404 error instead of the 405. It seems
> that SOAP request support has not been provided.
>
You will have to add POST to methods which you expect to accept it.
See the example linked above on how to do it.
Regards
Stuart
> Peter.
>
>
More information about the mythtv-dev
mailing list