//assume we have this services.xml <?xml version="1.0" encoding="UTF-8"?> <!-- This file was auto-generated from WSDL --> <!-- by the Apache Axis2 version: 1.4 Built on : Apr 26, 2008 (06:24:30 EDT) --> <serviceGroup> <service name="connectSm"> <messageReceivers> <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="org.apache.ws.axis2.ConnectSmMessageReceiverInOut"/> <messageReceiver mep="http://www.w3.org/ns/wsdl/in-only" class="org.apache.ws.axis2.ConnectSmMessageReceiverInOnly"/> </messageReceivers> <parameter name="ServiceClass">org.apache.ws.axis2.ConnectSmSkeleton</parameter> <parameter name="useOriginalwsdl">true</parameter> <parameter name="modifyUserWSDLPortAddress">true</parameter> <operation name="isTransactional" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://ws.apache.org/axis2"> <actionMapping>urn:isTransactional</actionMapping> <outputActionMapping>urn:isTransactionalResponse</outputActionMapping> </operation> <operation name="setTransactional" mep="http://www.w3.org/ns/wsdl/in-only" namespace="http://ws.apache.org/axis2"> <actionMapping>urn:setTransactional</actionMapping> </operation> <operation name="getInvoiceImage" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://ws.apache.org/axis2"> <actionMapping>urn:getInvoiceImage</actionMapping> <outputActionMapping>urn:getInvoiceImageResponse</outputActionMapping> </operation> <operation name="getTransactional" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://ws.apache.org/axis2"> <actionMapping>urn:getTransactional</actionMapping> <outputActionMapping>urn:getTransactionalResponse</outputActionMapping> </operation> </service> </serviceGroup>
(we'll assume the urn namespace entities have already been defined in wsdl's xsd) note the namespace attribute can be assigned for the operation element environment variables: noting the parameter ServiceClass in our services.xml <serviceGroup> <service name="connectSm"> <messageReceivers> <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="org.apache.ws.axis2.ConnectSmMessageReceiverInOut"/> <messageReceiver mep="http://www.w3.org/ns/wsdl/in-only" class="org.apache.ws.axis2.ConnectSmMessageReceiverInOnly"/> </messageReceivers> <parameter name="ServiceClass">org.apache.ws.axis2.ConnectSmSkeleton</parameter> notice the Service params can be handled by ConnectSmSkeleton and will handle env vars e.g. /** * ConnectSmSkeleton.java * This file was auto-generated from WSDL * by the Apache Axis2 version: 1.4 Built on : Apr 26, 2008 (06:24:30 EDT) */ package org.apache.ws.axis2; /*** ConnectSmSkeleton java skeleton for the axisService */ public class ConnectSmSkeleton{ /** Auto generated method signature **/ public org.apache.ws.axis2.IsTransactionalResponse isTransactional ( ) { //TODO : fill this with the necessary business logic //throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + //"#isTransactional"); String s = System.getenv("TMP"); } /*** Auto generated method signature* * @param setTransactional */ public void setTransactional ( org.apache.ws.axis2.SetTransactional setTransactional ) { //TODO : fill this with the necessary business logic } /** * Auto generated method signature * * @param getInvoiceImage */ public org.apache.ws.axis2.GetInvoiceImageResponse getInvoiceImage ( org.apache.ws.axis2.GetInvoiceImage getInvoiceImage ) { //TODO : fill this with the necessary business logic throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#getInvoiceImage"); } /** * Auto generated method signature * */ public org.apache.ws.axis2.GetTransactionalResponse getTransactional ( ) { //TODO : fill this with the necessary business logic throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#getTransactional"); } } since service.xml is not a macro script (such as *.ftl or *.vm) services.xml would use no preprocessing also consider whatever is being built into services.xml must be able to be generated by WSDL2JAVA utility would you propose parameter substitution be built in to services.xml? would you be willing to build a testcase and or any justifications for this behaviour ? Martin Gainty ______________________________________________ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Subject: Reading environment variables in services.xml Date: Mon, 25 May 2009 15:20:18 +0530 From: balaji.siras...@ca.com To: axis-dev@ws.apache.org Hi All, Is there a way to read environment variables in services.xml? Can we define targetnamespace and service name at runtime? i.e by reading environment variable is it possible to set targetnamespace and service name in services.xml. And also is there a way to define targetnamespace in build.xml? Thanks, Balaji _________________________________________________________________ Hotmail® has ever-growing storage! Don’t worry about storage limits. http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage1_052009