• Post Reply Bookmark Topic Watch Topic
  • New Topic

web service response naming  RSS feed

 
Nilar Khin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am new to web service and wsdl. I have problem defining output message.

I want output as below. But if I define my web method as @WebMethod(operationName="EnableUser"), I'll get “EnableUserResponse”. But if I define @WebMethod(operationName="EnableUserRequest"), I got output as “EnableUserRequestResponse”. It is always operationName+Response. I tried @ResponseWrapper and found no use. How shall I change the output name?

input : “EnableUserRequest”
output : “EnableUserResponse”

Thank you !
 
Stephan van Hulst
Saloon Keeper
Posts: 7721
142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch Nilar!

I'm not very familiar with WSDL in Java, but maybe the @WebResult annotation does what you want?
 
Nilar Khin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stephan van Hulst wrote:Welcome to CodeRanch Nilar!

I'm not very familiar with WSDL in Java, but maybe the @WebResult annotation does what you want?


Hi Stephan,
Thanks for your quick response. I do put @WebResult(name="EnableUserResponse"). But it still return WebMethod operationName+Response :-)
My code is like below.

@WebMethod(operationName="EnableUser")
// @RequestWrapper(localName="EnableUserRequest")
public @WebResult(name="EnableUserResponse") EnableUserResponseTO enableUser(
@WebParam(name="segUId") String segUId,
@WebParam(name="loginId") String loginId
);
 
Stephan van Hulst
Saloon Keeper
Posts: 7721
142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is it so important that the names are exactly as you want them to be?
 
Nilar Khin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stephan van Hulst wrote:Why is it so important that the names are exactly as you want them to be?


Because customer request it and I am just looking for a way to achieve it. It shouldn't be that matter :-(
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!