Add a little bit more code to include the JAXWSMessageReciever so I can debug some samples and see if there is any mileage in this approach

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@957864 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
slaws 2010-06-25 09:39:55 +00:00
parent ca7a779c86
commit eb1a98a7d7
5 changed files with 29 additions and 5 deletions

View file

@ -42,6 +42,12 @@
<artifactId>tuscany-interface-wsdl</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-interface-java</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>

View file

@ -230,7 +230,7 @@ public class Axis2EngineIntegration {
Port port,
WebServiceBinding wsBinding) throws AxisFault {
Definition definition = wsBinding.getWSDLDocument();
Definition definition = wsBinding.getGeneratedWSDLDocument();
QName serviceQName = wsBinding.getService().getQName();
Definition def = getDefinition(definition, serviceQName);

View file

@ -50,7 +50,7 @@ public class JAXWSReferenceBindingProvider implements ReferenceBindingProvider {
this.wsBinding = (WebServiceBinding) endpointReference.getBinding();
// A WSDL document should always be present in the binding
if (wsBinding.getWSDLDocument() == null) {
if (wsBinding.getGeneratedWSDLDocument() == null) {
throw new ServiceRuntimeException("No WSDL document for " + endpointReference.getURI());
}

View file

@ -20,6 +20,7 @@ package org.apache.tuscany.sca.binding.ws.jaxws.axis2;
import java.net.URI;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import javax.wsdl.Port;
@ -28,7 +29,10 @@ import javax.xml.ws.Endpoint;
import org.apache.axiom.om.OMElement;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.description.AxisOperation;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.description.WSDL2Constants;
import org.apache.axis2.engine.MessageReceiver;
import org.apache.axis2.jaxws.binding.BindingUtils;
import org.apache.axis2.jaxws.description.DescriptionFactory;
import org.apache.axis2.jaxws.description.EndpointDescription;
@ -37,6 +41,7 @@ import org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite;
import org.apache.axis2.jaxws.description.builder.WebServiceProviderAnnot;
import org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter;
import org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl;
import org.apache.axis2.jaxws.server.JAXWSMessageReceiver;
import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.FactoryExtensionPoint;
@ -45,6 +50,7 @@ import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
import org.apache.tuscany.sca.host.http.SecurityContext;
import org.apache.tuscany.sca.host.http.ServletHost;
import org.apache.tuscany.sca.interfacedef.InterfaceContract;
import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.invocation.MessageFactory;
import org.apache.tuscany.sca.provider.ServiceBindingProvider;
import org.apache.tuscany.sca.runtime.RuntimeComponent;
@ -96,7 +102,7 @@ public class JAXWSServiceBindingProvider implements ServiceBindingProvider {
contract.getInterface().resetDataBinding(OMElement.class.getName());
// A WSDL document should always be present in the binding
if (wsBinding.getWSDLDocument() == null) {
if (wsBinding.getGeneratedWSDLDocument() == null) {
throw new ServiceRuntimeException("No WSDL document for " + component.getName() + "/" + service.getName());
}
@ -175,11 +181,13 @@ public class JAXWSServiceBindingProvider implements ServiceBindingProvider {
webServiceProviderAnnot.setTargetNamespace(targetNamespace);
webServiceProviderAnnot.setServiceName(wsBinding.getService().getQName().getLocalPart());
webServiceProviderAnnot.setPortName(wsBinding.getPort().getName());
webServiceProviderAnnot.setWsdlLocation("D:/sca-java-2.x-contrib/modules/binding-ws-runtime-jaxws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/wsdlport/helloworld.wsdl");
// adjust the service description to match the service we're actually exposing
DescriptionBuilderComposite dbc = dbcMap.values().iterator().next();
dbc.setWebServiceProviderAnnot(webServiceProviderAnnot);
dbc.setWsdlDefinition(wsBinding.getService().getQName(), wsBinding.getWSDLDefinition().getDefinition());
//dbc.setWsdlDefinition(wsBinding.getService().getQName(), wsBinding.getWSDLDefinition().getDefinition());
List<ServiceDescription> serviceDescList = DescriptionFactoryImpl.createServiceDescriptionFromDBCMap(dbcMap, configContext);
ServiceDescription sd = null;
if (serviceDescList != null && serviceDescList.size() > 0) {
@ -196,6 +204,12 @@ public class JAXWSServiceBindingProvider implements ServiceBindingProvider {
axisService.setName(path);
axisService.setServiceDescription("Tuscany configured AxisService for service: " + deployedURI);
axisService.setClientSide(false);
for (Iterator<?> i = axisService.getOperations(); i.hasNext();) {
AxisOperation axisOp = (AxisOperation)i.next();
axisOp.setMessageReceiver(new JAXWSMessageReceiver());
}
configContext.getAxisConfiguration().addService(axisService);
// fire up the Axis servlet

View file

@ -113,6 +113,8 @@
<messageReceivers>
<!-- Added by Tuscany -->
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
class="org.apache.axis2.jaxws.server.JAXWSMessageReceiver"/>
<!--
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
@ -449,7 +451,9 @@
<handler name="RequestURIOperationDispatcher"
class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
<handler name="SOAPMessageBodyBasedDispatcher"
class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
<handler name="SOAPMessageBodyBasedOperationDispatcher"
class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedOperationDispatcher"/>
<!--
<handler name="HTTPLocationBasedDispatcher"
class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>