You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-commits@ws.apache.org by da...@apache.org on 2006/06/12 18:13:40 UTC

svn commit: r413699 - in /webservices/muse/trunk/modules/muse-wsx: specs/ src/org/apache/muse/ws/metadata/ src/org/apache/muse/ws/metadata/impl/ src/org/apache/muse/ws/metadata/remote/

Author: danj
Date: Mon Jun 12 09:13:39 2006
New Revision: 413699

URL: http://svn.apache.org/viewvc?rev=413699&view=rev
Log:
Initial check-in of IBM-donated code for Muse 2.0 - with 
support for Axis2 (re-try after failure due to problem 
with email to muse-commits).

Currently, the modules that are not implementations of the 
WS-* specs - core, utils, WS-A/SOAP, etc. - have working 
Maven 2.0 build files. Right now they simply compile and 
write to the user's local $module/build directory. I have 
not determined how to get Maven to skip this intermediary 
copy and just put the jars in the user's local repository.

I currently use a script to build each module's POM file, 
but as I learn more about Maven I will hopefully find a way 
to aggregate POM files into one larger project. If not, I 
will provide a simple Ant script.

I'm not sure where the design doc should go, and don't 
want to mess with the web site yet, so please look at the 
design-doc.zip that was uploaded to JIRA along with the 
other IBM contributions until I determine the proper place.

Added:
    webservices/muse/trunk/modules/muse-wsx/specs/WS-MetadataExchange-2004_09.xsd
    webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/MetadataExchange.java
    webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/impl/GetMetadataHandler.java
    webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/impl/GetMetadataRequest.java
    webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/impl/GetMetadataResponse.java
    webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/impl/SimpleMetadataExchange.java
    webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/remote/MetadataExchangeClient.java

Added: webservices/muse/trunk/modules/muse-wsx/specs/WS-MetadataExchange-2004_09.xsd
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsx/specs/WS-MetadataExchange-2004_09.xsd?rev=413699&view=auto
==============================================================================
--- webservices/muse/trunk/modules/muse-wsx/specs/WS-MetadataExchange-2004_09.xsd (added)
+++ webservices/muse/trunk/modules/muse-wsx/specs/WS-MetadataExchange-2004_09.xsd Mon Jun 12 09:13:39 2006
@@ -0,0 +1,113 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!--
+(c) 2004 BEA Systems Inc., Computer Associates International, Inc.,
+International Business Machines Corporation, Microsoft Corporation,
+Inc., SAP AG, Sun Microsystems, and webMethods. All rights reserved. 
+
+Permission to copy and display the WS-MetadataExchange Specification
+(the "Specification"), in any medium without fee or royalty is hereby
+granted, provided that you include the following on ALL copies of the
+Specification that you make:
+
+1.	A link or URL to the Specification at this location.
+2.	The copyright notice as shown in the Specification.
+
+BEA Systems, Computer Associates, IBM, Microsoft, SAP, Sun, and
+webMethods (collectively, the "Authors") each agree to grant you a
+license, under royalty-free and otherwise reasonable,
+non-discriminatory terms and conditions, to their respective essential
+patent claims that they deem necessary to implement the
+WS-MetadataExchange Specification.
+
+THE SPECIFICATION IS PROVIDED "AS IS," AND THE AUTHORS MAKE NO
+REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT
+LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE
+SPECIFICATION ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE
+IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY
+PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+
+THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
+INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY
+USE OR DISTRIBUTION OF THE SPECIFICATIONS.
+
+The name and trademarks of the Authors may NOT be used in any manner,
+including advertising or publicity pertaining to the Specifications or
+their contents without specific, written prior permission. Title to
+copyright in the Specifications will at all times remain with the
+Authors.
+
+No other rights are granted by implication, estoppel or otherwise.
+-->
+
+<xs:schema
+    targetNamespace="http://schemas.xmlsoap.org/ws/2004/09/mex" 
+    xmlns:tns="http://schemas.xmlsoap.org/ws/2004/09/mex" 
+    xmlns:wsa="http://www.w3.org/2005/08/addressing" 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+    elementFormDefault="qualified" >
+
+  <xs:import
+      namespace="http://www.w3.org/2005/08/addressing" 
+      schemaLocation="WS-Addressing-2005_08.xsd" />
+
+  <!-- Get Metadata request -->
+  <xs:element name='GetMetadata' >
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref='tns:Dialect' minOccurs='0' />
+        <xs:element ref='tns:Identifier' minOccurs='0' />
+      </xs:sequence>
+      <xs:anyAttribute namespace='##other' processContents='lax' />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name='Dialect' type='xs:anyURI' />
+  <xs:element name='Identifier' type='xs:anyURI' />
+
+  <!-- Get Metadata response -->
+  <xs:element name='Metadata' >
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref='tns:MetadataSection'
+                    minOccurs='0'
+                    maxOccurs='unbounded' />
+      </xs:sequence>
+      <xs:anyAttribute namespace='##other' processContents='lax' />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name='MetadataSection' >
+    <xs:complexType>
+      <xs:choice>
+        <xs:any namespace='##other'
+                processContents='lax'
+                minOccurs='0'
+                maxOccurs='unbounded' />
+        <xs:element ref='tns:MetadataReference' />
+        <xs:element ref='tns:Location' />
+      </xs:choice>
+      <xs:attribute name='Dialect' type='xs:anyURI' use='required' />
+      <xs:attribute name='Identifier' type='xs:anyURI' />
+      <xs:anyAttribute namespace='##other' processContents='lax' />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name='MetadataReference'
+              type='wsa:EndpointReferenceType' />
+
+  <xs:element name='Location'
+              type='xs:anyURI' />
+
+  <!-- count(/s:Envelope/s:Body/*) = 0 for Get request -->
+
+  <!-- Get Response returns xs:any -->
+
+  <xs:complexType name='AnyXmlType' >
+    <xs:sequence>
+      <xs:any namespace='##any' processContents='lax' />
+    </xs:sequence>
+    <xs:anyAttribute namespace='##any' processContents='lax' />
+  </xs:complexType>
+
+</xs:schema>

Added: webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/MetadataExchange.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/MetadataExchange.java?rev=413699&view=auto
==============================================================================
--- webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/MetadataExchange.java (added)
+++ webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/MetadataExchange.java Mon Jun 12 09:13:39 2006
@@ -0,0 +1,50 @@
+/*=============================================================================*
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+
+package org.apache.muse.ws.metadata;
+
+import org.w3c.dom.Element;
+
+import org.apache.muse.core.Capability;
+
+/**
+ *
+ * MetadataExchange is an internal implementation of the WS-MetadataExchange 
+ * GetMetadata port type; it is based on WS-MEX 09/04. It does not include 
+ * the concept of metadata references, only the direct lookup of metadata 
+ * from the resource itself.
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
+
+public interface MetadataExchange extends Capability
+{
+    /**
+     * 
+     * Returns the XML fragments (sometimes a whole document) that describes 
+     * the desired metadata.
+     *
+     * @param dialect
+     *        The URI describing the type of metadata to search for. This 
+     *        may be WSDL, RMD, WS-Policy, or others.
+     * 
+     * @return The XML fragment(s) that describe the desired metadata. If the 
+     *         resource has no such metadata, the array is empty.
+     *
+     */
+    Element[] getMetadata(String dialect);
+}

