Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kdwsdl2cpp generates invalid class name #210

Open
skostenkov opened this issue Mar 12, 2020 · 3 comments · Fixed by cornelius/libkode#9 or #215 · May be fixed by #218
Open

kdwsdl2cpp generates invalid class name #210

skostenkov opened this issue Mar 12, 2020 · 3 comments · Fixed by cornelius/libkode#9 or #215 · May be fixed by #218

Comments

@skostenkov
Copy link

skostenkov commented Mar 12, 2020

kdwsdl2cpp generates an invalid class name
when wsdl contains a namespace with a prefix.
For example, the code

    class AGREGAT.GETAGGREGATES__GetAggregates
    {
    public:
        void setLaunchId( qint64 _launchId );
        qint64 launchId() const;
        KDSoapValue serialize( const QString& valueName ) const;
        void deserialize( const KDSoapValue& mainValue );
        AGREGAT.GETAGGREGATES__GetAggregates();
        ~AGREGAT.GETAGGREGATES__GetAggregates();

    public:
        AGREGAT.GETAGGREGATES__GetAggregates( const AGREGAT.GETAGGREGATES__GetAggregates& );
        AGREGAT.GETAGGREGATES__GetAggregates &operator=( const AGREGAT.GETAGGREGATES__GetAggregates& );

    private:
        class PrivateDPtr;
        QSharedDataPointer<PrivateDPtr> d_ptr;
    };
} // namespace end

is generated from

<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   xmlns:PandaRt="http://nicetu.spb.ru/panda/ws/rt/methods"
   xmlns:agregat.getAggregates="http://nicetu.spb.ru/panda/types/vti/agregat/getAggregates/methods"
   name="PandaRtService" targetNamespace="http://nicetu.spb.ru/panda/ws/rt">

   <wsdl:types>
       <xsd:schema targetNamespace="http://nicetu.spb.ru/panda/ws/rt" elementFormDefault="qualified">
   	    <xsd:import namespace="http://nicetu.spb.ru/panda/types/vti/agregat/getAggregates/methods" schemaLocation="../xsd/vti/agregat.getAggregates.methods.xsd" />
           <xsd:import namespace="http://nicetu.spb.ru/panda/ws/rt/methods" schemaLocation="../xsd/PandaRt.methods.xsd" />
       </xsd:schema>
   </wsdl:types>

   <wsdl:message name="getAggregatesRequest">
       <wsdl:part name="parameters" element="agregat.getAggregates:getAggregates" />
   </wsdl:message>
   <wsdl:message name="getAggregatesResponse">
       <wsdl:part name="parameters" element="agregat.getAggregates:getAggregatesResponse" />
   </wsdl:message>
 
   <wsdl:portType name="PandaRt">
       <wsdl:documentation>Сервис для ПК РМВ</wsdl:documentation>
       <wsdl:operation name="getAggregates">
           <wsdl:documentation>Возвращает состав агрегатов изделия на пуске</wsdl:documentation>
           <wsdl:input message="tns:getAggregatesRequest" />
           <wsdl:output message="tns:getAggregatesResponse" />
       </wsdl:operation>
   </wsdl:portType>

   <wsdl:binding name="PandaRtPortBinding" type="tns:PandaRt">
       <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
       <wsdl:operation name="getAggregates">
           <soap:operation soapAction="http://nicetu.spb.ru/panda/ws/rt/getAggregates" />
           <wsdl:input>
               <soap:body use="literal" />
           </wsdl:input>
           <wsdl:output>
               <soap:body use="literal" />
           </wsdl:output>
       </wsdl:operation>
   </wsdl:binding>

   <wsdl:service name="PandaRtService">
       <wsdl:documentation>Сервис для ПК РМВ</wsdl:documentation>
       <wsdl:port name="PandaRtPort" binding="tns:PandaRtPortBinding">
           <soap:address location="http://as.panda.nicetu.spb.ru:9080/panda-server/ws/contract/PandaRt" />
       </wsdl:port>
   </wsdl:service>
</wsdl:definitions>

The problem is that according to Namespaces in XML and XML xmlns : prefix may contain "." and other chars.

@skostenkov
Copy link
Author

Got better. But there is still a problem:

class GetAggregatesJob : public KDSoapJob
{
    Q_OBJECT

public:
    GetAggregatesJob( PandaRtService* service, QObject* _parent = nullptr );
    void setParameters( const AGREGAT_GETAGGREGATES__GetAggregates& arg0 );
    AGREGAT.GETAGGREGATES__GetAggregates parameters() const;
    AGREGAT.GETAGGREGATES__GetAggregatesResponse resultParameters() const;
    
protected:
    virtual void doStart() override;

private Q_SLOTS:
    void slotFinished( KDSoapPendingCallWatcher* watcher );
    
private:
    PandaRtService *mService;
    AGREGAT.GETAGGREGATES__GetAggregates mParameters;
    AGREGAT.GETAGGREGATES__GetAggregatesResponse mResultParameters;
};

@eugenyk
Copy link

eugenyk commented Mar 18, 2020

@dfaure-kdab, the problem is in return value name AGREGAT.GETAGGREGATES__GetAggregates

@anoymouserver
Copy link
Contributor

Next time please provide the full wsdl with all dependencies (xsd) so it is not necessary to create one myself to debug the issue. 😀

@dfaure-kdab dfaure-kdab reopened this Mar 30, 2020
@anoymouserver anoymouserver linked a pull request Mar 31, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants