Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Re: Problem when extracting XSD from WSDL
Re: Problem when extracting XSD from WSDL [message #64866] Thu, 03 November 2005 11:37
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------020404050508090906030409
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Vladimir,

Don't use backslash in a URI. It's just treated as a regular character,
not as "/".

createURI("file:///C:\\temp\\extracted.xsd")

Also, don't use org.eclipse.xsd.impl, i.e., the XSD API implementation
classes directly either; they are not API and can be changed arbitrarily.

The save method of an XSDResourceImpl is like this:

protected void doSave(OutputStream os, Map options) throws IOException
{
XSDSchema xsdSchema = getSchema();
if (xsdSchema != null)
{
Document document = xsdSchema.*getDocument*();
if (document == null)
{
xsdSchema.updateDocument();
document = xsdSchema.getDocument();
}

if (xsdSchema.getElement() == null)
{
xsdSchema.updateElement();
}

doSerialize(os, document, options == null ? null :
(String)options.get(XSD_ENCODING));
}
}

Note how it saves the entire document that contains the schema's element
(because XSDResourceImpl can be used to read a .wsdl directly and will
wrap all the XSDSchemas in that document, which you can then edit, and
then save the whole original document again).

You need to extract the schema element into a new Document if you want
to save just the schema. Note that
XSDResourceImpl.serialize(<outputStream>, exElement.getElement()) or
your save(Node) method would accomplish the same thing as you are
doing, but more cheaply, so unless you are actually going to manipulate
the XSDSchema, this seems an expensive way. Perhaps just serializing
the element wouldn't write out all the necessary prefixes declared in a
outer scopes?


Vladimir Isajkin wrote:

> Hi,
> I extract XSD schema from WSDL as shown in the code below and then try
> to save it. But instead of XSD the complete content of WSDL is saved.
> If I save DOM element using XML Transformer API then I get saved only
> my schema.
>
> What am I doing wrong?
>
> Because I intend to use the extracted schema in my next code I need it
> as XSDSchema instance.
>
>
> import java.io.File;
> import java.util.Collections;
> import java.util.Iterator;
> import java.util.List;
>
> import javax.wsdl.Definition;
> import javax.wsdl.WSDLException;
> import javax.wsdl.extensions.UnknownExtensibilityElement;
> import javax.wsdl.factory.WSDLFactory;
> import javax.xml.transform.Result;
> import javax.xml.transform.Source;
> import javax.xml.transform.Transformer;
> import javax.xml.transform.TransformerConfigurationException;
> import javax.xml.transform.TransformerException;
> import javax.xml.transform.TransformerFactory;
> import javax.xml.transform.TransformerFactoryConfigurationError;
> import javax.xml.transform.dom.DOMSource;
> import javax.xml.transform.stream.StreamResult;
>
> import org.eclipse.emf.common.util.URI;
> import org.eclipse.emf.ecore.resource.Resource;
> import org.eclipse.emf.ecore.resource.ResourceSet;
> import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
> import org.eclipse.xsd.XSDFactory;
> import org.eclipse.xsd.XSDSchema;
> import org.eclipse.xsd.impl.XSDSchemaImpl;
> import org.eclipse.xsd.util.XSDResourceImpl;
> import org.w3c.dom.Node;
>
>
> public class WsdlHandler {
> private Definition wsdlDefinition;
>
> public static void main(String[] args) {
> WsdlHandler handler = new
> WsdlHandler("ResourceIdentification.wsdl");
> handler.extractXSD();
> }
>
> public WsdlHandler(String wsdlFile) {
> try {
> wsdlDefinition = WSDLFactory.newInstance().
> newWSDLReader().readWSDL(wsdlFile);
> } catch (WSDLException exception) {
> exception.printStackTrace();
> }
> }
>
>
> private void extractXSD() {
> List exList = wsdlDefinition.getTypes().
> getExtensibilityElements();
> if (exList != null) {
> for (Iterator iterator =
> exList.iterator();
> iterator.hasNext();) {
> UnknownExtensibilityElement exElement
> = (UnknownExtensibilityElement) iterator.next();
>
> XSDSchema schema =XSDSchemaImpl.
> createSchema(exElement.getElement());
> //OR
> // XSDSchema schema = XSDFactory.
> eINSTANCE. createXSDSchema();
> // schema.setElement(exElement);
> schema.updateElement();
> schema.update();
> try {
> ResourceSet resourceSet = new ResourceSetImpl();
> Resource resource = new XSDResourceImpl(URI
> createURI("file:///C:\\temp\\extracted.xsd"));
> resource.getContents().add(schema);
> resourceSet.getResources().add(resource);
> resource.save(Collections.EMPTY_MAP);
> } catch (Exception exception) {
> System.out.println(exception.getLocalizedMessage());
> exception.printStackTrace();
> }
> save(exElement.getElement());
> }
> }
> }
> private void save(Node node) {
> try {
> File outputFile = new File("C:\\temp\\element.xsd");
> Source source = new DOMSource(node);
> Result result = new StreamResult(outputFile);
> Transformer xformer =
> TransformerFactory.newInstance().newTransformer();
> xformer.transform(source, result);
> } catch (TransformerConfigurationException e) {
> e.printStackTrace();
> } catch (TransformerFactoryConfigurationError e) {
> e.printStackTrace();
> } catch (TransformerException e) {
> e.printStackTrace();
> }
> }
> }
>
> ------------------------------------------------------------ ------------
>
><?xml version="1.0" encoding="UTF-8"?>
><!-- begin_generated_IBM_copyright_prolog -->
><!-- -->
><!-- This is an automatically generated copyright prolog -->
><!-- After initializing, DO NOT MODIFY OR MOVE -->
><!-- -->
><!-- -->
><!-- -->
><!-- Licensed Materials - Property of IBM -->
><!-- Restricted Materials of IBM -->
><!-- -->
><!-- Product(s): -->
><!-- -->
><!-- (C)Copyright IBM Corp. 2005, 2005 -->
><!-- All Rights Reserved -->
><!-- -->
><!-- US Government Users Restricted Rights - Use, duplication or -->
><!-- disclosure restriced by GSA ADP Schedule Contract with IBM Corp. -->
><!-- -->
><!-- -->
><!-- -->
><!-- end_generated_IBM_copyright_prolog -->
><wsdl:definitions name="ResourceIdentification"
>targetNamespace=" http://www.ibm.com/xmlns/prod/rvs/2005/05/ResourceIdentifica tion.wsdl"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:wsrf-rp=" http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProp erties-1.2-draft-05.xsd"
> xmlns="http://schemas.xmlsoap.org/wsdl/">
> <wsdl:types>
> <xsd:schema targetNamespace=" http://www.ibm.com/xmlns/prod/rvs/2005/05/ResourceIdentifica tion.wsdl"
> xmlns:rvs-mr-ri=" http://www.ibm.com/xmlns/prod/rvs/2005/05/ResourceIdentifica tion.xsd"
> xmlns="http://www.w3.org/2001/XMLSchema"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <xsd:import namespace=" http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProp erties-1.2-draft-05.xsd"
> schemaLocation="WS-ResourceProperties.xsd"/>
> <xsd:import namespace=" http://www.ibm.com/xmlns/prod/rvs/2005/05/ResourceIdentifica tion.xsd"
> schemaLocation="ResourceIdentification.xsd"/>
> </xsd:schema>
> </wsdl:types>
> <wsdl:portType name="ResourceIdentification" wsrf-rp:ResourceProperties="rvs-mr-ri:ResourceIdentificationProperties ">
> </wsdl:portType>
></wsdl:definitions>
>
>


--------------020404050508090906030409
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Vladimir,<br>
<br>
Don't use backslash in a URI.&nbsp; It's just treated as a regular
character, not as "/".<br>
<blockquote>createURI(<a class="moz-txt-link-rfc2396E"
href="file:///C:%5C%5Ctemp%5C%5Cextracted.xsd">"file:///C:\\temp\\extracted.xsd"</a>)<br>
</blockquote>
Also, don't use org.eclipse.xsd.impl, i.e., the XSD API implementation
classes directly either; they are not API and can be changed
arbitrarily.<br>
<br>
The save method of an XSDResourceImpl is like this:<br>
<blockquote><small>&nbsp; protected void doSave(OutputStream os, Map
options) throws IOException<br>
&nbsp; {<br>
&nbsp;&nbsp;&nbsp; XSDSchema xsdSchema = getSchema();<br>
&nbsp;&nbsp;&nbsp; if (xsdSchema != null)<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Document document = xsdSchema.<b>getDocument</b>();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (document == null)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; xsdSchema.updateDocument();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; document = xsdSchema.getDocument();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (xsdSchema.getElement() == null)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; xsdSchema.updateElement();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; doSerialize(os, document, options == null ? null :
(String)options.get(XSD_ENCODING));<br>
&nbsp;&nbsp;&nbsp; }<br>
&nbsp; }</small><br>
</blockquote>
Note how it saves the entire document that contains the schema's
element (because XSDResourceImpl can be used to read a .wsdl directly
and will wrap all the XSDSchemas in that document, which you can then
edit, and then save the whole original document again).<br>
<br>
You need to extract the schema element into a new Document if you want
to save just the schema.&nbsp; Note that
XSDResourceImpl.serialize(&lt;outputStream&gt;, exElement.getElement())
or your save(Node) method&nbsp; would accomplish the same thing as you are
doing, but more cheaply, so unless you are actually going to manipulate
the XSDSchema, this seems an expensive way.&nbsp; Perhaps just serializing
the element wouldn't write out all the necessary prefixes declared in a
outer scopes?<br>
<br>
<br>
Vladimir Isajkin wrote:
<blockquote cite="middkcqkq$osc$1@news.eclipse.org" type="cite">Hi,
<br>
I extract XSD schema from WSDL as shown in the code below and then try
to save it. But instead of XSD the complete content of WSDL is saved.
<br>
If I save DOM element using XML Transformer API then I get saved only
my schema.
<br>
<br>
What am I doing wrong?
<br>
<br>
Because I intend to use the extracted schema in my next code I need it
as XSDSchema instance.
<br>
<br>
<br>
import java.io.File;
<br>
import java.util.Collections;
<br>
import java.util.Iterator;
<br>
import java.util.List;
<br>
<br>
import javax.wsdl.Definition;
<br>
import javax.wsdl.WSDLException;
<br>
import javax.wsdl.extensions.UnknownExtensibilityElement;
<br>
import javax.wsdl.factory.WSDLFactory;
<br>
import javax.xml.transform.Result;
<br>
import javax.xml.transform.Source;
<br>
import javax.xml.transform.Transformer;
<br>
import javax.xml.transform.TransformerConfigurationException;
<br>
import javax.xml.transform.TransformerException;
<br>
import javax.xml.transform.TransformerFactory;
<br>
import javax.xml.transform.TransformerFactoryConfigurationError;
<br>
import javax.xml.transform.dom.DOMSource;
<br>
import javax.xml.transform.stream.StreamResult;
<br>
<br>
import org.eclipse.emf.common.util.URI;
<br>
import org.eclipse.emf.ecore.resource.Resource;
<br>
import org.eclipse.emf.ecore.resource.ResourceSet;
<br>
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
<br>
import org.eclipse.xsd.XSDFactory;
<br>
import org.eclipse.xsd.XSDSchema;
<br>
import org.eclipse.xsd.impl.XSDSchemaImpl;
<br>
import org.eclipse.xsd.util.XSDResourceImpl;
<br>
import org.w3c.dom.Node;
<br>
<br>
<br>
public class WsdlHandler {
<br>
&nbsp;&nbsp;&nbsp; private Definition wsdlDefinition;
<br>
<br>
&nbsp;&nbsp;&nbsp; public static void main(String[] args) {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; WsdlHandler handler = new&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
WsdlHandler("ResourceIdentification.wsdl");
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; handler.extractXSD();
<br>
&nbsp;&nbsp;&nbsp; }
<br>
<br>
&nbsp;&nbsp;&nbsp; public WsdlHandler(String wsdlFile) {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; try {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wsdlDefinition = WSDLFactory.newInstance().
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newWSDLReader().readWSDL(wsdlFile);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; } catch (WSDLException exception) {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exception.printStackTrace();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; }
<br>
&nbsp;&nbsp;&nbsp; }
<br>
<br>
<br>
&nbsp;&nbsp;&nbsp; private void extractXSD() {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; List exList = wsdlDefinition.getTypes().
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; getExtensibilityElements();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; if (exList != null) {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (Iterator iterator =
exList.iterator();&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
iterator.hasNext();) {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; UnknownExtensibilityElement exElement
=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp; (UnknownExtensibilityElement) iterator.next();
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; XSDSchema schema =XSDSchemaImpl.
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; createSchema(exElement.getElement());
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //OR
<br>
//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp; XSDSchema schema = XSDFactory.
eINSTANCE.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; createXSDSchema();
<br>
//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp; schema.setElement(exElement);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; schema.updateElement();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; schema.update();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; ResourceSet resourceSet = new ResourceSetImpl();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; Resource resource = new XSDResourceImpl(URI
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
createURI(<a class="moz-txt-link-rfc2396E" href="file:///C:\\temp\\extracted.xsd">"file:///C:\\temp\\extracted.xsd"</a>));
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; resource.getContents().add(schema);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; resourceSet.getResources().add(resource);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; resource.save(Collections.EMPTY_MAP);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } catch (Exception exception) {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
System.out.println(exception.getLocalizedMessage());
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; exception.printStackTrace();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; save(exElement.getElement());
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; }
<br>
&nbsp;&nbsp;&nbsp; }
<br>
&nbsp;&nbsp;&nbsp; private void save(Node node) {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; try {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File outputFile = new File("C:\\temp\\element.xsd");

<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Source source = new DOMSource(node);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Result result = new StreamResult(outputFile);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Transformer xformer =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
TransformerFactory.newInstance().newTransformer();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xformer.transform(source, result);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; } catch (TransformerConfigurationException e) {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.printStackTrace();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; } catch (TransformerFactoryConfigurationError e) {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.printStackTrace();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; } catch (TransformerException e) {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.printStackTrace();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; }
<br>
&nbsp;&nbsp;&nbsp; }
<br>
}
<br>
<pre wrap="">
<hr size="4" width="90%">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!-- begin_generated_IBM_copyright_prolog --&gt;
&lt;!-- --&gt;
&lt;!-- This is an automatically generated copyright prolog --&gt;
&lt;!-- After initializing, DO NOT MODIFY OR MOVE --&gt;
&lt;!-- --&gt;
&lt;!-- --&gt;
&lt;!-- --&gt;
&lt;!-- Licensed Materials - Property of IBM --&gt;
&lt;!-- Restricted Materials of IBM --&gt;
&lt;!-- --&gt;
&lt;!-- Product(s): --&gt;
&lt;!-- --&gt;
&lt;!-- (C)Copyright IBM Corp. 2005, 2005 --&gt;
&lt;!-- All Rights Reserved --&gt;
&lt;!-- --&gt;
&lt;!-- US Government Users Restricted Rights - Use, duplication or --&gt;
&lt;!-- disclosure restriced by GSA ADP Schedule Contract with IBM Corp. --&gt;
&lt;!-- --&gt;
&lt;!-- --&gt;
&lt;!-- --&gt;
&lt;!-- end_generated_IBM_copyright_prolog --&gt;
&lt;wsdl:definitions name="ResourceIdentification"
targetNamespace=<a class="moz-txt-link-rfc2396E" href=" http://www.ibm.com/xmlns/prod/rvs/2005/05/ResourceIdentifica tion.wsdl">" http://www.ibm.com/xmlns/prod/rvs/2005/05/ResourceIdentifica tion.wsdl"</a>
xmlns:wsdl=<a class="moz-txt-link-rfc2396E" href="http://schemas.xmlsoap.org/wsdl/">"http://schemas.xmlsoap.org/wsdl/"</a>
xmlns:xsd=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
xmlns:wsrf-rp=<a class="moz-txt-link-rfc2396E" href=" http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProp erties-1.2-draft-05.xsd">" http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProp erties-1.2-draft-05.xsd"</a>
xmlns=<a class="moz-txt-link-rfc2396E" href="http://schemas.xmlsoap.org/wsdl/">"http://schemas.xmlsoap.org/wsdl/"</a>&gt;
&lt;wsdl:types&gt;
&lt;xsd:schema targetNamespace=<a class="moz-txt-link-rfc2396E" href=" http://www.ibm.com/xmlns/prod/rvs/2005/05/ResourceIdentifica tion.wsdl">" http://www.ibm.com/xmlns/prod/rvs/2005/05/ResourceIdentifica tion.wsdl"</a>
xmlns:rvs-mr-ri=<a class="moz-txt-link-rfc2396E" href=" http://www.ibm.com/xmlns/prod/rvs/2005/05/ResourceIdentifica tion.xsd">" http://www.ibm.com/xmlns/prod/rvs/2005/05/ResourceIdentifica tion.xsd"</a>
xmlns=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
xmlns:xsd=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>&gt;
&lt;xsd:import namespace=<a class="moz-txt-link-rfc2396E" href=" http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProp erties-1.2-draft-05.xsd">" http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProp erties-1.2-draft-05.xsd"</a>
schemaLocation="WS-ResourceProperties.xsd"/&gt;
&lt;xsd:import namespace=<a class="moz-txt-link-rfc2396E" href=" http://www.ibm.com/xmlns/prod/rvs/2005/05/ResourceIdentifica tion.xsd">" http://www.ibm.com/xmlns/prod/rvs/2005/05/ResourceIdentifica tion.xsd"</a>
schemaLocation="ResourceIdentification.xsd"/&gt;
&lt;/xsd:schema&gt;
&lt;/wsdl:types&gt;
&lt;wsdl:portType name="ResourceIdentification" wsrf-rp:ResourceProperties="rvs-mr-ri:ResourceIdentificationProperties "&gt;
&lt;/wsdl:portType&gt;
&lt;/wsdl:definitions&gt;
</pre>
</blockquote>
<br>
</body>
</html>

--------------020404050508090906030409--
Previous Topic:The content model with 10,006 states is too large
Next Topic:Re: Problem when extracting XSD from WSDL
Goto Forum:
  


Current Time: Sun Nov 23 07:46:29 GMT 2014

Powered by FUDForum. Page generated in 0.01764 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software