Mailing List Archive

Conversion of Service API
I have updated the wiki page with instructions on converting services

https://www.mythtv.org/wiki/Services_API_V2_Conversion

If I have anything wrong or left out anything please feel free to update
it or let me know.

Peter

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Conversion of Service API [ In reply to ]
On 6/28/21 8:39 AM, Peter Bennett wrote:
> I have updated the wiki page with instructions on converting services
>
> https://www.mythtv.org/wiki/Services_API_V2_Conversion
>
> If I have anything wrong or left out anything please feel free to update it or let me know.
>
> Peter
>

Thanks! Especially noted: Q_CLASSINFO("GetSavedBookmark", "name=long").

Solved 10 Myth service endpoints that currently return Strings or StringLists.



Any opinions on the following difference?

$ api2 --endpoint Myth/GetHostName
...
********** Myth/GetHostName want's XML response from Original API:

<String>ofc0</String>

********** Myth/GetHostName want's XML response from V2 API:

<String xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" serializerVersion="1.1">ofc0</String>

--
Bill
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Conversion of Service API [ In reply to ]
On Mon, 2021-06-28 at 10:10 -0500, Bill Meek wrote:
> On 6/28/21 8:39 AM, Peter Bennett wrote:
> > I have updated the wiki page with instructions on converting
> > services
> >
> > https://www.mythtv.org/wiki/Services_API_V2_Conversion
> >
> > If I have anything wrong or left out anything please feel free to
> > update it or let me know.
> >
> > Peter
> >
>
> Thanks! Especially noted: Q_CLASSINFO("GetSavedBookmark", 
> "name=long").
>
> Solved 10 Myth service endpoints that currently return Strings or
> StringLists.
>
>
>
> Any opinions on the following difference?
>
> $ api2 --endpoint Myth/GetHostName
> ...
> ********** Myth/GetHostName want's XML response from Original API:
>
> <String>ofc0</String>
>
> ********** Myth/GetHostName want's XML response from V2 API:
>
> <String xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> serializerVersion="1.1">ofc0</String>

The latter is way too verbose, especially if that's added to every
string. Is there a way to specify it once in the header of the XML
document?

David


_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Conversion of Service API [ In reply to ]
On 6/28/21 10:15 AM, David Hampton via mythtv-dev wrote:
> On Mon, 2021-06-28 at 10:10 -0500, Bill Meek wrote:
>> On 6/28/21 8:39 AM, Peter Bennett wrote:
>>> I have updated the wiki page with instructions on converting
>>> services
>>>
>>> https://www.mythtv.org/wiki/Services_API_V2_Conversion
>>>
>>> If I have anything wrong or left out anything please feel free to
>>> update it or let me know.
>>>
>>> Peter
>>>
>>
>> Thanks! Especially noted: Q_CLASSINFO("GetSavedBookmark", 
>> "name=long").
>>
>> Solved 10 Myth service endpoints that currently return Strings or
>> StringLists.
>>
>>
>>
>> Any opinions on the following difference?
>>
>> $ api2 --endpoint Myth/GetHostName
>> ...
>> ********** Myth/GetHostName want's XML response from Original API:
>>
>> <String>ofc0</String>
>>
>> ********** Myth/GetHostName want's XML response from V2 API:
>>
>> <String xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> serializerVersion="1.1">ofc0</String>
>
> The latter is way too verbose, especially if that's added to every
> string. Is there a way to specify it once in the header of the XML
> document?
>
> David

These are the original and v2 raw responses:

bill@ofc0:~$ curl ofc0.local:6544/Myth/GetHostName
<?xml version="1.0" encoding="UTF-8"?><String>ofc0</String>

bill@ofc0:~$ curl ofc0.local:6744/Myth/GetHostName
<?xml version="1.0" encoding="UTF-8"?><String xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" serializerVersion="1.1">ofc0</String>

And for a StringList (to show the xml version etc. isn't repeated per String):

bill@ofc0:~$ curl ofc0.local:6544/Myth/GetKeys
<?xml version="1.0" encoding="UTF-8"?><StringList><String>AC3PassThru</String> ...

bill@ofc0:~$ curl ofc0.local:6744/Myth/GetKeys
<?xml version="1.0" encoding="UTF-8"?><StringList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
serializerVersion="1.1"><String>AC3PassThru</String><String>...

--
Bill
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Conversion of Service API [ In reply to ]
On 6/28/21 11:10 AM, Bill Meek wrote:
> On 6/28/21 8:39 AM, Peter Bennett wrote:
>> I have updated the wiki page with instructions on converting services
>>
>> https://www.mythtv.org/wiki/Services_API_V2_Conversion
>>
>> If I have anything wrong or left out anything please feel free to update it or let me know.
>>
>> Peter
>>
> Thanks! Especially noted: Q_CLASSINFO("GetSavedBookmark", "name=long").
>
> Solved 10 Myth service endpoints that currently return Strings or StringLists.
>
>
>
> Any opinions on the following difference?
>
> $ api2 --endpoint Myth/GetHostName
> ...
> ********** Myth/GetHostName want's XML response from Original API:
>
> <String>ofc0</String>
>
> ********** Myth/GetHostName want's XML response from V2 API:
>
> <String xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" serializerVersion="1.1">ofc0</String>
>
Hi Bill

I think that should be OK, parsers hopefully will not be affected by
those new attributes in the xml. I have not looked into whether or how
to get rid of them. I think this is a feature not a bug.

Peter

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Conversion of Service API [ In reply to ]
On 6/28/21 11:15 AM, David Hampton wrote:
>> <String xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> serializerVersion="1.1">ofc0</String>
> The latter is way too verbose, especially if that's added to every
> string. Is there a way to specify it once in the header of the XML
> document?
>
This is not on every string. It is only in the header. In this case the
entire document is one string.

PETER
Re: Conversion of Service API [ In reply to ]
On 6/28/21 1:39 PM, Peter Bennett wrote:
>
> On 6/28/21 11:10 AM, Bill Meek wrote:
>> On 6/28/21 8:39 AM, Peter Bennett wrote:
>>> I have updated the wiki page with instructions on converting services
>>>
>>> https://www.mythtv.org/wiki/Services_API_V2_Conversion
>>>
>>> If I have anything wrong or left out anything please feel free to update it or let me know.
>>>
>>> Peter
>>>
>> Thanks! Especially noted: Q_CLASSINFO("GetSavedBookmark",  "name=long").
>>
>> Solved 10 Myth service endpoints that currently return Strings or StringLists.
>>
>>
>>
>> Any opinions on the following difference?
>>
>> $ api2 --endpoint Myth/GetHostName
>> ...
>> ********** Myth/GetHostName want's XML response from Original API:
>>
>> <String>ofc0</String>
>>
>> ********** Myth/GetHostName want's XML response from V2 API:
>>
>> <String xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" serializerVersion="1.1">ofc0</String>
>>
> Hi Bill
>
> I think that should be OK, parsers hopefully will not be affected by those new attributes in the xml. I have not looked into whether or how to
> get rid of them. I think this is a feature not a bug.
>
> Peter

Hey Peter,

Thanks for all your examples. If I comment out lines 25/26 here:

https://github.com/MythTV/mythtv/blob/devel/http/mythtv/libs/libmythbase/http/serialisers/mythxmlserialiser.cpp#L25

the String/StringList responses match the original. BUT, the XML for Video/GetVideos
is empty! I think I'll just leave it alone for now. But will start a section in the
Wiki where differences can be tracked. I'll note that these are know at the time and
may change prior to release.


--
Bill
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org