Hi Deepal, This commit breaks the JAXWSTest. I looked into it some and the problem is that, with the commit below, the MessageReceiver is being set to org.apache.axis2.rpc.receivers.RPCMessageReceiver instead of the JAXWSMessageReceiver (as specified in the services.xml). I looked into it some, but I wasn't sure what you were trying to accomplish, so I wasn't able to fix it. Please make the necessary changes so that JAXWSTest runs successfully.
In case any of my debugging helps you, here is what I found: (1) The MessageReceiver is set to RPCMessageReceiver instead of JAXWSMessageReceiver. This happens for all the operations on this service. Since this is a JAXWS endpoint, the message receiver must be the JAXWSMessageReceiver (as specified in the services.xml). One example operation is below: ***JLB2: Operation [EMAIL PROTECTED]; ; name: sendImage; setMessageReceiver called [EMAIL PROTECTED] For AxisService [EMAIL PROTECTED]; name: MtomSampleService java.lang.Throwable at java.lang.Thread.dumpStack(Thread.java:447) at org.apache.axis2.description.AxisOperation.setMessageReceiver(AxisOperation.java:528) at org.apache.axis2.deployment.util.Utils.fillAxisService(Utils.java:392) at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:318) at org.apache.axis2.deployment.ServiceGroupBuilder.populateServiceGroup(ServiceGroupBuilder.java:97) at org.apache.axis2.deployment.repository.util.ArchiveReader.buildServiceGroup(ArchiveReader.java:104) at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:172) at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:75) at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:551) at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:188) at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:270) at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:180) at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:110) at org.apache.axis2.deployment.FileSystemConfigurator.loadServices(FileSystemConfigurator.java:125) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:73) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:180) at org.apache.axis2.jaxws.utility.SimpleServer.init(SimpleServer.java:42) at org.apache.axis2.jaxws.utility.SimpleServer.start(SimpleServer.java:52) at org.apache.axis2.jaxws.framework.StartServer.testStartServer(StartServer.java:31) at org.apache.axis2.jaxws.framework.JAXWSTest$1.setUp(JAXWSTest.java:181) at junit.extensions.TestSetup$1.protect(TestSetup.java:20) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.extensions.TestSetup.run(TestSetup.java:25) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567) (2) The actual exception on the server (with Debug enabled) is a NoSuchMethodException. Again, this is a side effect of the wrong MessageReceiver being attached to the operation: 2007-03-01 12:01:16,760 DEBUG org.apache.axis2.engine.DependencyManager - Exception trying to call init java.lang.NoSuchMethodException: org.apache.axis2.jaxws.sample.mtom.MtomSampleService.init(org.apache.axis2.context.ServiceContext) at java.lang.Class.throwNoSuchMethodException(Class.java:271) at java.lang.Class.getMethod(Class.java:748) at org.apache.axis2.engine.DependencyManager.initServiceClass(DependencyManager.java:53) at org.apache.axis2.receivers.AbstractMessageReceiver.getTheImplementationObject(AbstractMessageReceiver.java:168) at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:72) at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:39) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:183) at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:261) at org.apache.axis2.transport.http.HTTPWorker.service(HTTPWorker.java:204) at org.apache.axis2.transport.http.server.AxisHttpService.doService(AxisHttpService.java:140) at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:142) at org.apache.axis2.transport.http.server.AxisHttpService.handleRequest(AxisHttpService.java:194) at org.apache.axis2.transport.http.server.HttpServiceProcessor.run(HttpServiceProcessor.java:76) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690) at java.lang.Thread.run(Thread.java:803) (3) The actual test failure recorded in modules/jaxws/target/test-reports/TEST-org.apache.axis2.jaxws.framework.JAXWSTest.txt is: Testcase: testSendImageAttachmentAPI11(org.apache.axis2.jaxws.sample.MtomSampleTests): Caused an ERROR Exception occurred while trying to invoke service method sendImage javax.xml.ws.soap.SOAPFaultException: Exception occurred while trying to invoke service method sendImage at org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.createSystemException(MethodMarshallerUtils.java:957) at org.apache.axis2.jaxws.client.dispatch.BaseDispatch.getFaultResponse(BaseDispatch.java:360) at org.apache.axis2.jaxws.client.dispatch.BaseDispatch.invoke(BaseDispatch.java:129) at org.apache.axis2.jaxws.sample.MtomSampleTests.testSendImageAttachmentAPI11(MtomSampleTests.java:72) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) at junit.extensions.TestSetup$1.protect(TestSetup.java:21) at junit.extensions.TestSetup.run(TestSetup.java:25) Thanks, Jeff IBM Software Group - WebSphere Web Services Development Phone: 512-838-4587 or Tie Line 678-4587 Internet e-mail and Sametime ID: [EMAIL PROTECTED] ----- Forwarded by Jeff Barrett/Austin/IBM on 03/01/2007 01:00 PM ----- [EMAIL PROTECTED] 03/01/2007 05:33 AM To [EMAIL PROTECTED] cc Subject svn commit: r513283 - in /webservices/axis2/trunk/java/modules: adb/src/org/apache/axis2/databinding/typemapping/ kernel/src/org/apache/axis2/deployment/ kernel/src/org/apache/axis2/deployment/util/ metadata/src/org/apache/axis2/jaxws/description/ Author: deepal Date: Thu Mar 1 03:33:26 2007 New Revision: 513283 URL: http://svn.apache.org/viewvc?view=rev&rev=513283 Log: Change POJO deloyer to use JAX-WS Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/DescriptionFactory.java Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java?view=diff&rev=513283&r1=513282&r2=513283 ============================================================================== --- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java (original) +++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java Thu Mar 1 03:33:26 2007 @@ -36,6 +36,7 @@ private static final String W_FLOAT = "java.lang.Float"; private static final String W_CALENDAR = "java.util.Calendar"; private static final String W_DATE = "java.util.Date"; + private static final String W_DATA_HANDLER = "javax.activation.DataHandler"; private static final String INT = "int"; private static final String BOOLEAN = "boolean"; private static final String BYTE = "byte"; @@ -133,7 +134,6 @@ public static boolean isCollection(Class obj) { return java.util.Collection.class.isAssignableFrom(obj); } - public static boolean isSimpleType(String objClassName) { if (objClassName.equals(STRING)) { return true; Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java?view=diff&rev=513283&r1=513282&r2=513283 ============================================================================== --- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java (original) +++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java Thu Mar 1 03:33:26 2007 @@ -2,6 +2,7 @@ import org.apache.axis2.context.ConfigurationContext; import org.apache.axis2.deployment.repository.util.DeploymentFileData; +import org.apache.axis2.deployment.util.Utils; import org.apache.axis2.description.AxisService; import org.apache.axis2.description.AxisServiceGroup; import org.apache.axis2.engine.MessageReceiver; @@ -81,24 +82,20 @@ * nothing will happen) 2. In the next stage for all the methods * messages and port types will be creteated */ - boolean callJaxWs = false; JAnnotation annotation = jclass.getAnnotation(AnnotationConstants.WEB_SERVICE); if (annotation != null) { - String wsdlLocation = annotation.getValue(AnnotationConstants.WSDL_LOCATION).asString(); - if (wsdlLocation != null && !"".equals(wsdlLocation)) { - callJaxWs = true; - } - } - if (callJaxWs) { Class claxx = Class.forName( "org.apache.axis2.jaxws.description.DescriptionFactory"); Method mthod = claxx.getMethod( - "createServiceDescriptionFromServiceImpl", - new Class[]{Class.class, AxisService.class}); + "createAxisService", + new Class[]{Class.class}); Class pojoClass = Loader.loadClass(classLoader, className); - AxisService axisService = new AxisService(className); - axisService.setName(className); - mthod.invoke(claxx, new Object[]{pojoClass, axisService}); + AxisService axisService = (AxisService)mthod.invoke(claxx, new Object[]{pojoClass}); + Utils.fillAxisService(axisService, + configCtx.getAxisConfiguration(), + new ArrayList(), + new ArrayList()); + configCtx.getAxisConfiguration().addService(axisService); } else { HashMap messageReciverMap = new HashMap(); @@ -177,46 +174,19 @@ * nothing will happen) 2. In the next stage for all the methods * messages and port types will be creteated */ - boolean callJaxWs = false; JAnnotation annotation = jclass.getAnnotation(AnnotationConstants.WEB_SERVICE); if (annotation != null) { - String wsdlLocation = annotation.getValue(AnnotationConstants.WSDL_LOCATION).asString(); - if (wsdlLocation != null && !"".equals(wsdlLocation)) { - callJaxWs = true; - } - } else { - continue; - } - if (callJaxWs) { Class claxx = Class.forName( "org.apache.axis2.jaxws.description.DescriptionFactory"); Method mthod = claxx.getMethod( - "createServiceDescriptionFromServiceImpl", - new Class[]{Class.class, AxisService.class}); + "createAxisService", + new Class[]{Class.class}); Class pojoClass = Loader.loadClass(classLoader, className); - AxisService axisService = new AxisService(className); - axisService.setName(className); - mthod.invoke(claxx, new Object[]{pojoClass, axisService}); - axisServiceList.add(axisService); - } else { - HashMap messageReciverMap = new HashMap(); - Class inOnlyMessageReceiver = Loader.loadClass( - "org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"); - MessageReceiver messageReceiver = - (MessageReceiver) inOnlyMessageReceiver.newInstance(); - messageReciverMap.put( - WSDLConstants.WSDL20_2006Constants.MEP_URI_IN_ONLY, - messageReceiver); - Class inoutMessageReceiver = Loader.loadClass( - "org.apache.axis2.rpc.receivers.RPCMessageReceiver"); - MessageReceiver inOutmessageReceiver = - (MessageReceiver) inoutMessageReceiver.newInstance(); - messageReciverMap.put( - WSDLConstants.WSDL20_2006Constants.MEP_URI_IN_OUT, - inOutmessageReceiver); - AxisService axisService = AxisService.createService(className, + AxisService axisService = (AxisService)mthod.invoke(claxx, new Object[]{pojoClass}); + Utils.fillAxisService(axisService, configCtx.getAxisConfiguration(), - messageReciverMap, null, null, classLoader); + new ArrayList(), + new ArrayList()); axisServiceList.add(axisService); } } Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java?view=diff&rev=513283&r1=513282&r2=513283 ============================================================================== --- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java (original) +++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java Thu Mar 1 03:33:26 2007 @@ -371,7 +371,34 @@ pinfo.setOperationPhases(operation); axisService.addOperation(operation); } - operation.setSoapAction("urn:" + opName); + if(operation.getInputAction()==null){ + operation.setSoapAction("urn:" + opName); + } + String MEP = operation.getMessageExchangePattern(); + if(MEP!=null){ + try { + if(WSDLConstants.WSDL20_2006Constants.MEP_URI_IN_ONLY.equals(MEP) + || WSDLConstants.WSDL20_2004_Constants.MEP_URI_IN_ONLY.equals(MEP)){ + Class inOnlyMessageReceiver = Loader.loadClass( + "org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"); + MessageReceiver messageReceiver = + (MessageReceiver) inOnlyMessageReceiver.newInstance(); + operation.setMessageReceiver(messageReceiver); + } else { + Class inoutMessageReceiver = Loader.loadClass( + "org.apache.axis2.rpc.receivers.RPCMessageReceiver"); + MessageReceiver inOutmessageReceiver = + (MessageReceiver) inoutMessageReceiver.newInstance(); + operation.setMessageReceiver(inOutmessageReceiver); + } + } catch (ClassNotFoundException e) { + log.error(e); + } catch (InstantiationException e) { + log.error(e); + } catch (IllegalAccessException e) { + log.error(e); + } + } } } Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/DescriptionFactory.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/DescriptionFactory.java?view=diff&rev=513283&r1=513282&r2=513283 ============================================================================== --- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/DescriptionFactory.java (original) +++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/DescriptionFactory.java Thu Mar 1 03:33:26 2007 @@ -142,6 +142,21 @@ public static ServiceDescription createServiceDescription(Class serviceImplClass) { return DescriptionFactoryImpl.createServiceDescription(serviceImplClass); } + + /** + * This provide very convenient way of creating an AxisService from an annotated + * java class. + * + * @param serviceImplClass A Web Service implementation class (i.e. one that carries an + * WebService or WebServiceProvider annotation). + * @return An AxisService instance + */ + public static AxisService createAxisService(Class serviceImplClass){ + ServiceDescription serviceDescription = createServiceDescription(serviceImplClass); + EndpointDescription[] edArray = serviceDescription.getEndpointDescriptions(); + AxisService axisService = edArray[0].getAxisService(); + return axisService; + } /** * DO NOT USE THIS METHOD FOR PRODUCTION CODE. It has been deprecated and is only used * to drive some testing. Note that the AxisService and associated Axis description objects --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]