You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Anne Thomas Manes <at...@gmail.com> on 2008/04/27 14:14:30 UTC

Re: excluding pojo fields from wsdl

The best way to manage what is included or excluded from your WSDL is
to edit the WSDL so that it exposes just what you want, then redeploy
the service using the useOriginalWsdl setting.

Anne

On Fri, Apr 25, 2008 at 10:20 AM, Glen Verran <gl...@traderoot.com> wrote:
> Hi there,
>  I am still having trouble in finding a solution to the problem below.
>  Is there another forum where I would be able to get assistance as soon
>  as possible please?
>  Thanks
>  ~Glen
>
>
>
>
>  -----Original Message-----
>  From: Glen Verran [mailto:glen.verran@traderoot.com]
>  Sent: 17 April 2008 13:05
>  To: axis-user@ws.apache.org
>  Subject: RE: excluding pojo fields from wsdl
>
>  It seems that David Kraus and myself are in the same boat.  We both have
>  the need to exclude methods and/or entire classes from being considered
>  from the web service and WSDL in general and I cannot believe that this
>  is something that nobody has encoutered.  I am assuming that the
>  developers involved are moderating this list.
>
>  I've just tried the methods posed in the article below, but they don't
>  seem to work.  The class that I am referring to is not in the web
>  service JAR itself.  It is in another jar which is located in my
>  shared/lib folder in Tomcat, but this shouldn't make a difference at
>  all.
>
>  For the class below:
>
>  @XmlTransient
>  public class JaxbInternalMsg implements InternalMsg {
>
>   public String getEchoData() {
>     return null;
>   }
>
>   public String getMsgType() throws GenericException {
>     return null;
>   }
>
>   public void setEchoData(String echoData) {
>   }
>
>   public byte[] toExternal() throws GenericException {
>     return null;
>   }
>
>   public String verboseToString() {
>     return null;
>   }
>
>  }
>
>  I added the following in my services.xml file
>
>  I first added this:
>
>   <parameter name="beanPropertyRules">
>     <bean class="com.traderoot.core.eventframework.JaxbInternalMsg"
>  excludeProperties="msgType,echoData" />
>   </parameter>
>
>  Then I swopped out the above with this:
>
>   <excludeOperations>
>     <operation>getMsgType</operation>
>     <operation>getEchoData</operation>
>   </excludeOperations>
>
>  Then I put both together and none worked!  I even added msgType and
>  echoData variables to the class above and tried the different methods
>  above.  Nothing.
>
>  Is there anybody that can help both David and myself.  We would greatly
>  appreciate it very much.
>
>  Cheers
>  ~Glen
>
>
>
>  -----Original Message-----
>  From: Deepal jayasinghe [mailto:deepalk@gmail.com]
>  Sent: 17 April 2008 08:36
>  To: axis-user@ws.apache.org
>  Subject: Re: excluding pojo fields from wsdl
>
>  Hi Kraus,
>  Please have a look at the following article [section : How to exclude
>  Bean properties?]
>
>  http://wso2.org/library/2893
>  >
>  > I am using Axis2 1.2 and have deployed a simple service as a POJO. I
>  > created my client using wsld2java based on the WSDL generated from the
>
>  > POJO service.
>  >
>  >
>  >
>  > One of the objects, which is returned from a web service method, has
>  > some */public/* */static/* fields. These fields are being included in
>  > the WSDL. However, since these */static/* fields don't have
>  > getters/setters, they weren't being serialized on return, which caused
>
>  > an "Unexpected element return" error at the client. Adding
>  > getters/setters gets rid of the problem, as long as the
>  > getters/setters are not */static/* ( which is strange). In any case,
>  > these */public/* */static/* fields do not need to be serialized, and
>  > their inclusion in the WSDL causes problems. Using getters/setters is
>  > very awkward since they aren't really needed since the fields really
>  > should be */public static final/*, which I tried using.  I have also
>  > tried using the java */transient/* keyword, but that doesn't seem to
>  > work. I have also tried using */excludeProperties/*
>  > (*/beanPropertyRules/*) in services.xml, and that didn't seem to work.
>
>  > Is there a way to exclude these */public/* */static/* fields from the
>  > WSDL generated from the deployed POJO?
>  >
>  >
>  >
>  > Example of return class below:
>  >
>  >
>  >
>  > Thanks, Dave
>  >
>  >
>  >
>  >
>  >
>  > *public* *class* EnumNormal {
>  >
>  >       *private* String _value;
>  >
>  >
>  >
>  >       *public* EnumNormal() {}
>  >
>  >
>  >
>  >       *public* EnumNormal(String value)
>  >
>  >       {
>  >
>  >             _value = value;
>  >
>  >       }
>  >
>  >
>  >
>  >       *public* String getValue()
>  >
>  >       {
>  >
>  >             *return* _value;
>  >
>  >       }
>  >
>  >
>  >
>  >       *public* *void* setValue(String value)
>  >
>  >       {
>  >
>  >             _value = value;
>  >
>  >       }
>  >
>  >
>  >
>  >       *public* *static* String /firstEnumVal/ = "FirstEnumVal";
>  >
>  >       *public* *static* String /secondEnumVal/ = "SecondEnumVal";
>  >
>  >       *public* *static* String /thirdEnumVal/ = "ThirdEnumVal";
>  >
>  >       *public* *static* String /fourthEnumVal/ = "FourthEnumVal";
>  >
>  >       *public* *static* String /fifthEnumVal/ = "FifthEnumVal";
>  >
>  >
>  >
>  > }
>  >
>  >
>  >
>
>
>  --
>  Thanks,
>  Deepal
>  ................................................................
>  "The highest tower is built one brick at a time"
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>  For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>  For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>  For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org