Added: webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/impl/GetMetadataHandler.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/impl/GetMetadataHandler.java?rev=413699&view=auto
==============================================================================
--- webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/impl/GetMetadataHandler.java (added)
+++ webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/impl/GetMetadataHandler.java Mon Jun 12 09:13:39 2006
@@ -0,0 +1,53 @@
+/*=============================================================================*
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+
+package org.apache.muse.ws.metadata.impl;
+
+import org.w3c.dom.Element;
+
+import org.apache.muse.core.routing.AbstractMessageHandler;
+import org.apache.muse.ws.metadata.WsxConstants;
+
+/**
+ *
+ * GetMetadataHandler is the parser for the WS-MetadataExchange GetMetadata 
+ * operation.
+ *
+ * @author Dan Jemiolo (danj)
+ * 
+ * @see org.apache.muse.ws.metadata.MetadataExchange
+ *
+ */
+
+public class GetMetadataHandler extends AbstractMessageHandler
+{
+    public GetMetadataHandler()
+    {
+        super(WsxConstants.GET_METADATA_QNAME);
+    }
+
+    public Object[] fromXML(Element xml)
+    {
+        GetMetadataRequest request = new GetMetadataRequest(xml);
+        return new Object[]{ request.getDialect() };
+    }
+
+    public Element toXML(Object result)
+    {
+        GetMetadataResponse get = new GetMetadataResponse((Element[])result);
+        return get.toXML();
+    }
+}

