Topic
  • 4 replies
  • Latest Post - ‏2014-02-27T10:31:29Z by DavidSeager
Jason_Hz
Jason_Hz
3 Posts

Pinned topic Schema 'element type' Definition in WSRR

‏2014-02-03T19:27:12Z |

WSRR can derive service related information from WSDL and XSD files. But how it handles the detailed 'element type' information, such as string or int? I cannot find it from WSRR after I uploaded a WSDL or XSD file.

For example: if I upload a XSD file contains the following statements:

 

    <xsd:element name="Request">

        <xsd:complexType>

          <xsd:sequence>

            <xsd:element name="a" type="xsd:decimal" />

            <xsd:element name="b" type="xsd:decimal" />

          </xsd:sequence>

        </xsd:complexType>

    </xsd:element>

 

WSRR only derived the element name "Request", and there is no 'type' definition like "decimal".

What should I do, if I want the detailed 'type' information be derived?

Updated on 2014-02-03T19:28:40Z at 2014-02-03T19:28:40Z by Jason_Hz
  • DavidSeager
    DavidSeager
    64 Posts

    Re: Schema 'element type' Definition in WSRR

    ‏2014-02-05T09:58:03Z  

    WSRR does not "shred" such detailed element information. All it will do is derive the global type, attribute information, but not the detailed structure of the type itself.

    You will need to load the XSD that defines the type, parse it and extract the data that way if you need it.

    Regards.

     

  • Jason_Hz
    Jason_Hz
    3 Posts

    Re: Schema 'element type' Definition in WSRR

    ‏2014-02-05T16:23:07Z  

    WSRR does not "shred" such detailed element information. All it will do is derive the global type, attribute information, but not the detailed structure of the type itself.

    You will need to load the XSD that defines the type, parse it and extract the data that way if you need it.

    Regards.

     

    Thank you DavidSeager. Can you please tell me more about what you mean by parsing and extracting the data and how to do that?

  • Jason_Hz
    Jason_Hz
    3 Posts

    Re: Schema 'element type' Definition in WSRR

    ‏2014-02-26T17:24:29Z  

    WSRR does not "shred" such detailed element information. All it will do is derive the global type, attribute information, but not the detailed structure of the type itself.

    You will need to load the XSD that defines the type, parse it and extract the data that way if you need it.

    Regards.

     

    Hi David, can you please give me some recommendations or tentative solutions for this problem? Thank you.

  • DavidSeager
    DavidSeager
    64 Posts

    Re: Schema 'element type' Definition in WSRR

    ‏2014-02-27T10:31:29Z  
    • Jason_Hz
    • ‏2014-02-26T17:24:29Z

    Hi David, can you please give me some recommendations or tentative solutions for this problem? Thank you.

    Because these files are XSD files, you need to use a Java (or your language) XSD parser. This post lists a couple:

    http://stackoverflow.com/questions/9123815/how-do-i-parse-a-xsd-file-using-java

    We use a straight forward SAX XML parser, but using a proper XSD parser is probably preferable.

     

    You would need to do the parsing from wherever you need the XSD information; perhaps in a client application.

     

    If you want this information to be stored inside WSRR, then you could write a WSRR modifier plugin which, when it is notified that an XSD document is being loaded, parses the content and generates some modelled objects that represent whatever data you require, and stores these models inside WSRR. See this doc for what a modifier is: http://www.ibm.com/developerworks/websphere/library/techarticles/1305_smithson/1305_smithson.html

    You would need to modify the WSRR model to add your own representations of the XSD structure. This can be done using WSRR Studio.