Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 43414 invoked from network); 21 Apr 2005 10:41:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Apr 2005 10:41:38 -0000 Received: (qmail 48577 invoked by uid 500); 21 Apr 2005 10:41:47 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 48533 invoked by uid 500); 21 Apr 2005 10:41:47 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 48518 invoked by uid 99); 21 Apr 2005 10:41:47 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Thu, 21 Apr 2005 03:41:47 -0700 Received: (qmail 43345 invoked by uid 65534); 21 Apr 2005 10:41:33 -0000 Message-ID: <20050421104133.43344.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: svn commit: r164030 - in /webservices/axis/trunk/java/modules: core/src/org/apache/axis/engine/AxisEngine.java core/src/org/apache/axis/engine/RequestURIBasedDispatcher.java samples/test/org/apache/axis/integration/UtilServer.java Date: Thu, 21 Apr 2005 10:41:33 -0000 To: axis-cvs@ws.apache.org From: hemapani@apache.org X-Mailer: svnmailer-1.0.0-dev X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: hemapani Date: Thu Apr 21 03:41:31 2005 New Revision: 164030 URL: http://svn.apache.org/viewcvs?rev=3D164030&view=3Drev Log: add URL based diaptacher to pick the service from URL Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/Axi= sEngine.java webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/Req= uestURIBasedDispatcher.java webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integr= ation/UtilServer.java Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engi= ne/AxisEngine.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core= /src/org/apache/axis/engine/AxisEngine.java?rev=3D164030&r1=3D164029&r2=3D1= 64030&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/Axi= sEngine.java (original) +++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/Axi= sEngine.java Thu Apr 21 03:41:31 2005 @@ -152,6 +152,7 @@ if (context.isServerSide()) { //This chain is the default Service diaptacher, the users = may opt to overide this by=20 //adding an Handlers to the DispatchPhase.=20 + dispatchPhase.addHandler(new RequestURIBasedDispatcher()); AddressingBasedDispatcher dispatcher =3D new AddressingBasedDispatcher(); dispatchPhase.addHandler(dispatcher); Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engi= ne/RequestURIBasedDispatcher.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core= /src/org/apache/axis/engine/RequestURIBasedDispatcher.java?rev=3D164030&r1= =3D164029&r2=3D164030&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/Req= uestURIBasedDispatcher.java (original) +++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/Req= uestURIBasedDispatcher.java Thu Apr 21 03:41:31 2005 @@ -18,23 +18,24 @@ import javax.xml.namespace.QName; =20 import org.apache.axis.addressing.EndpointReference; +import org.apache.axis.context.EngineContext; import org.apache.axis.context.MessageContext; -import org.apache.axis.context.OperationContext; import org.apache.axis.context.ServiceContext; -import org.apache.axis.description.AxisOperation; import org.apache.axis.description.AxisService; import org.apache.axis.description.HandlerMetadata; import org.apache.axis.handlers.AbstractHandler; -import org.apache.wsdl.WSDLService; =20 /** * Class Dispatcher */ -public class RequestURIBasedDispatcher extends AbstractHandler implements = Handler { +public class RequestURIBasedDispatcher + extends AbstractHandler + implements Handler { /** * Field NAME */ - public static final QName NAME =3D new QName("http://axis.ws.apache.or= g", "RequestURIBasedDispatcher"); + public static final QName NAME =3D + new QName("http://axis.ws.apache.org", "RequestURIBasedDispatcher"= ); private AxisService service; =20 /** @@ -60,35 +61,26 @@ int index =3D filePart.lastIndexOf(URI_ID_STRING); String serviceStr =3D null; if (index > 0) { - serviceStr =3D filePart.substring(index + URI_ID_STRING.le= ngth() + 1); - EngineConfiguration registry =3D msgctx.getEngineContext()= .getEngineConfig(); + serviceStr =3D + filePart.substring(index + URI_ID_STRING.length() + 1)= ; + + EngineContext engineContext =3D msgctx.getEngineContext(); QName serviceName =3D new QName(serviceStr); - service =3D registry.getService(serviceName); - ServiceContext serviceContext =3D new ServiceContext(servi= ce); - if (service !=3D null) { - msgctx.setServiceContext(serviceContext); - msgctx.setMessageStyle(service.getStyle()); - } else { - throw new AxisFault("Service " + serviceName + " is no= t found"); - } + ServiceContext serviceContext =3D + engineContext.getService(serviceName); + if (serviceContext =3D=3D null) { + EngineConfiguration registry =3D + msgctx.getEngineContext().getEngineConfig(); + service =3D registry.getService(serviceName); + if (service !=3D null) { + serviceContext =3D new ServiceContext(service); + } =20 - } else { - throw new AxisFault("Both the URI and SOAP_ACTION are Null= "); - } - - if (WSDLService.STYLE_DOC.equals(msgctx.getMessageStyle())) { - String soapAction =3D (String) msgctx.getProperty(MessageC= ontext.SOAP_ACTION); - if (soapAction !=3D null) { - soapAction =3D soapAction.replace('"', ' ').trim(); } - - if (soapAction !=3D null && soapAction.trim().length() > 0= ) { - QName operationName =3D new QName(soapAction); - AxisOperation op =3D service.getOperation(operationNam= e); - if (op !=3D null) { - OperationContext opContext =3D new OperationContex= t(op); - msgctx.setOperationContext(opContext); - } + if (serviceContext !=3D null) { + msgctx.setServiceContext(serviceContext); + msgctx.setMessageStyle( + serviceContext.getServiceConfig().getStyle()); } } } else { Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/= integration/UtilServer.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samp= les/test/org/apache/axis/integration/UtilServer.java?rev=3D164030&r1=3D1640= 29&r2=3D164030&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integr= ation/UtilServer.java (original) +++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integr= ation/UtilServer.java Thu Apr 21 03:41:31 2005 @@ -16,6 +16,7 @@ =20 package org.apache.axis.integration; =20 +import java.io.File; import java.net.ServerSocket; =20 import javax.xml.namespace.QName; @@ -49,8 +50,10 @@ if (count =3D=3D 0) { Class erClass =3D Class.forName("org.apache.axis.deployment.En= gineRegistryFactoryImpl"); EngineRegistryFactory erfac =3D (EngineRegistryFactory)erClass= .newInstance(); - EngineContext er =3D=20 - erfac.createEngineRegistry("target/test-resources/samples/= "); + =20 + File file =3D new File("modules/samples/target/test-resources/= samples"); + System.out.println(new File(file,"server.xml").exists()); + EngineContext er =3D erfac.createEngineRegistry(file.getAbsolu= tePath()); try { Thread.sleep(2000); } catch (InterruptedException e1) {