Skip to content

JaxWsPortClientInterceptor gets an incorrect PortName [SPR-7505] #12162

@spring-projects-issues

Description

@spring-projects-issues

Liu, Yinwei David opened SPR-7505 and commented

Hi,
It looks like a bug in JaxWsPortClientInterceptor that it uses the name of @WebServiceClient as the client PortName.
In Spring 3.0.4, Spring tried to get some webservice info from @WebService annotation, please see the jira https://jira.springframework.org/browse/SPR-7412 . however, it should not get Port name from @WebService because one webservice could have multiple ports, and every ports have its own port name. Also, JaxWsPortClientInterceptor should not assume that the default PortName is the name of @WebService .

e.g. we could have one webservice client class below, it does not have the portname in @WebServiceClient. In this case, JaxWsPortClientInterceptor will use the name of WebServiceClient as its portname, and it leads to error.

@WebServiceClient(name = "CalculatorService", targetNamespace = "http://xml.ms.com/ns/msjava/cxfutils/examples/calculator")
public class CalculatorService extends Service {

@WebEndpoint(name = "CalculatorHTTPPort")
public Calculator getCalculatorHTTPPort() {...}

@WebEndpoint(name = "CalculatorTCPPort")
public Calculator getCalculatorTCPPort() {...}

I think JaxWsPortClientInterceptor should not get Port name from its annotation, and it should not pick up servicename and targetNamespace from annotation. Also, the portname will be dynamically generated by the underlying webservice framework when portname is null and it can be decided at runtime. Could you please fix it? thanks.


Affects: 3.0.4

Referenced from: commits 66a5bb7

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions