Hi all,
sorry in advance - I know that this is not quite the right group for
such a question, but for lack of a better one I am trying my luck
anyway ;-)
I need to parse the type information contained in a standard WSDL file
using Java, i.e. I want to have an in-memory representation of the
types (type names and "structure", for complex types as well as simple
types), which I can then use to compare to some input provided by a
user.
So far I have (with some success) used the fine parser that comes
along with WSIF (http://publib.boulder.ibm.com/infocenter/adiehelp/
index.jsp?topic=/com.ibm.wasee.doc/info/ee/javadoc/wsi/org/apache/wsif/
schema/Parser.html), but it turns out that this parser only parses top-
level types. A WSDL file containing element-local types like
<xs:element name="sendOrderConfirmationResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="return" nillable="true"
type="xs:boolean" />
</xs:sequence>
</xs:complexType>
</xs:element>
(as produced by Axis2) will not by parsed completely. Unfortunately
this restriction renders the utility more or less useless for document/
wrapped ... I have already asked a similar question on the WSIF
mailing list, but the whole project seems to be quite dead at the
moment.
Does anybody of you know of a good open-source WSDL or XSD parser
which I could use to generate an in-memory representation of these
types?
many thanks in advance (and sorry for the slightly off-topic Web
Services question),
philipp
Manfred Rosenboom - 12 Apr 2007 13:26 GMT
Have a look at soapUI 1.7: http://www.soapui.org/
If this tool can read your WSDL files, you can download the sources
of this tool and see, how they do it.
Karl Uppiano - 13 Apr 2007 05:15 GMT
You might try WSDL4J (http://sourceforge.net/projects/wsdl4j) -- you can
read in WSDL to a DOM-like structure, and write it back out, or
programmatically create new WSDLs.
Philipp Leitner - 13 Apr 2007 08:50 GMT
Yes, I have been using WSDL4J for all other WSDL-specific tasks in my
application, but dealing with types is rudimentary (better said, not
available) with WSDL4J.
I have also checked in the soapUI* source code, they are using
XMLBeans combined with some rather ugly namespaces and XPath tricks.
/philipp
* nice application btw., didn't know that one yet.