Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 64083 invoked from network); 21 Nov 2007 08:27:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Nov 2007 08:27:39 -0000 Received: (qmail 72498 invoked by uid 500); 21 Nov 2007 08:27:26 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 72446 invoked by uid 500); 21 Nov 2007 08:27:26 -0000 Mailing-List: contact cxf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-commits@incubator.apache.org Received: (qmail 72435 invoked by uid 99); 21 Nov 2007 08:27:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Nov 2007 00:27:26 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Nov 2007 08:27:24 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id ECF791A983E; Wed, 21 Nov 2007 00:27:17 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r596982 - in /incubator/cxf/trunk/rt/frontend/jaxws/src: main/java/org/apache/cxf/jaxws/spi/ test/java/org/apache/cxf/jaxws/ test/java/org/apache/cxf/jaxws/resources/ Date: Wed, 21 Nov 2007 08:27:13 -0000 To: cxf-commits@incubator.apache.org From: jliu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071121082717.ECF791A983E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jliu Date: Wed Nov 21 00:27:12 2007 New Revision: 596982 URL: http://svn.apache.org/viewvc?rev=596982&view=rev Log: Add support for Provider.readEndpointReference(Source infoset). Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/Messages.properties incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/EndpointReferenceTest.java incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/resources/hello_world_soap_http_infoset.xml Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/Messages.properties URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/Messages.properties?rev=596982&r1=596981&r2=596982&view=diff ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/Messages.properties (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/Messages.properties Wed Nov 21 00:27:12 2007 @@ -20,3 +20,5 @@ # INVALID_IMPLEMENTOR_EXC = Cannot create Endpoint for implementor that does not have a WebService annotation and does not implement the Provider interface ENDPOINT_CREATION_FAILED_MSG = Failed to create endpoint +JAXBCONTEXT_CREATION_FAILED = Failed to create JAXBContext for W3CEndpointReference. +ERROR_UNMARSHAL_ENDPOINTREFERENCE = Failed to unmarshal EndpointReference from inforset. Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java?rev=596982&r1=596981&r2=596982&view=diff ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java Wed Nov 21 00:27:12 2007 @@ -22,6 +22,10 @@ import java.net.URL; import java.util.List; import java.util.logging.Logger; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; import javax.xml.namespace.QName; import javax.xml.transform.Source; import javax.xml.ws.Endpoint; @@ -46,6 +50,8 @@ public static final String JAXWS_PROVIDER = ProviderImpl.class.getName(); private static final Logger LOG = LogUtils.getL7dLogger(ProviderImpl.class); + + private static JAXBContext jaxbContext; @Override public ServiceDelegate createServiceDelegate(URL url, @@ -93,7 +99,24 @@ } public EndpointReference readEndpointReference(Source eprInfoset) { - throw new UnsupportedOperationException(); + try { + Unmarshaller unmarshaller = getJAXBContext().createUnmarshaller(); + return (EndpointReference)unmarshaller.unmarshal(eprInfoset); + } catch (JAXBException e) { + throw new WebServiceException( + new Message("ERROR_UNMARSHAL_ENDPOINTREFERENCE", LOG).toString(), e); + } + } + + private JAXBContext getJAXBContext() { + if (jaxbContext == null) { + try { + jaxbContext = JAXBContext.newInstance(W3CEndpointReference.class); + } catch (JAXBException e) { + throw new WebServiceException(new Message("JAXBCONTEXT_CREATION_FAILED", LOG).toString(), e); + } + } + return jaxbContext; } } Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/EndpointReferenceTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/EndpointReferenceTest.java?rev=596982&r1=596981&r2=596982&view=diff ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/EndpointReferenceTest.java (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/EndpointReferenceTest.java Wed Nov 21 00:27:12 2007 @@ -249,7 +249,6 @@ } @Test - @Ignore("Not implemented yet") public void testProviderReadEndpointReference() throws Exception { ProviderImpl provider = new ProviderImpl(); Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/resources/hello_world_soap_http_infoset.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/resources/hello_world_soap_http_infoset.xml?rev=596982&r1=596981&r2=596982&view=diff ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/resources/hello_world_soap_http_infoset.xml (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/resources/hello_world_soap_http_infoset.xml Wed Nov 21 00:27:12 2007 @@ -1,9 +1,8 @@ - + http://localhost:8080/test -