How to exclude properties from service

marc.marcroulias.com's picture

Hello, I am trying to exclude certain properties from exposed POJOs in my service. I found the following example which describes how to do this in a normal Axis2 services.xml file:

<parameter name="beanPropertyRules">
    <bean class="sample.Address" excludeProperties="street" />
    <bean class="sample.AddressParent" excludeProperties="zipcode" />
</parameter>

Now, how would I set up this same configuration in WSF/Spring within the applicationContext.xml file??? Thank you!

rubensa.gmail.com's picture

I'm trying to do same thing

I'm trying to do same thing and didn't found any way.. I discovered I can specify aditional parameters to service definition this way: <bean id="myService" class="org.wso2.spring.ws.SpringWebService"> <property name="serviceBean" ref="myService" /> <property name="serviceName" value="Service" /> <property name="parameters"> <map> <entry key="useOriginalwsdl" value="true" /> <entry key="modifyUserWSDLPortAddress" value="false" /> </map> </property> </bean> So, presumibly, should be some similar to this: <bean id="myService" class="org.wso2.spring.ws.SpringWebService"> <property name="serviceBean" ref="myService" /> <property name="serviceName" value="Service" /> <property name="parameters"> <map> <entry key="beanPropertyRules"> <value> <bean class="sample.Address" excludeProperties="street" /> <bean class="sample.AddressParent" excludeProperties="zipcode" /> </value> </entry> </map> </property> </bean> But the beanPropertyRules value should be an instance of org.apache.axis2.description.Property already populated with those values but can't guess how to do this.
prasadaraob's picture

The solution mentioned here

The solution mentioned here does nto work. the reason being that the OMelsement part setting on Parameter is a "TODO" in class SpringWebServiceBuilder.java. See the following method: private void processParameters(Map parameterMap, ParameterInclude service, ParameterInclude parent) throws DeploymentException { Iterator it = parameterMap.keySet().iterator(); while (it.hasNext()) { Parameter parameter = new Parameter(); // TODO set OMelement to parameter Element String paramName = (String) it.next(); parameter.setName(paramName); Object paramValue = parameterMap.get(paramName); if (paramValue instanceof String) { parameter.setParameterType(Parameter.TEXT_PARAMETER); parameter.setValue((String) paramValue); } else { parameter.setValue(paramValue); } Parameter parentParam = null; if (parent != null) { parentParam = parent.getParameter(parameter.getName()); } // TODO set the locked property of a parameter; try { if (parent != null) { if ((parentParam == null) || !parent.isParameterLocked(parameter.getName())) { this.service.addParameter(parameter); } } else { this.service.addParameter(parameter); } } catch (AxisFault axisFault) { throw new DeploymentException(axisFault); } } }
rhleons.hotmail.com's picture

Similar Problem

I have similar problem
bubulemaster.yahoo.fr's picture

Abstract class is a "solution"

Hi, I have same troubleshooting. For "correct" that. I have a abstract class with my code. I create an class hetited from abstract class and I've just public method that I want publish in WSDL.
library project main code
Learn Cloud
Learn
Cloud

The WSO2 Application Server is a reliable application server that can host your enterprise web applications. The WSO2 Application Server as a Service is offered in StratosLive, the WSO2 Platform as a Service. This article explains how a simple web application can be developed and deployed from Carbon Studio to the WSO2 Application Server...

Latest Webinar
Different groups within an organization need to monitor different Key Performance Indicators (KPIs) - An operations team will be interested in the response times of business services and loads of each service,..
Thursday, February 9th 2012, 09.00 AM (PST)

Thursday, February 9th 2012, 10.00 AM (GMT)