Skip to content

Order of setting properties in WebServiceGatewaySupport [SWS-182] #336

@gregturn

Description

@gregturn

Alin Dreghiciu opened SWS-182 and commented

In WebServiceGatewaySupport the set* properties delegate to WebServiceTemplate in the moment the call is made.
As long as one uses the default WebServiceTemplate there is no problem.
But as soon as using a custom WebServiceTemplate the order the properties are becomes critical, fact that should not be the case.
E.g.

if I have:
<bean id="airlineClient" class="org.springframework.ws.samples.airline.client.sws.AirlineClient">
<property name="marshaller" ref="marshaller"/>
<property name="unmarshaller" ref="marshaller"/>
<property name="defaultUri" value="http://localhost:8080/airline/services"/>
<property name="webServiceTemplate" ref="myWebServiceTemplate"/>
</bean>
will fail when used as the delegate will go to the default template, template that is replaced in the last property set with my template.
If I have :
<bean id="airlineClient" class="org.springframework.ws.samples.airline.client.sws.AirlineClient">
<property name="webServiceTemplate" ref="myWebServiceTemplate"/>
<property name="marshaller" ref="marshaller"/>
<property name="unmarshaller" ref="marshaller"/>
<property name="defaultUri" value="http://localhost:8080/airline/services"/>
</bean>
everithing works file since teh web template is already set before the delegate take place.

I suggest that delegates takes place in afterPropertiesSet not in the set* methods.


Affects: 1.0

Referenced from: commits ea34eaa

Metadata

Metadata

Assignees

Labels

status: declinedA suggestion or change that we don't feel we should currently applytype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions