Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 // Metawidget (licensed under LGPL)
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
 // version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package org.metawidget.inspector.wsdl;
Inspector to look for metadata in Web Services Description Language (WSDL) files.

It extracts the XML Schema from the <parameter><schema></parameter> element of the WSDL and parses it for useful metadata.

If WsdlInspector is used for a Java environment, consider using it in conjunction with XmlSchemaToJavaTypeMappingProcessor . For returning results to JavaScript environments, consider JavaToJavaScriptTypeMappingProcessor and XmlUtils.elementToJson.

Author(s):
Richard Kennard
public class WsdlInspector
	//
	// Constructor
	//
	public WsdlInspectorXmlSchemaInspectorConfig config ) {
		superconfig );
	}
	//
	// Protected methods
	//
Overridden to return the root of the XML Schema, not the root of the WSDL.
	protected Element getDocumentElementResourceResolver resolverInputStream... files )
		throws Exception {
		Element element = super.getDocumentElementresolverfiles );
		Element types = XmlUtils.getChildNamedelement"types" );
		if ( types == null ) {
			throw InspectorException.newException"No types element" );
		}
		Element schema = XmlUtils.getChildNamedtypes"schema" );
		if ( schema == null ) {
			throw InspectorException.newException"No types/schema element" );
		}
		return schema;
	}
New to GrepCode? Check out our FAQ X