Title: Message
Hi there , Im afraid I  have no control over the schema and will not be allowed to change it :(
-----Original Message-----
From: Grossberger, Guenter [mailto:[EMAIL PROTECTED]
Sent: 03 October 2005 09:19
To: [email protected]
Subject: RE: Wsdl2java generated code

Hi!
 
You can define the complex type starting after <element name="Request"> as a global type with e.g. <complexType name="RequestType"> and reuse it in both element definitions with <element name="Request" type="RequestType">.
 
If you have additonale elements in the Update case you can extend the RequestType with xsd:extension. For more information look for documentation of XML Schema.

Best regards,

--
DI Günter Grossberger
Consultant             Tel: +43 1 329 50 161
Software AG Österreich Fax: +43 1 329 50 171
Guglgasse 7-9          GSM: +43 676 833 29 261
1030 Wien             
http://www.softwareag.com/austria

 


From: Coyne, Jimmy [mailto:[EMAIL PROTECTED]
Sent: Friday, September 30, 2005 6:03 PM
To: [email protected]
Subject: Wsdl2java generated code

Hi all ,
Our  customer have designed there different services   such as CreateAccount , UpdateAccount , DeleteAccount etc  in a very a very similar manner.

For example CreateAccount

<element name="CreateAccount">
         <complexType>
          <sequence>
             <element name="Request">
                <complexType>
                  <sequence>
                    <element name="accountDetails" minOccurs="0">
                      <complexType>
                        <sequence>
                          <element name="country" type="string"/>
                          <element name="accountId" type="string"/>
                          <element name="Profile">
                            <complexType>
                              <sequence>
                                <element name="name" type="string" minOccurs="0"/>
                              </sequence>
                            </complexType>
                          </element>
                        </sequence>..........




Is the same as  UpdateAccount  except for a few elements names ..

<element name="UpdateAccount">
         <complexType>
          <sequence>
             <element name="Request">
                <complexType>
                  <sequence>
                    <element name="accountDetails" minOccurs="0">
                      <complexType>
                        <sequence>
                          <element name="country" type="string"/>
                          <element name="accountId" type="string"/>
                          <element name="Profile">
                            <complexType>
                              <sequence>
                                <element name="name" type="string" minOccurs="0"/>
                              </sequence>
                            </complexType>
                          </element>
                        </sequence>. . . . . . .



Using wsdl2java  The classes  created very similar

CreateAccount--- generates
CreateAccountRequest
CreateAccountRequestAccountDetails
CreateAccountRequestAccountDetailsProfile
......... . . . .  . .
UpdateAccountRequest ----- generates

UpdateAccountRequest
UpdateAccountRequestAccountDetails
UpdateAccountRequestAccountDetailsProfile
 . . . . . . . . . . . . .  . .


Although the  classes  are almost identical  , because they  don't extend   any common   class  , I cant see a way of building up the binding objects

 in a clean way i.e.  I will have to write code to set the binding object for all cases with no reuse . Can any one think of a clean way to solve this problem ?

Thanks
Jimmy






Reply via email to