juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcunn...@apache.org
Subject svn commit: r814197 - in /webservices/juddi/trunk: juddi-core/src/main/java/org/apache/juddi/util/JAXBMarshaller.java uddi-client/src/main/java/org/uddi/api_v3/client/local/RequestHandler.java
Date Sat, 12 Sep 2009 16:57:53 GMT
Author: tcunning
Date: Sat Sep 12 16:57:53 2009
New Revision: 814197

URL: http://svn.apache.org/viewvc?rev=814197&view=rev
Log:
JUDDI-277
Add marshalling.

Modified:
    webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/util/JAXBMarshaller.java
    webservices/juddi/trunk/uddi-client/src/main/java/org/uddi/api_v3/client/local/RequestHandler.java

Modified: webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/util/JAXBMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/util/JAXBMarshaller.java?rev=814197&r1=814196&r2=814197&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/util/JAXBMarshaller.java
(original)
+++ webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/util/JAXBMarshaller.java
Sat Sep 12 16:57:53 2009
@@ -31,6 +31,7 @@
 import javax.xml.bind.Unmarshaller;
 
 import org.apache.log4j.Logger;
+import org.w3c.dom.Element;
 
 /**
  * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
@@ -103,5 +104,13 @@
 		
 		return rawObject;
 	}
+
+	public static Element marshallToElement(Object object, String thePackage, Element element)
throws JAXBException {
+		String rawObject = null;
+		JAXBContext jc = JAXBContexts.get(thePackage);
+		Marshaller marshaller = jc.createMarshaller();
+		marshaller.marshal(object, element);	
+		return element;
+	}
 	
 }

Modified: webservices/juddi/trunk/uddi-client/src/main/java/org/uddi/api_v3/client/local/RequestHandler.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/uddi-client/src/main/java/org/uddi/api_v3/client/local/RequestHandler.java?rev=814197&r1=814196&r2=814197&view=diff
==============================================================================
--- webservices/juddi/trunk/uddi-client/src/main/java/org/uddi/api_v3/client/local/RequestHandler.java
(original)
+++ webservices/juddi/trunk/uddi-client/src/main/java/org/uddi/api_v3/client/local/RequestHandler.java
Sat Sep 12 16:57:53 2009
@@ -17,7 +17,6 @@
 
 import java.lang.reflect.Method;
 import java.rmi.Remote;
-import java.util.Vector;
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
@@ -140,24 +139,21 @@
       // Create a new 'temp' XML element to use as a container 
       // in which to marshal the UDDI response data into.
      
-      /*
       DocumentBuilder docBuilder = getDocumentBuilder();
       Document document = docBuilder.newDocument();
       Element element = document.createElement("temp");
-      */
       // Lookup the appropriate response handler and marshal 
       // the juddi object into the appropriate xml format (we 
       // only support UDDI v2.0 at this time).  Attach the
       // results to the body of the SOAP response.
-        
-      //responseHandler.marshal(uddiResObj,element);
+      JAXBMarshaller.marshallToElement(result, "org.uddi.api_v3", element);
       
       // Grab a reference to the 'temp' element's
       // only child here (this has the effect of
       // discarding the temp element) and append 
       // this child to the soap response body
-      //document.appendChild(element.getFirstChild());
-      //setResponse(document);
+      document.appendChild(element.getFirstChild());
+      setResponse(document);
       throw new FatalErrorException(new ErrorMessage(""));
     }
     catch (RegistryException rex) 



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


Mime
View raw message