You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Akhil Gupta <ag...@eircom.net> on 2003/06/17 00:44:43 UTC

About the use of allowedMethods in wsdd file

Hi All

I am very new to Axis and still studying all the good points of axis.Well
not
to mention bad points as well but they are very few -:)

I have a question. I am trying to configure my deploy.wsdd file to have only
few allowed methods from my web service and using one example of axis my
deploy.wsdd is like


<deployment
    xmlns="http://xml.apache.org/axis/wsdd/"
    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

  <!-- Services from WidgetPriceService WSDL service -->

  <service name="MyWebService" provider="java:RPC" style="rpc"
use="encoded">
      <parameter name="wsdlTargetNamespace" value="mywebservice"/>
      <parameter name="wsdlServiceElement" value="WidgetPriceService"/>
      <parameter name="wsdlServicePort" value="MyWebService"/>
      <parameter name="className"
value="mywebservice.MyWebServiceSoapBindingSkeleton"/>
      <parameter name="wsdlPortType" value="WidgetPrice"/>
      <parameter name="allowedMethods" value="setWidgetPrice"/>
      <parameter name="scope" value="Application"/>

  </service>
</deployment>

and my web service has methods:-
public interface WidgetPrice extends java.rmi.Remote {
    public void setWidgetPrice(java.lang.String in0, java.lang.String in1)
throws java.rmi.RemoteException;
    public java.lang.String getWidgetPrice(java.lang.String in0) throws
java.rmi.RemoteException;
}


But still Axis allows me to call any methods on my service. When I checked
in the class org.apache.axis.providers.java.RPCProvider code to me it looks
like the functionality is not there as
the method:-

protected void checkMethodName(MessageContext msgContext,
                               String allowedMethods,
                               String methodName)
            throws Exception {
        // Our version doesn't need to do anything, though inherited
        // ones might.
}

is empty. Is somebody aware of what am I missing here.


Question b)
How we can handle overloaded methods in the webservice and allow only one
method to be called and rest prohibited. Is it possible ?

For e.g. if my web service is like:-

public interface WidgetPrice extends java.rmi.Remote {
    public void setWidgetPrice(java.lang.String in0, java.lang.String in1)
throws java.rmi.RemoteException;
    public void setWidgetPrice(java.lang.String in0,java.lang.String
in1,java.lang.Boolean store) throws java.rmi.RemoteException;
    public java.lang.String getWidgetPrice(java.lang.String in0) throws
java.rmi.RemoteException;
}

and if I want to restrict access to only one of setWidgetPrice() how can I
do it.


Thanks
Akhil