I would really like some input on this if anyone knows. Recap: I'd like to know how to specify a message part as mandatory/required. Currently, it automatically makes anything after the first part "optional"
________________________________ From: rabidcicada <rabidcic...@yahoo.com> To: gsoap@yahoogroups.com Sent: Mon, July 19, 2010 3:10:18 PM Subject: [gsoap] Re: gSOAP WSDL Parsing -- How To make message part explicitly 'Required'? BTW, The service as a whole works well. I've used the client code from gSOAP to interact with the service code and have fully fleshed out all the service stubs etc. It all works well...just curious as to how to force required parts so that SOAP will guarantee proper message format before handing off to my processing code. --- In gsoap@yahoogroups.com, "rabidcicada" <rabidcic...@...> wrote: > > I'm very new to SOAP/WSDL/gSOAP. > > I've generated a C++ shell class using wsdl2h.exe and soapcpp.exe from my own >WSDL file. > > The problem is that it makes some message parts optional without me telling > it >to and I don't know why. I assume I don't understand the parsing rules and >can't >find an answer in the FAQ or developers guide. I've also searched google but I >think my unfamiliarity with SOAP/WSDL is my problem. > > > Sample message declaration: > <message name="attributeSetRequest"> > <part name="moteAddress" type="xsd:long"/> > <part name="attributeToSet" type="tns:attribute_t"/> > </message> > <message name="attributeSetResponse"> > <part name="attributeSetSuccess" type="tns:successResults_t"/> > </message> > > <operation name="attributeSet"> > <input message="tns:attributeSetRequest"/> > <output message="tns:attributeSetResponse"/> > </operation> > > Sample C++ output: > > #ifndef SOAP_TYPE_pscwsn__attributeSet > #define SOAP_TYPE_pscwsn__attributeSet (102) > /* pscwsn:attributeSet */ > struct pscwsn__attributeSet > { > public: > LONG64 moteAddress; /* required element of type xsd:long */ > pscwsn__attribute_USCOREt *attributeToSet; /* optional element of type >pscwsn:attribute_t */ > }; > #endif > > Why does it say attributeToSet is optional? And would someone be kind enough > to >tell me how to make it mandatory? > > It seems that gsoap assumes all message parts after the first are optional. > Is >this defined behavior in SOAP or is there a way to force gSOAP to 'require' >the >message part? >