ws-wsrf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r326665 - in /webservices/wsrf/trunk/src: java/org/apache/ws/resource/metadataexchange/v2004_09/porttype/impl/MetadataExchangePortTypeImpl.java templates/v2004_09/GetMetadata.txt
Date Wed, 19 Oct 2005 20:01:12 GMT
Author: scamp
Date: Wed Oct 19 13:01:06 2005
New Revision: 326665

URL: http://svn.apache.org/viewcvs?rev=326665&view=rev
Log: (empty)

Modified:
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/metadataexchange/v2004_09/porttype/impl/MetadataExchangePortTypeImpl.java
    webservices/wsrf/trunk/src/templates/v2004_09/GetMetadata.txt

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/metadataexchange/v2004_09/porttype/impl/MetadataExchangePortTypeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/metadataexchange/v2004_09/porttype/impl/MetadataExchangePortTypeImpl.java?rev=326665&r1=326664&r2=326665&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/metadataexchange/v2004_09/porttype/impl/MetadataExchangePortTypeImpl.java
(original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/metadataexchange/v2004_09/porttype/impl/MetadataExchangePortTypeImpl.java
Wed Oct 19 13:01:06 2005
@@ -15,14 +15,12 @@
  *=============================================================================*/
 package org.apache.ws.resource.metadataexchange.v2004_09.porttype.impl;
 
-import java.io.IOException;
 import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.ws.Soap1_1Constants;
 import org.apache.ws.resource.AbstractPortType;
 import org.apache.ws.resource.NamespaceVersionHolder;
 import org.apache.ws.resource.ResourceContext;
@@ -33,8 +31,6 @@
 import org.apache.ws.util.XmlBeanUtils;
 import org.apache.ws.util.jndi.tools.MetadataConfigImpl;
 import org.apache.ws.util.jndi.tools.MetadataEntry;
-import org.apache.ws.util.soap.SoapClient;
-import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 import org.xmlsoap.schemas.soap.envelope.Envelope;
 import org.xmlsoap.schemas.soap.envelope.EnvelopeDocument;
@@ -141,50 +137,8 @@
 	 * @return AnyXmlType response document.
 	 */
 	public AnyXmlType get() {
-		AnyXmlType anyXmlType = AnyXmlType.Factory.newInstance();
-		MetadataConfigImpl metadataConfig = getResourceContext().getResourceHome().getMetadataConfig();
-
-		if(metadataConfig != null)
-		{
-		// get all the registered metadata
-		List allMetadata = metadataConfig.getAllMetadata();
-		Iterator iterator = allMetadata.iterator();
-		while (iterator.hasNext()) {
-			MetadataEntry metadataEntry = (MetadataEntry) iterator.next();
-
-			XmlObject metadata = metadataEntry.getMetadata();
-
-			/** Determine type of metadata to add * */
-			if (metadata instanceof MetadataReferenceDocument) {
-				// must load actual metadata using MetadataReference
-				try {
-					metadata = loadMetadataFromEPR(((MetadataReferenceDocument) metadata)
-							.getMetadataReference());
-				} catch (Exception e) {
-					throw new RuntimeException(
-							"Unable to retrieve metadata from the configured EPR: "
-									+ metadata, e);
-				}
-			} else if (metadata instanceof LocationDocument) {
-				try {
-					metadata = loadMetadataFromURL(((LocationDocument) metadata)
-							.getLocation());
-				} catch (Exception e) {
-					// not sure if we should ignore a problem and send the
-					// rest...
-					throw new RuntimeException(
-							"Unable to retrieve metadata from the configured URL: "
-									+ ((LocationDocument) metadata)
-											.getLocation(), e);
-				}
-			}
-
-			XmlBeanUtils.addChildElement(anyXmlType, (XmlObject) metadata);
-		}
-		}
-		getResourceContext().setResponseAction(
-				URI.create(MetadataExchangeConstants.ACTION_GET_RESPONSE));
-		return anyXmlType;
+		//todo spec says may use WS-Addressing ActionNotSupported
+		throw new FaultException(Soap1_1Constants.FAULT_SERVER,"Unimplemented Operation.");
 	}
 
 	/**
@@ -250,37 +204,5 @@
 		return metadataDocument;
 	}
 
-	/**
-	 * Loads metadata off of an EPR.
-	 * 
-	 * @param epr
-	 * @return
-	 * @throws IOException
-	 * @throws URISyntaxException
-	 * @throws XmlException
-	 */
-	private XmlObject loadMetadataFromEPR(EndpointReferenceType epr)
-			throws IOException, URISyntaxException, XmlException {
-		String address = epr.getAddress().getStringValue();
-
-		// send WS-MEX Get request
-		EnvelopeDocument envelope = buildSoapEnvelopeForGet(address, epr);
-		String response = SoapClient.sendRequest(new URL(address), envelope
-				.newInputStream(), new URI(
-				MetadataExchangeConstants.ACTION_GET_REQUEST));
-		return XmlObject.Factory.parse(response);
-	}
 
-	/**
-	 * Loads metadata off of a URL.
-	 * 
-	 * @param s
-	 * @return
-	 * @throws IOException
-	 * @throws XmlException
-	 */
-	private XmlObject loadMetadataFromURL(String s) throws IOException,
-			XmlException {
-		return XmlObject.Factory.parse(new URL(s));
-	}
 }

Modified: webservices/wsrf/trunk/src/templates/v2004_09/GetMetadata.txt
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/templates/v2004_09/GetMetadata.txt?rev=326665&r1=326664&r2=326665&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/templates/v2004_09/GetMetadata.txt (original)
+++ webservices/wsrf/trunk/src/templates/v2004_09/GetMetadata.txt Wed Oct 19 13:01:06 2005
@@ -5,7 +5,4 @@
    return new org.apache.ws.resource.metadataexchange.v2004_09.porttype.impl.MetadataExchangePortTypeImpl(
getResourceContext(  ) ).getMetadata( request);
 }
 
-public org.xmlsoap.schemas.ws.x2004.x09.mex.AnyXmlType get()
-{
-   return new org.apache.ws.resource.metadataexchange.v2004_09.porttype.impl.MetadataExchangePortTypeImpl(
getResourceContext(  ) ).get();
-}
\ No newline at end of file
+public abstract org.xmlsoap.schemas.ws.x2004.x09.mex.AnyXmlType get();
\ No newline at end of file



Mime
View raw message