Whereas earlier, the endpoint would have been defined by a code of the following signature:
public class GetMemberDetailsEndpoint extends AbstractMarshallingPayloadEndpoint { private MemberManager memberManager; protected Object invokeInternal(Object requestObject) throws Exception { MemberDetailsRequest request = (MemberDetailsRequest) requestObject; MemberDetail memberDetail = memberManager.getMemberDetails(request .getId()); MemberDetailsResponse response = new MemberDetailsResponse(memberDetail); return response; } ...... }With Spring-WS 2.0 the endpoint can be more intuitively defined with the following signature:
@Endpoint public class GetMemberDetailsEndpoint { @Autowired private MemberManager memberManager; @PayloadRoot(namespace = "http://bk.org/memberservice/", localPart = "MemberDetailsRequest") @ResponsePayload public MemberDetailsResponse getMemberDetails(@RequestPayload MemberDetailsRequest request) throws Exception { MemberDetail memberDetail = memberManager.getMemberDetails(request .getId()); MemberDetailsResponse response = new MemberDetailsResponse(memberDetail); return response; } ..... }Updated code available at:
git://github.com/bijukunjummen/memberservice-contractfirst.git
No comments:
Post a Comment