MrLoick / staff

Automatically exported from code.google.com/p/staff
Apache License 2.0
0 stars 0 forks source link

Element optional and underscore #199

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Codegen with ApacAc.wsdl generates ApacAcImpl.cpp.

::EApacAErrorCode ApacAcImpl::appelerPersonne(const 
staff::Optional<std::string>& ressourceURI, const staff::Optional<std::string>& 
workingURL, const staff::Optional<std::string>& proxy_minus_host, const 
staff::Optional<std::string>& proxy_minus_port, const std::string& 
numeroTelephone, const std::string& nomLogique, bool bOrganisateur, unsigned 
short idParticipantPlateformeCliente, unsigned short idPlateformeCliente)

When I log the parameters I can see that proxy_minus_port and proxy_minus_host 
std::strings are empty (NOK).

I you change the minOccurs value into the ApacAc.wsdl...

<element name="proxy-host" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<element name="proxy-port" type="xsd:string" minOccurs="1" maxOccurs="1"/>

...codegen generates now...

::EApacAErrorCode ApacAcImpl::appelerPersonne(const 
staff::Optional<std::string>& ressourceURI, const staff::Optional<std::string>& 
workingURL, const std::string& proxy_minus_host, const std::string& 
proxy_minus_port, const std::string& numeroTelephone, const std::string& 
nomLogique, bool bOrganisateur, unsigned short idParticipantPlateformeCliente, 
unsigned short idPlateformeCliente)

... and when I log the parameters I can see that proxy_minus_port and 
proxy_minus_host are not empty anymore (OK).

What version of the product are you using? On what operating system?
Staff (r724) - RedHat RHEL 5.2 x86_64

Original issue reported on code.google.com by juderamond@gmail.com on 8 Mar 2013 at 8:28

Attachments:

GoogleCodeExporter commented 8 years ago
order of creating element and setting element/attribute form is not correct.

Original comment by loentar on 16 Mar 2013 at 11:53

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r741.

Original comment by loentar on 16 Mar 2013 at 1:27

GoogleCodeExporter commented 8 years ago
Your request quite complex. If you disable unwrapping of request/response 
elements service interface will be more readable.

To disable unwrapping add -ddontunwrap codegen option while generating client
staff_codegen -tclient_all -pwsdl ApacAc.wsdl -ddontunwrap

and then your interface will look like that:

  struct appelerPersonne
  {
    staff::Optional<std::string> ressourceURI;
    // *form: qualified
    staff::Optional<std::string> workingURL;
    // *elementName: proxy-host
    staff::Optional<std::string> proxy_minus_host;
    // *elementName: proxy-port
    staff::Optional<std::string> proxy_minus_port;
    std::string numeroTelephone;
    std::string nomLogique;
    bool bOrganisateur;
    unsigned short idParticipantPlateformeCliente;
    unsigned short idPlateformeCliente;
  };

  struct appelerPersonneResponse
  {
    ::EApacAErrorCode response;
  };

  //! gSOAP 2.7.9a generated service definition
  // *serviceUri: http://localhost:80
  // *soapVersion: 1.1
  // *targetNamespace: urn:ApacAc
  class ApacAc: public staff::IService
  {
  public:
    //! Service definition of function ApacAc__appelerPersonne
    // *inlineRequestElement: true
    // *requestElement: appelerPersonne
    // *responseElement: appelerPersonneResponse
    virtual ::appelerPersonneResponse appelerPersonne(const ::appelerPersonne& appelerPersonne) = 0;
  };

Original comment by loentar on 16 Mar 2013 at 1:31

GoogleCodeExporter commented 8 years ago
Yes that's more readable with the codegen option -ddontunwrap.

Thanks for the fix.

Original comment by juderamond@gmail.com on 19 Mar 2013 at 8:16