Mailing List Archive

Web services wsdl fails after commits c3cf321 and ea8a83d
David

Two commits have removed the Q_DECLARE_METATYPE and qRegisterMetaType
for the web service types. The web service wsdl now does not work, It is
missing the URLS for subtypes. The xsd urls also fail as a result of the
same thing.

There are thousands of lines of changes here. I tried a git revert. It
gave a bunch of conflicts - mainly they were duplicated public:
declarations. After I fixed those I tried a compile but there were
hundreds of errors about conflicting definitions and types.

Wsdl::IsCustomType( QString &sTypeName ) uses a call to QMetaType::type.
This is returning zero for all of the custom types because they were not
registered. It should return a value.

Xsd::GetXSD uses QMetaType::type and QMetaType::construct( id ) to
create an object of a custom type. This is not working as the id is
always coming out as 0 so all of the xsd URLs fail.

Can we get it all reverted back to the state where it has the
Q_DECLARE_METATYPE and qRegisterMetaType ?

Examples of wsdl output -

http://localhost:6544/Dvr/wsdl

With MythTV 29 correct result is below - see there is an import
schemalocation for many types.

<definitions name="DvrServices" targetNamespace="http://mythtv.org">
<types>
<xs:schema targetNamespace="http://MythTV.org/Imports">
<xs:import
schemaLocation="http://localhost:6544/Dvr/xsd?type=ArrayOfString"
namespace="http://mythtv.org"/>
<xs:import schemaLocation="http://localhost:6544/Dvr/xsd?type=CutList"
namespace="http://mythtv.org"/>
<xs:import
schemaLocation="http://localhost:6544/Dvr/xsd?type=EncoderList"
namespace="http://mythtv.org"/>
<xs:import schemaLocation="http://localhost:6544/Dvr/xsd?type=InputList"
namespace="http://mythtv.org"/>
<xs:import schemaLocation="http://localhost:6544/Dvr/xsd?type=Program"
namespace="http://mythtv.org"/>
<xs:import
schemaLocation="http://localhost:6544/Dvr/xsd?type=ProgramList"
namespace="http://mythtv.org"/>
<xs:import schemaLocation="http://localhost:6544/Dvr/xsd?type=RecRule"
namespace="http://mythtv.org"/>
<xs:import
schemaLocation="http://localhost:6544/Dvr/xsd?type=RecRuleFilterList"
namespace="http://mythtv.org"/>
<xs:import
schemaLocation="http://localhost:6544/Dvr/xsd?type=RecRuleList"
namespace="http://mythtv.org"/>
<xs:import
schemaLocation="http://localhost:6544/Dvr/xsd?type=TitleInfoList"
namespace="http://mythtv.org"/>
</xs:schema>
<xs:schema elementFormDefault="qualified"
targetNamespace="http://mythtv.org">

With master the result is below - note there is only 1 import, for
ArrayOfString.

<definitions targetNamespace="http://mythtv.org" name="DvrServices">
<types>
<xs:schema targetNamespace="http://MythTV.org/Imports">
<xs:import namespace="http://mythtv.org"
schemaLocation="http://localhost:6544/Dvr/xsd?type=ArrayOfString"/>
</xs:schema>
<xs:schema elementFormDefault="qualified"
targetNamespace="http://mythtv.org">

Other thing, if you use one of the URLS from the schemalocation values,
it works successfully in Myth 29 but fails in Master.

End result is, trying to import wsdl into a test tool fails. Users
trying to create or update applications by using the wsdl will fail. I
am unable to test the new web service for Roger's enhancements.

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: Web services wsdl fails after commits c3cf321 and ea8a83d [ In reply to ]
On Fri, 2017-12-29 at 22:29 -0500, Peter Bennett wrote:
> David
>
> Two commits have removed the Q_DECLARE_METATYPE and
> qRegisterMetaType
> for the web service types. The web service wsdl now does not work, It
> is
> missing the URLS for subtypes. The xsd urls also fail as a result of
> the
> same thing.
>
> There are thousands of lines of changes here. I tried a git revert.
> It
> gave a bunch of conflicts - mainly they were duplicated public:
> declarations. After I fixed those I tried a compile but there were
> hundreds of errors about conflicting definitions and types.
>
> Wsdl::IsCustomType( QString &sTypeName ) uses a call to
> QMetaType::type.
> This is returning zero for all of the custom types because they were
> not
> registered. It should return a value.
>
> Xsd::GetXSD uses QMetaType::type and QMetaType::construct( id ) to
> create an object of a custom type. This is not working as the id is
> always coming out as 0 so all of the xsd URLs fail.
>
> Can we get it all reverted back to the state where it has the
> Q_DECLARE_METATYPE and qRegisterMetaType ?

Reverting the changes would re-introduce compiler warnings and usage of
objects that the Qt documentation says is bad behavior. My guess
(without looking at the code) would be that wsdl is looking up
"SomeTypeBasedOnQObject" instead of "SomeTypeBasedOnQObject*". Let me
spend some time trying to fix this before I revert anything.

David

> Examples of wsdl output -
>
> http://localhost:6544/Dvr/wsdl
>
> With MythTV 29 correct result is below - see there is an import
> schemalocation for many types.
>
> <definitions name="DvrServices" targetNamespace="http://mythtv.org">;
> <types>
> <xs:schema targetNamespace="http://MythTV.org/Imports">;
> <xs:import
> schemaLocation="http://localhost:6544/Dvr/xsd?type=ArrayOfString"
> namespace="http://mythtv.org"/>;
> <xs:import schemaLocation="http://localhost:6544/Dvr/xsd?type=CutList
> "
> namespace="http://mythtv.org"/>;
> <xs:import
> schemaLocation="http://localhost:6544/Dvr/xsd?type=EncoderList"
> namespace="http://mythtv.org"/>;
> <xs:import schemaLocation="http://localhost:6544/Dvr/xsd?type=InputLi
> st"
> namespace="http://mythtv.org"/>;
> <xs:import schemaLocation="http://localhost:6544/Dvr/xsd?type=Program
> "
> namespace="http://mythtv.org"/>;
> <xs:import
> schemaLocation="http://localhost:6544/Dvr/xsd?type=ProgramList"
> namespace="http://mythtv.org"/>;
> <xs:import schemaLocation="http://localhost:6544/Dvr/xsd?type=RecRule
> "
> namespace="http://mythtv.org"/>;
> <xs:import
> schemaLocation="http://localhost:6544/Dvr/xsd?type=RecRuleFilterList"
>
> namespace="http://mythtv.org"/>;
> <xs:import
> schemaLocation="http://localhost:6544/Dvr/xsd?type=RecRuleList"
> namespace="http://mythtv.org"/>;
> <xs:import
> schemaLocation="http://localhost:6544/Dvr/xsd?type=TitleInfoList"
> namespace="http://mythtv.org"/>;
> </xs:schema>
> <xs:schema elementFormDefault="qualified"
> targetNamespace="http://mythtv.org">;
>
> With master the result is below - note there is only 1 import, for
> ArrayOfString.
>
> <definitions targetNamespace="http://mythtv.org" name="DvrServices">
> <types>
> <xs:schema targetNamespace="http://MythTV.org/Imports">;
> <xs:import namespace="http://mythtv.org"
> schemaLocation="http://localhost:6544/Dvr/xsd?type=ArrayOfString"/>;
> </xs:schema>
> <xs:schema elementFormDefault="qualified"
> targetNamespace="http://mythtv.org">;
>
> Other thing, if you use one of the URLS from the schemalocation
> values,
> it works successfully in Myth 29 but fails in Master.
>
> End result is, trying to import wsdl into a test tool fails. Users
> trying to create or update applications by using the wsdl will fail.
> I
> am unable to test the new web service for Roger's enhancements.
>
> 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
_______________________________________________
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: Web services wsdl fails after commits c3cf321 and ea8a83d [ In reply to ]
On 12/30/2017 10:16 AM, David Hampton wrote:
> Reverting the changes would re-introduce compiler warnings and usage of
> objects that the Qt documentation says is bad behavior. My guess
> (without looking at the code) would be that wsdl is looking up
> "SomeTypeBasedOnQObject" instead of "SomeTypeBasedOnQObject*". Let me
> spend some time trying to fix this before I revert anything.
>
> David
My take on it was (without much investigation):
I saw that they were using copy constructors in objects based on
QObject, which you are not supposed to do. You can get rid of the
warnings by adding ": QObject()" or ": QObject(&parent)" to the constuctor.
A better approach I believe would be in places where they are copying
the object, to use
ProgramList *x = new ProgramList();
x->copy(y);
Instead of ProgramList *x = new ProgramList(y);
The copy methods are already there.