Added: webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/impl/GetMetadataRequest.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/impl/GetMetadataRequest.java?rev=413699&view=auto
==============================================================================
--- webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/impl/GetMetadataRequest.java (added)
+++ webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/impl/GetMetadataRequest.java Mon Jun 12 09:13:39 2006
@@ -0,0 +1,67 @@
+/*=============================================================================*
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+
+package org.apache.muse.ws.metadata.impl;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import org.apache.muse.util.xml.XmlSerializable;
+import org.apache.muse.util.xml.XmlUtils;
+import org.apache.muse.ws.metadata.WsxConstants;
+
+/**
+ *
+ * GetMetadataRequest is a serializer/deserializer for the WS-MetadataExchange 
+ * GetMetadata operation's request content.
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
+
+public class GetMetadataRequest implements XmlSerializable
+{
+    //
+    // The type of metadata to retrieve
+    //
+    private String _dialect = null;
+    
+    public GetMetadataRequest(String dialect)
+    {
+        _dialect = dialect;
+    }
+    
+    public GetMetadataRequest(Element request)
+    {
+        _dialect = XmlUtils.getElementText(request, WsxConstants.DIALECT_QNAME);
+    }
+    
+    public String getDialect()
+    {
+        return _dialect;
+    }
+    
+    public Element toXML()
+    {
+        return toXML(XmlUtils.EMPTY_DOC);
+    }
+    
+    public Element toXML(Document doc)
+    {
+        Element dialect = XmlUtils.createElement(doc, WsxConstants.DIALECT_QNAME, getDialect());
+        return XmlUtils.createElement(doc, WsxConstants.GET_METADATA_QNAME, dialect, false);
+    }
+}

Added: webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/impl/GetMetadataResponse.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/impl/GetMetadataResponse.java?rev=413699&view=auto
==============================================================================
--- webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/impl/GetMetadataResponse.java (added)
+++ webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/impl/GetMetadataResponse.java Mon Jun 12 09:13:39 2006
@@ -0,0 +1,80 @@
+/*=============================================================================*
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+
+package org.apache.muse.ws.metadata.impl;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import org.apache.muse.util.xml.XmlSerializable;
+import org.apache.muse.util.xml.XmlUtils;
+import org.apache.muse.ws.metadata.WsxConstants;
+
+/**
+ *
+ * GetMetadataResponse is a serializer/deserializer for the WS-MetadataExchange 
+ * GetMetadata operation's response content.
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
+
+public class GetMetadataResponse implements XmlSerializable
+{
+    //
+    // The metadata fragments retrieved for GetMetadata (may be empty)
+    //
+    private Element[] _metadata = null;
+    
+    public GetMetadataResponse()
+    {
+        this(new Element[]{});
+    }
+    
+    public GetMetadataResponse(Element[] metadata)
+    {
+        _metadata = metadata;
+    }
+
+    
+    public Element[] getMetadata()
+    {
+        return _metadata;
+    }
+    
+    public boolean isEmpty()
+    {
+        return _metadata.length == 0;
+    }
+    
+    public Element toXML()
+    {
+        return toXML(XmlUtils.EMPTY_DOC);
+    }
+    
+    public Element toXML(Document doc)
+    {
+        Element root = XmlUtils.createElement(doc, WsxConstants.METADATA_QNAME);
+        
+        for (int n = 0; n < _metadata.length; ++n)
+        {
+            Element section = XmlUtils.createElement(doc, WsxConstants.SECTION_QNAME, _metadata[n], false);
+            root.appendChild(section);
+        }
+        
+        return root;
+    }
+}

Added: webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/impl/SimpleMetadataExchange.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/impl/SimpleMetadataExchange.java?rev=413699&view=auto
==============================================================================
--- webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/impl/SimpleMetadataExchange.java (added)
+++ webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/impl/SimpleMetadataExchange.java Mon Jun 12 09:13:39 2006
@@ -0,0 +1,118 @@
+/*=============================================================================*
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+
+package org.apache.muse.ws.metadata.impl;
+
+import java.lang.reflect.Method;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import org.apache.muse.core.AbstractCapability;
+import org.apache.muse.core.Environment;
+import org.apache.muse.core.Resource;
+import org.apache.muse.core.routing.MessageHandler;
+import org.apache.muse.util.ReflectUtils;
+import org.apache.muse.util.xml.XmlUtils;
+import org.apache.muse.ws.addressing.soap.SoapFault;
+import org.apache.muse.ws.metadata.MetadataExchange;
+import org.apache.muse.ws.metadata.WsxConstants;
+import org.apache.muse.ws.wsdl.WsdlUtils;
+
+/**
+ *
+ * SimpleMetadataExchange is Muse's default implementation of the 
+ * WS-MetadataExchange GetMetadata port type. The only supported 
+ * metadata type (dialect) is WSDL.
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
+
+public class SimpleMetadataExchange 
+    extends AbstractCapability implements MetadataExchange
+{
+    private static final Element[] _NOT_FOUND = new Element[0];
+    
+    protected MessageHandler createGetMetadataHandler()
+    {
+        MessageHandler handler = new GetMetadataHandler();
+        
+        try
+        {
+            Method method = ReflectUtils.getFirstMethod(getClass(), "getMetadata");
+            handler.setMethod(method);
+        }
+        
+        catch (Throwable error)
+        {
+            throw new RuntimeException(error.getMessage(), error);
+        }
+        
+        return handler;
+    }
+    
+    public void initialize() 
+        throws SoapFault
+    {
+        super.initialize();
+        setMessageHandler(createGetMetadataHandler());
+    }
+    
+    public Element[] getMetadata(String dialect)
+    {
+        //
+        // the resource factory has all its metadata/deployment docs
+        //
+        Element metadata = null;
+        
+        //
+        // missing dialect has no defined fault in ws-mex
+        //
+        if (dialect == null)
+            return _NOT_FOUND;
+        
+        //
+        // get WSDL - this is fully resolved (very large!)
+        //
+        else if (dialect.equals(WsxConstants.WSDL_DIALECT))
+            metadata = getWSDL();
+        
+        //
+        // dialect provided, but not type matches it
+        //
+        if (metadata == null)
+            return _NOT_FOUND;
+        
+        return new Element[]{ metadata };
+    }
+    
+    protected Element getWSDL()
+    {
+        Resource owner = getResource();
+        
+        Environment env = owner.getEnvironment();
+        String path = owner.getWsdlPath();
+        
+        Document wsdlDoc = WsdlUtils.createWSDL(env, path, true);
+        Element wsdl = XmlUtils.getFirstElement(wsdlDoc);
+        
+        WsdlUtils.removeWsdlReferences(wsdl);
+        WsdlUtils.removeSchemaReferences(wsdl);
+        
+        return wsdl;
+    }
+}

Added: webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/remote/MetadataExchangeClient.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/remote/MetadataExchangeClient.java?rev=413699&view=auto
==============================================================================
--- webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/remote/MetadataExchangeClient.java (added)
+++ webservices/muse/trunk/modules/muse-wsx/src/org/apache/muse/ws/metadata/remote/MetadataExchangeClient.java Mon Jun 12 09:13:39 2006
@@ -0,0 +1,87 @@
+/*=============================================================================*
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+
+package org.apache.muse.ws.metadata.remote;
+
+import java.net.URI;
+
+import org.w3c.dom.Element;
+
+import org.apache.muse.core.AbstractResourceClient;
+import org.apache.muse.core.Environment;
+import org.apache.muse.util.xml.XmlUtils;
+import org.apache.muse.ws.addressing.EndpointReference;
+import org.apache.muse.ws.addressing.soap.SoapClient;
+import org.apache.muse.ws.addressing.soap.SoapFault;
+import org.apache.muse.ws.metadata.WsxConstants;
+import org.apache.muse.ws.metadata.impl.GetMetadataRequest;
+
+
+public class MetadataExchangeClient extends AbstractResourceClient
+{
+    public MetadataExchangeClient(EndpointReference destination)
+    {
+        super(destination);
+    }
+
+    public MetadataExchangeClient(EndpointReference destination,
+                                  EndpointReference source)
+    {
+        super(destination, source);
+    }
+
+    public MetadataExchangeClient(EndpointReference destination,
+                                  EndpointReference source, 
+                                  Environment environment)
+    {
+        super(destination, source, environment);
+    }
+
+    public MetadataExchangeClient(EndpointReference destination,
+                                  EndpointReference source, 
+                                  SoapClient soapClient)
+    {
+        super(destination, source, soapClient);
+    }
+    
+    public Element[] getMetadata(String dialect)
+        throws SoapFault
+    {
+        URI action = URI.create(WsxConstants.GET_METADATA_URI);
+        GetMetadataRequest get = new GetMetadataRequest(dialect);
+        
+        Element response = invoke(action, get.toXML());
+        
+        //
+        // each child element is a MetadataSection - we want to dig down 
+        // one level deeper and get the actual content for the user
+        //
+        Element[] sections = XmlUtils.getAllElements(response);
+        Element[] metadata = new Element[sections.length];
+        
+        for (int n = 0; n < sections.length; ++n)
+            metadata[n] = XmlUtils.getFirstElement(sections[n]);
+        
+        return metadata;
+    }
+    
+    public Element getWSDL()
+        throws SoapFault
+    {
+        Element[] response = getMetadata(WsxConstants.WSDL_DIALECT);
+        return response.length == 0 ? null : response[0];
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: muse-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-commits-help@ws.apache.org