Return-Path: Delivered-To: apmail-ws-axis-cvs-archive@www.apache.org Received: (qmail 66147 invoked from network); 30 Jun 2005 04:24:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Jun 2005 04:24:21 -0000 Received: (qmail 38737 invoked by uid 500); 30 Jun 2005 04:24:19 -0000 Delivered-To: apmail-ws-axis-cvs-archive@ws.apache.org Received: (qmail 38643 invoked by uid 500); 30 Jun 2005 04:24:19 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 38630 invoked by uid 99); 30 Jun 2005 04:24:19 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 29 Jun 2005 21:24:18 -0700 Received: (qmail 66112 invoked by uid 65534); 30 Jun 2005 04:24:16 -0000 Message-ID: <20050630042416.66111.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r202478 - in /webservices/axis/trunk/java/modules: core/src/org/apache/axis/clientapi/ wsdl/src/org/apache/axis/wsdl/codegen/emitter/ wsdl/src/org/apache/axis/wsdl/template/java/ Date: Thu, 30 Jun 2005 04:24:15 -0000 To: axis-cvs@ws.apache.org From: ajith@apache.org X-Mailer: svnmailer-1.0.2 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: ajith Date: Wed Jun 29 21:24:12 2005 New Revision: 202478 URL: http://svn.apache.org/viewcvs?rev=202478&view=rev Log: Changed some parts of the databinder 1. Added the soap action to the templates 2. Fixed the generation of the client side code with the serverside code generation Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/MEPClient.java webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/emitter/MultiLanguageClientEmitter.java webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/InterfaceImplementationTemplate.xsl webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/MessageReceiverTemplate.xsl Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/MEPClient.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/MEPClient.java?rev=202478&r1=202477&r2=202478&view=diff ============================================================================== --- webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/MEPClient.java (original) +++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/MEPClient.java Wed Jun 29 21:24:12 2005 @@ -42,6 +42,14 @@ protected String soapVersionURI = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI; protected String soapAction = ""; + public String getSoapAction() { + return soapAction; + } + + public void setSoapAction(String soapAction) { + this.soapAction = soapAction; + } + public MEPClient(ServiceContext service, String mep) { this.serviceContext = service; this.mep = mep; Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/emitter/MultiLanguageClientEmitter.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/emitter/MultiLanguageClientEmitter.java?rev=202478&r1=202477&r2=202478&view=diff ============================================================================== --- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/emitter/MultiLanguageClientEmitter.java (original) +++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/emitter/MultiLanguageClientEmitter.java Wed Jun 29 21:24:12 2005 @@ -92,7 +92,7 @@ private static final String DATABINDING_PACKAGE_NAME_SUFFIX =".databinding"; private static final String TEST_SERVICE_CLASS_NAME_SUFFIX ="SkeletonTest"; private static final String MESSAGE_RECEIVER_SUFFIX = "MessageReceiver"; - + protected InputStream xsltStream = null; protected CodeGenConfiguration configuration; @@ -239,7 +239,7 @@ protected void writeSkeleton(WSDLBinding axisBinding) throws Exception { //Note - One can generate the skeleton using the interface XML - XmlDocument skeletonModel = createDOMDocuementForInterface(axisBinding); + XmlDocument skeletonModel = createDOMDocuementForSkeleton(axisBinding); ClassWriter skeletonWriter = new SkeletonWriter(this.configuration.getOutputLocation(), this.configuration.getOutputLanguage() ); @@ -307,9 +307,9 @@ ); writeClass(interfaceImplModel,writer); } - + protected void writeMessageReceiver(WSDLBinding axisBinding)throws Exception{ - if (configuration.isWriteMessageReceiver()){ + if (configuration.isWriteMessageReceiver()){ XmlDocument classModel = createDocumentForMessageReceiver(axisBinding); MessageReceiverWriter writer = new MessageReceiverWriter(this.configuration.getOutputLocation(), @@ -367,17 +367,18 @@ writeSkeleton(axisBinding); //write interface implementations writeServiceXml(axisBinding); - //write the test classes - writeTestClasses(axisBinding); //write the local test classes writeLocalTestClasses(axisBinding); - writeDatabindingSupporters(axisBinding); //write a dummy implementation call for the tests to run. writeTestSkeletonImpl(axisBinding); //write a testservice.xml that will load the dummy skeleton impl for testing writeTestServiceXML(axisBinding); //write a MessageReceiver for this particular service. writeMessageReceiver(axisBinding); + ////////////////////////////////////// + // Call the emit stub method to generate the client side too + emitStub(); + } catch (Exception e) { e.printStackTrace(); throw new CodeGenerationException(e); @@ -496,10 +497,10 @@ return doc; } - - + + protected XmlDocument createDocumentForMessageReceiver(WSDLBinding binding){ - WSDLInterface boundInterface = binding.getBoundInterface(); + WSDLInterface boundInterface = binding.getBoundInterface(); XmlDocument doc = new XmlDocument(); Element rootElement = doc.createElement("interface"); @@ -512,13 +513,13 @@ fillSyncAttributes(doc, rootElement); loadOperations(boundInterface, doc, rootElement, binding); doc.appendChild(rootElement); - + try { - doc.write(System.out); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + doc.write(System.out); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } return doc; } @@ -533,11 +534,7 @@ XmlDocument doc = new XmlDocument(); Element rootElement = doc.createElement("interface"); addAttribute(doc,"package",configuration.getPackageName(), rootElement); - if(this.configuration.isServerSide()){ - addAttribute(doc,"name",boundInterface.getName().getLocalPart()+SERVICE_CLASS_SUFFIX,rootElement); - }else{ - addAttribute(doc,"name",boundInterface.getName().getLocalPart(),rootElement); - } + addAttribute(doc,"name",boundInterface.getName().getLocalPart(),rootElement); addAttribute(doc,"callbackname",boundInterface.getName().getLocalPart() + CALL_BACK_HANDLER_SUFFIX,rootElement); fillSyncAttributes(doc, rootElement); loadOperations(boundInterface, doc, rootElement); @@ -546,6 +543,20 @@ } + protected XmlDocument createDOMDocuementForSkeleton(WSDLBinding binding){ + WSDLInterface boundInterface = binding.getBoundInterface(); + + XmlDocument doc = new XmlDocument(); + Element rootElement = doc.createElement("interface"); + addAttribute(doc,"package",configuration.getPackageName(), rootElement); + addAttribute(doc,"name",boundInterface.getName().getLocalPart()+SERVICE_CLASS_SUFFIX,rootElement); + addAttribute(doc,"callbackname",boundInterface.getName().getLocalPart() + CALL_BACK_HANDLER_SUFFIX,rootElement); + fillSyncAttributes(doc, rootElement); + loadOperations(boundInterface, doc, rootElement); + doc.appendChild(rootElement); + return doc; + + } private void fillSyncAttributes(XmlDocument doc, Element rootElement) { addAttribute(doc,"isAsync",this.configuration.isAsyncOn()?"1":"0",rootElement); addAttribute(doc,"isSync",this.configuration.isSyncOn()?"1":"0",rootElement); @@ -582,21 +593,21 @@ } - private void addSOAPAction(XmlDocument doc,Element rootElement,WSDLBindingOperation binding){ - Iterator extIterator = binding.getExtensibilityElements().iterator(); - boolean actionAdded = false; - while(extIterator.hasNext()){ - WSDLExtensibilityElement element = (WSDLExtensibilityElement)extIterator.next(); - if(element.getType().equals(ExtensionConstants.SOAP_OPERATION)){ - addAttribute(doc,"soapaction", ((SOAPOperation)element).getSoapAction(),rootElement); - actionAdded = true ; - } - } - - if (!actionAdded){ - addAttribute(doc,"soapaction", "",rootElement); - } - } + private void addSOAPAction(XmlDocument doc,Element rootElement,WSDLBindingOperation binding){ + Iterator extIterator = binding.getExtensibilityElements().iterator(); + boolean actionAdded = false; + while(extIterator.hasNext()){ + WSDLExtensibilityElement element = (WSDLExtensibilityElement)extIterator.next(); + if(element.getType().equals(ExtensionConstants.SOAP_OPERATION)){ + addAttribute(doc,"soapaction", ((SOAPOperation)element).getSoapAction(),rootElement); + actionAdded = true ; + } + } + + if (!actionAdded){ + addAttribute(doc,"soapaction", "",rootElement); + } + } protected XmlDocument createDOMDocuementForTestCase(WSDLBinding binding) { WSDLInterface boundInterface = binding.getBoundInterface(); @@ -729,41 +740,41 @@ } private void testCompatibiltyAll(WSDLBinding binding){ - HashMap map = binding.getBindingOperations(); - WSDLBindingOperation bindingOp; - Collection col = map.values(); - for (Iterator iterator = col.iterator(); iterator.hasNext();) { - bindingOp = (WSDLBindingOperation)iterator.next(); - testCompatibilityInput(bindingOp); - testCompatibilityOutput(bindingOp); - } + HashMap map = binding.getBindingOperations(); + WSDLBindingOperation bindingOp; + Collection col = map.values(); + for (Iterator iterator = col.iterator(); iterator.hasNext();) { + bindingOp = (WSDLBindingOperation)iterator.next(); + testCompatibilityInput(bindingOp); + testCompatibilityOutput(bindingOp); + } } private void testCompatibilityInput(WSDLBindingOperation binding){ - Iterator extIterator = binding.getInput().getExtensibilityElements().iterator(); - while(extIterator.hasNext()){ - WSDLExtensibilityElement element = (WSDLExtensibilityElement)extIterator.next(); - if(element.getType().equals(ExtensionConstants.SOAP_BODY)){ - if(WSDLConstants.WSDL_USE_ENCODED.equals(((SOAPBody)element).getUse())){ - throw new RuntimeException("The use 'encoded' is not supported!"); - } - } - } - } - - private void testCompatibilityOutput(WSDLBindingOperation binding){ - - Iterator extIterator = binding.getOutput().getExtensibilityElements().iterator(); - while(extIterator.hasNext()){ - WSDLExtensibilityElement element = (WSDLExtensibilityElement)extIterator.next(); - if(element.getType().equals(ExtensionConstants.SOAP_BODY)){ - if(WSDLConstants.WSDL_USE_ENCODED.equals(((SOAPBody)element).getUse())){ - throw new RuntimeException("The use 'encoded' is not supported!"); - } - } - } + Iterator extIterator = binding.getInput().getExtensibilityElements().iterator(); + while(extIterator.hasNext()){ + WSDLExtensibilityElement element = (WSDLExtensibilityElement)extIterator.next(); + if(element.getType().equals(ExtensionConstants.SOAP_BODY)){ + if(WSDLConstants.WSDL_USE_ENCODED.equals(((SOAPBody)element).getUse())){ + throw new RuntimeException("The use 'encoded' is not supported!"); + } + } + } + } + + private void testCompatibilityOutput(WSDLBindingOperation binding){ + + Iterator extIterator = binding.getOutput().getExtensibilityElements().iterator(); + while(extIterator.hasNext()){ + WSDLExtensibilityElement element = (WSDLExtensibilityElement)extIterator.next(); + if(element.getType().equals(ExtensionConstants.SOAP_BODY)){ + if(WSDLConstants.WSDL_USE_ENCODED.equals(((SOAPBody)element).getUse())){ + throw new RuntimeException("The use 'encoded' is not supported!"); + } + } + } } } Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/InterfaceImplementationTemplate.xsl URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/InterfaceImplementationTemplate.xsl?rev=202478&r1=202477&r2=202478&view=diff ============================================================================== --- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/InterfaceImplementationTemplate.xsl (original) +++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/InterfaceImplementationTemplate.xsl Wed Jun 29 21:24:12 2005 @@ -77,12 +77,12 @@ org.apache.axis.clientapi.Call _call = new org.apache.axis.clientapi.Call(_serviceContext); org.apache.axis.context.MessageContext _messageContext = getMessageContext(); _call.setTo(toEPR); + _call.setSoapAction(""); org.apache.axis.soap.SOAPEnvelope env = null; env = createEnvelope(); - // Style is RPC setValueRPC(env, @@ -152,6 +152,7 @@ org.apache.axis.clientapi.Call _call = new org.apache.axis.clientapi.Call(_serviceContext); org.apache.axis.context.MessageContext _messageContext = getMessageContext(); _call.setTo(toEPR); + _call.setSoapAction(""); org.apache.axis.soap.SOAPEnvelope env = createEnvelope(); Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/MessageReceiverTemplate.xsl URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/MessageReceiverTemplate.xsl?rev=202478&r1=202477&r2=202478&view=diff ============================================================================== --- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/MessageReceiverTemplate.xsl (original) +++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/MessageReceiverTemplate.xsl Wed Jun 29 21:24:12 2005 @@ -47,7 +47,7 @@ - if(methodName.equals(" ")){ + if(methodName.equals("")){