This may be off base and there may be good reasons why it cannot or
should not be done this way.

I have some new service code from somebody else that is written the old
way, so whatever the final approach is, I will have to make the same
mods there. The same may apply to others with code in the works. There
are some tickets with contributions of service code that would need to
be changed.

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: Web services wsdl fails after commits c3cf321 and ea8a83d [ In reply to ]
On 30 Dec. 2017 16:35, "Peter Bennett" <pb.mythtv@gmail.com> wrote:




You can get rid of the warnings by adding ": QObject()" or ":
> QObject(&parent)" to the constuctor.

A better approach I believe would be in places where they are copying the


Calling the base constructor in derivated class is never required, it's
already implicit.
Re: Web services wsdl fails after commits c3cf321 and ea8a83d [ In reply to ]
On Sat, 2017-12-30 at 10:34 -0500, Peter Bennett wrote:
>
> On 12/30/2017 10:16 AM, David Hampton wrote:
> > Reverting the changes would re-introduce compiler warnings and
> > usage of
> > objects that the Qt documentation says is bad behavior. My guess
> > (without looking at the code) would be that wsdl is looking up
> > "SomeTypeBasedOnQObject" instead of "SomeTypeBasedOnQObject*". Let
> > me
> > spend some time trying to fix this before I revert anything.
> >
> > David
>
> My take on it was (without much investigation):
> I saw that they were using copy constructors in objects based on
> QObject, which you are not supposed to do. You can get rid of the
> warnings by adding ": QObject()" or ": QObject(&parent)" to the
> constuctor.

That was my initial approach as well, but that just replaces all the
warning messages with errors. Instead of:

warning: base class ‘class QObject’ should be explicitly
initialized in the copy constructor [-Wextra]

you will get this:

error: ‘QObject::QObject(const QObject&)’ is private within
this context

> A better approach I believe would be in places where they are
> copying
> the object, to use
> ProgramList *x = new ProgramList();
> x->copy(y);
> Instead of ProgramList *x = new ProgramList(y);
> The copy methods are already there.
>
> This may be off base and there may be good reasons why it cannot or
> should not be done this way.
>
> I have some new service code from somebody else that is written the
> old
> way, so whatever the final approach is, I will have to make the same
> mods there. The same may apply to others with code in the works.
> There
> are some tickets with contributions of service code that would need
> to
> be changed.

If I remove the two places where wsdl explicitly strips the '*' from
type names, http://localhost:6544/Dvr/wsdl from my test build matches
the same response from my fixes-29 build. I also checked a couple of
the service definitions, and they all seem to use object pointers. I'm
unfamiliar with WSDL, though I know I need to learn about it. What
else should I do to test the wsdl code? Is there a suite of tests
anywhere?

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: Web services wsdl fails after commits c3cf321 and ea8a83d [ In reply to ]
On 12/30/2017 02:07 PM, David Hampton wrote:
> If I remove the two places where wsdl explicitly strips the '*' from
> type names,http://localhost:6544/Dvr/wsdl from my test build matches
> the same response from my fixes-29 build. I also checked a couple of
> the service definitions, and they all seem to use object pointers. I'm
> unfamiliar with WSDL, though I know I need to learn about it. What
> else should I do to test the wsdl code? Is there a suite of tests
> anywhere?
>
That sounds good. Let me have the details or a patch.

For testing I use SoapUI. You just plug in the wsdl URL and it formats a
nice set of example requests for each defined request type. You can then
plug in values, run the services and see the results. I also has the
ability to create test cases and then run them.

I use the free version of SoapUI. It seems to do everything.

SoapUI was telling me there are undefined types in the wsdl and would
not accept it.

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