Author: dkulp
Date: Wed Feb 27 10:34:35 2008
New Revision: 631672
URL: http://svn.apache.org/viewvc?rev=631672&view=rev
Log:
Merged revisions 631667 via svnmerge from
https://svn.apache.org/repos/asf/incubator/cxf/trunk
........
r631667 | dkulp | 2008-02-27 13:18:42 -0500 (Wed, 27 Feb 2008) | 3 lines
[CXF-935] For provider services, allow some flexibility with mapping to the
wsdl
Add "war" option for the jaxws_dispatch_provider sample
........
Added:
incubator/cxf/branches/2.0.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/wsdl/cxf-servlet.xml
- copied unchanged from r631667,
incubator/cxf/trunk/distribution/src/main/release/samples/jaxws_dispatch_provider/wsdl/cxf-servlet.xml
Modified:
incubator/cxf/branches/2.0.x-fixes/ (props changed)
incubator/cxf/branches/2.0.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/build.xml
incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/Messages.properties
Propchange: incubator/cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
incubator/cxf/branches/2.0.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/build.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/build.xml?rev=631672&r1=631671&r2=631672&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/build.xml
(original)
+++
incubator/cxf/branches/2.0.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/build.xml
Wed Feb 27 10:34:35 2008
@@ -37,4 +37,14 @@
<wsdl2java file="hello_world.wsdl" servicename.arg="-sn SOAPService3"/>
</target>
+ <property name="cxf.war.file.name" value="helloworld_provider"/>
+ <target name="war" depends="build">
+ <cxfwar filename="${cxf.war.file.name}.war"/>
+ </target>
+
+ <target name="client-servlet" description="run demo client hitting
servlet" depends="build">
+ <property name="param" value=""/>
+ <cxfrun classname="demo.hwDispatch.client.Client"
param1="${base.url}/helloworld_provider/services/SOAPPort1?wsdl"/>
+ </target>
+
</project>
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?rev=631672&r1=631671&r2=631672&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
Wed Feb 27 10:34:35 2008
@@ -26,9 +26,13 @@
import java.util.Arrays;
import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
import javax.wsdl.Operation;
import javax.xml.bind.annotation.XmlNsForm;
import javax.xml.bind.annotation.XmlSchema;
+import javax.xml.namespace.QName;
import javax.xml.ws.AsyncHandler;
import javax.xml.ws.Service;
import javax.xml.ws.Service.Mode;
@@ -36,6 +40,7 @@
import org.apache.cxf.binding.AbstractBindingFactory;
import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.common.util.StringUtils;
import org.apache.cxf.databinding.source.SourceDataBinding;
import org.apache.cxf.endpoint.Endpoint;
@@ -63,6 +68,8 @@
* @see org.apache.cxf.jaxws.JaxWsServerFactoryBean
*/
public class JaxWsServiceFactoryBean extends ReflectionServiceFactoryBean {
+ private static final Logger LOG =
LogUtils.getLogger(JaxWsServiceFactoryBean.class);
+
private AbstractServiceConfiguration jaxWsConfiguration;
private JaxWsImplementorInfo implInfo;
@@ -181,23 +188,43 @@
ParameterizedType pt = (ParameterizedType)genericInterfaces[0];
Class c = (Class)pt.getActualTypeArguments()[0];
+ if (getEndpointInfo() == null
+ && isFromWsdl()) {
+ //most likely, they specified a WSDL, but for some reason
+ //did not give a valid ServiceName/PortName. For provider,
+ //we'll allow this since everything is bound directly to
+ //the invoke method, however, this CAN cause other problems
+ //such as addresses in the wsdl not getting updated and such
+ //so we'll WARN about it.....
+ List<QName> enames = new ArrayList<QName>();
+ for (ServiceInfo si : getService().getServiceInfos()) {
+ for (EndpointInfo ep : si.getEndpoints()) {
+ enames.add(ep.getName());
+ }
+ }
+ LOG.log(Level.WARNING, "COULD_NOT_FIND_ENDPOINT",
+ new Object[] {getEndpointName(), enames});
+ }
+
try {
Method invoke = getServiceClass().getMethod("invoke", c);
- // Bind each operation to the invoke method.
- for (OperationInfo o :
getEndpointInfo().getService().getInterface().getOperations()) {
- getMethodDispatcher().bind(o, invoke);
+ // Bind every operation to the invoke method.
+ for (ServiceInfo si : getService().getServiceInfos()) {
+ for (OperationInfo o : si.getInterface().getOperations()) {
+ getMethodDispatcher().bind(o, invoke);
+ }
+ for (BindingInfo bi : si.getBindings()) {
+
bi.setProperty(AbstractBindingFactory.DATABINDING_DISABLED, Boolean.TRUE);
+ }
}
-
} catch (SecurityException e) {
throw new ServiceConstructionException(e);
} catch (NoSuchMethodException e) {
throw new ServiceConstructionException(e);
}
- for (BindingInfo bi : getEndpointInfo().getService().getBindings()) {
- bi.setProperty(AbstractBindingFactory.DATABINDING_DISABLED,
Boolean.TRUE);
- }
+
}
void initializeWrapping(OperationInfo o, Method selected) {
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/Messages.properties
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/Messages.properties?rev=631672&r1=631671&r2=631672&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/Messages.properties
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/Messages.properties
Wed Feb 27 10:34:35 2008
@@ -24,3 +24,4 @@
ILLEGAL_ATTRIBUTE_IN_SEI_ANNOTATION_EXC = Attributes portName, serviceName and
endpointInterface are not allowed in the @WebService annotation of an SEI.
MALFORMED_URL_IN_WEBSERVICE_ANNOTATION_EXC = Malformed url in @WebService
annotation attribute wsdlLocation.
LOAD_WSDL_EXC = Could not load WSDL from URL {0}.
+COULD_NOT_FIND_ENDPOINT = Could not find endpoint named {0}. Possible values
are {1}.