Forum Discussion

tim's avatar
tim
Contributor
16 years ago

Obtaining XML Schema information regarding a MessagePart

I am using the soapui API to inspect a WSDL and then display information about Request MessageParts for a given Operation.

I would like to find out about the XML Schema for the MessagePart.

For example, in soapUI Pro, in Form view, I can see a pull down for choices: A, B, C in a Request parameter because this parameter (MessagePart) was defined as a simpleType as such:


<simpleType name="elementString">
  <restriction base="xsd:string">
      <enumeration value="A"/>
      <enumeration value="B"/>
      <enumeration value="C"/>
  </restriction>
</simpleType>


I would like to provide an interface similar to this in my application.
Will I have to use xmlbeans? Any hints or suggestions would be greatly appreciated.

Is the source available for soapUI Pro (I'm assuming it is not)?.

3 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    you are correct in both regards:

    1) use XMLBeans SchemaType related classes/functionality to find this information
    2) soapUI Pro source is not available

    :-)

    Good Luck!

    /Ole
    eviware.com
  • tim's avatar
    tim
    Contributor
    Hi Ole,

    I am now able to obtain schema information using XMLBeans as you described. 

    How do you make the linkage between the MessagePart and its Schema?
    Use the getPartType() method and then do a String match with the items found by the SchemaTypeSystem.getGlobalTypes()?
  • tim's avatar
    tim
    Contributor
    I've figured it out.


    MessagePart[] messageParts = operation.getDefaultRequestParts();
    for (MessagePart mp : messageParts) {
        WsdlContentPart wcp = (WsdlContentPart)mp;
        SchemaType sType = wcp.getSchemaType();
    }