axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Saminda Abeyruwan" <samin...@gmail.com>
Subject Re: Package Namespace Mapping (Re: svn commit: r464534 - in /webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2: deployment/DeploymentConstants.java deployment/ServiceBuilder.java deployment/util/Utils.java description/AxisServic
Date Tue, 17 Oct 2006 04:48:00 GMT
+1

Saminda

On 10/17/06, Davanum Srinivas <davanum@gmail.com> wrote:
>
> Saminda,
>
> Can you please change this <p2n> as follows?
>
> <mapping namespace="http://xml.apache.org/xml-soap"
> package="javax.activation"></mapping>
>
> Thanks,
> dims
>
> > On 10/16/06, saminda@apache.org <saminda@apache.org> wrote:
> > > Author: saminda
> > > Date: Mon Oct 16 09:02:57 2006
> > > New Revision: 464534
> > >
> > > URL: http://svn.apache.org/viewvc?view=rev&rev=464534
> > > Log:
> > > If user define beans are available, then during deployment time in
> > > services.xml, user can specify the "targetNamespace" of the schema
> that
> > > these bean should be belong to.
> > >
> > > if user define two beans, bean1.Bean1 and bean2.Bean1, in services.xml
> > > user can map the package to the relent namespace using <p2n/> element.
> > > This element is a child of <schema/> element. If user wishes, he could
> > > drop any mapping. This will comply with the java2wsdl's package to
> > > namespace convention.
> > >
> > > Thus,
> > >
> > > <service>
> > >   <schema>
> > >       <n2p>bean1,http://bean1/xsd</n2p>
> > >       <n2p>bean2,http://bean2/xsd</n2p>
> > >   </schema>
> > >   ...
> > > </service>
> > >
> > > Modified:
> > >
> webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java
> > >
> webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
> > >
> webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
> > >
> webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/description/AxisService.java
> > >
> > > Modified:
> webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java
> > > URL:
> http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java?view=diff&rev=464534&r1=464533&r2=464534
> > >
> ==============================================================================
> > > ---
> webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java
> (original)
> > > +++
> webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java
> Mon Oct 16 09:02:57 2006
> > > @@ -89,6 +89,8 @@
> > >      String SCHEMA_NAME_SPACE = "schemaNamespace";
> > >      String SCHEMA_ELEMENT_QUALIFIED = "elementFormDefaultQualified";
> > >      String SCHEMA = "schema";
> > > +    String P2N = "p2n";
> > > +    String COMMA = ",";
> > >
> > >      String ATTRIBUTE_DEFAULT_VERSION = "version";
> > >      String ATTRIBUTE_SCOPE = "scope";
> > >
> > > Modified:
> webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
> > > URL:
> http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java?view=diff&rev=464534&r1=464533&r2=464534
> > >
> ==============================================================================
> > > ---
> webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
> (original)
> > > +++
> webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
> Mon Oct 16 09:02:57 2006
> > > @@ -37,9 +37,7 @@
> > >  import javax.xml.stream.XMLStreamException;
> > >  import java.io.InputStream;
> > >  import java.io.StringWriter;
> > > -import java.util.ArrayList;
> > > -import java.util.HashMap;
> > > -import java.util.Iterator;
> > > +import java.util.*;
> > >
> > >  /**
> > >   * Builds a service description from OM
> > > @@ -114,12 +112,12 @@
> > >                  }
> > >              } else {
> > >                  if (service.getTargetNamespace() == null ||
> > > -                        "".equals(service.getTargetNamespace())) {
> > > +                    "".equals(service.getTargetNamespace())) {
> > >                      service.setTargetNamespace(
> Java2WSDLConstants.DEFAULT_TARGET_NAMESPACE);
> > >                  }
> > >              }
> > >
> > > -
> > > +
> > >
> > >              //Processing service lifecycle attribute
> > >              OMAttribute serviceLifeCycleClass = service_element.
> > > @@ -158,6 +156,25 @@
> > >                          service.setElementFormDefault(false);
> > >                      }
> > >                  }
> > > +
> > > +                //p2n mapping. This will be an element that maps pkg
> names to a namespace
> > > +                //when this is doing
> AxisService.getSchematargetNamespace will be overridden
> > > +                //This will be <p2n>pkgName,namespace</p2n>
> > > +                Iterator p2nIterator =
> schemaElement.getChildrenWithName(new QName(P2N));
> > > +                if (p2nIterator != null) {
> > > +                    Map pkg2nsMap = new Hashtable();
> > > +                    while(p2nIterator.hasNext()) {
> > > +                        OMElement p2nElement =
> (OMElement)p2nIterator.next();
> > > +                        String p2nText = p2nElement.getText();
> > > +                        if (p2nText != null) {
> > > +                            pkg2nsMap.put(p2nText.substring(0,
> p2nText.indexOf(COMMA)).trim(),
> > > +                                        p2nText.substring(
> p2nText.indexOf(COMMA) + 1, p2nText.length()).trim());
> > > +                        }
> > > +                    }
> > > +                    service.setP2nMap(pkg2nsMap);
> > > +
> > > +                }
> > > +
> > >              }
> > >
> > >              //processing Default Message receivers
> > > @@ -205,7 +222,7 @@
> > >
> > >              if (policyRefElements != null &&
> policyRefElements.hasNext()) {
> > >                  processPolicyRefElements(
> PolicyInclude.AXIS_SERVICE_POLICY,
> > > -                        policyRefElements, service.getPolicyInclude
> ());
> > > +                                         policyRefElements,
> service.getPolicyInclude());
> > >              }
> > >
> > >              //processing service scope
> > > @@ -319,9 +336,9 @@
> > >                          .getMessageReceiver().getClass().getName();
> > >                  if (!("
> org.apache.axis2.rpc.receivers.RPCMessageReceiver"
> > >                          .equals(messageReceiverClass)
> > > -                        || "
> org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"
> > > +                      || "
> org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"
> > >                          .equals(messageReceiverClass)
> > > -                        || "
> org.apache.axis2.rpc.receivers.RPCInOutAsyncMessageReceiver"
> > > +                      || "
> org.apache.axis2.rpc.receivers.RPCInOutAsyncMessageReceiver"
> > >                          .equals(messageReceiverClass))) {
> > >                      return false;
> > >                  }
> > > @@ -349,9 +366,9 @@
> > >                          .getMessageReceiver().getClass().getName();
> > >                  if (!("
> org.apache.axis2.rpc.receivers.RPCMessageReceiver"
> > >                          .equals(messageReceiverClass)
> > > -                        || "
> org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"
> > > +                      || "
> org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"
> > >                          .equals(messageReceiverClass)
> > > -                        || "
> org.apache.axis2.rpc.receivers.RPCInOutAsyncMessageReceiver"
> > > +                      || "
> org.apache.axis2.rpc.receivers.RPCInOutAsyncMessageReceiver"
> > >                          .equals(messageReceiverClass))) {
> > >                      excludeOperations.add(axisOperation.getName
> ().getLocalPart());
> > >                  }
> > > @@ -500,11 +517,11 @@
> > >                  op_descrip.setName(new QName(opname));
> > >                  String MEP = op_descrip.getMessageExchangePattern();
> > >                  if (
> WSDLConstants.WSDL20_2004Constants.MEP_URI_IN_ONLY.equals(MEP) ||
> > > -
> WSDLConstants.WSDL20_2004Constants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
> > > -
> WSDLConstants.WSDL20_2004Constants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
> > > -
> WSDLConstants.WSDL20_2004Constants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
> > > -
> WSDLConstants.WSDL20_2004Constants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
> > > -
> WSDLConstants.WSDL20_2004Constants.MEP_URI_IN_OUT.equals(MEP)) {
> > > +
> WSDLConstants.WSDL20_2004Constants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
> > > +
> WSDLConstants.WSDL20_2004Constants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
> > > +
> WSDLConstants.WSDL20_2004Constants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
> > > +
> WSDLConstants.WSDL20_2004Constants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
> > > +
> WSDLConstants.WSDL20_2004Constants.MEP_URI_IN_OUT.equals(MEP)) {
> > >                      AxisMessage inaxisMessage = op_descrip
> > >                              .getMessage(
> WSDLConstants.MESSAGE_LABEL_IN_VALUE);
> > >                      if (inaxisMessage != null) {
> > > @@ -513,11 +530,11 @@
> > >                  }
> > >
> > >                  if (
> WSDLConstants.WSDL20_2004Constants.MEP_URI_OUT_ONLY.equals(MEP) ||
> > > -
> WSDLConstants.WSDL20_2004Constants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
> > > -
> WSDLConstants.WSDL20_2004Constants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
> > > -
> WSDLConstants.WSDL20_2004Constants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
> > > -
> WSDLConstants.WSDL20_2004Constants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
> > > -
> WSDLConstants.WSDL20_2004Constants.MEP_URI_IN_OUT.equals(MEP)) {
> > > +
> WSDLConstants.WSDL20_2004Constants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
> > > +
> WSDLConstants.WSDL20_2004Constants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
> > > +
> WSDLConstants.WSDL20_2004Constants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
> > > +
> WSDLConstants.WSDL20_2004Constants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
> > > +
> WSDLConstants.WSDL20_2004Constants.MEP_URI_IN_OUT.equals(MEP)) {
> > >                      AxisMessage outAxisMessage = op_descrip
> > >                              .getMessage(
> WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
> > >                      if (outAxisMessage != null) {
> > > @@ -553,7 +570,7 @@
> > >
> > >              if (receiverElement != null) {
> > >                  MessageReceiver messageReceiver =
> loadMessageReceiver(service.getClassLoader(),
> > > -                        receiverElement);
> > >
> +                                                                      receiverElement);
> > >
> > >                  op_descrip.setMessageReceiver(messageReceiver);
> > >              } else {
> > >
> > > Modified:
> webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
> > > URL:
> http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java?view=diff&rev=464534&r1=464533&r2=464534
> > >
> ==============================================================================
> > > ---
> webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
> (original)
> > > +++
> webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
> Mon Oct 16 09:02:57 2006
> > > @@ -271,6 +271,8 @@
> > >          if (!axisService.isElementFormDefault()) {
> > >              schemaGenerator.setElementFormDefault(
> Java2WSDLConstants.FORM_DEFAULT_UNQUALIFIED);
> > >          }
> > > +        // package to namespace map
> > > +        schemaGenerator.setPkg2nsmap(axisService.getP2nMap());
> > >          Collection schemas = schemaGenerator.generateSchema();
> > >          axisService.addSchema(schemas);
> > >          axisService.setSchematargetNamespace(
> schemaGenerator.getSchemaTargetNameSpace());
> > >
> > > Modified:
> webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/description/AxisService.java
> > > URL:
> http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/description/AxisService.java?view=diff&rev=464534&r1=464533&r2=464534
> > >
> ==============================================================================
> > > ---
> webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/description/AxisService.java
> (original)
> > > +++
> webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/description/AxisService.java
> Mon Oct 16 09:02:57 2006
> > > @@ -172,6 +172,9 @@
> > >      private String wsaddressingFlag =
> AddressingConstants.ADDRESSING_UNSPECIFIED;
> > >      private boolean clientSide = false;
> > >
> > > +    // package to namespace mapping
> > > +    private Map p2nMap;
> > > +
> > >      public String getWSAddressingFlag() {
> > >          return wsaddressingFlag;
> > >      }
> > > @@ -1569,5 +1572,13 @@
> > >
> > >      public void setServiceLifeCycle(ServiceLifeCycle
> serviceLifeCycle) {
> > >          this.serviceLifeCycle = serviceLifeCycle;
> > > +    }
> > > +
> > > +    public Map getP2nMap() {
> > > +        return p2nMap;
> > > +    }
> > > +
> > > +    public void setP2nMap(Map p2nMap) {
> > > +        this.p2nMap = p2nMap;
> > >      }
> > >  }
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-cvs-help@ws.apache.org
> > >
> > >
> >
> >
> > --
> > Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service
> Developers)
> >
>
>
> --
> Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>

Mime
View raw message