diff --git a/samples/mtom/server/src/main/java/org/springframework/ws/samples/mtom/ws/ImageRepositoryEndpoint.java b/samples/mtom/server/src/main/java/org/springframework/ws/samples/mtom/ws/ImageRepositoryEndpoint.java index 1f1c53fd..bacba4c1 100644 --- a/samples/mtom/server/src/main/java/org/springframework/ws/samples/mtom/ws/ImageRepositoryEndpoint.java +++ b/samples/mtom/server/src/main/java/org/springframework/ws/samples/mtom/ws/ImageRepositoryEndpoint.java @@ -1,11 +1,11 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -16,9 +16,7 @@ package org.springframework.ws.samples.mtom.ws; -import java.io.ByteArrayOutputStream; import java.io.IOException; -import javax.activation.DataHandler; import javax.xml.bind.JAXBElement; import org.springframework.util.Assert; @@ -27,6 +25,8 @@ import org.springframework.ws.samples.mtom.schema.ObjectFactory; import org.springframework.ws.samples.mtom.service.ImageRepository; import org.springframework.ws.server.endpoint.annotation.Endpoint; import org.springframework.ws.server.endpoint.annotation.PayloadRoot; +import org.springframework.ws.server.endpoint.annotation.RequestPayload; +import org.springframework.ws.server.endpoint.annotation.ResponsePayload; /** @author Arjen Poutsma */ @Endpoint @@ -43,13 +43,15 @@ public class ImageRepositoryEndpoint { } @PayloadRoot(localPart = "StoreImageRequest", namespace = "http://www.springframework.org/spring-ws/samples/mtom") - public void store(JAXBElement requestElement) throws IOException { + @ResponsePayload + public void store(@RequestPayload JAXBElement requestElement) throws IOException { Image request = requestElement.getValue(); imageRepository.storeImage(request.getName(), request.getImage()); } @PayloadRoot(localPart = "LoadImageRequest", namespace = "http://www.springframework.org/spring-ws/samples/mtom") - public JAXBElement load(JAXBElement requestElement) throws IOException { + @ResponsePayload + public JAXBElement load(@RequestPayload JAXBElement requestElement) throws IOException { String name = requestElement.getValue(); Image response = new Image(); response.setName(name); diff --git a/samples/mtom/server/src/main/webapp/WEB-INF/spring-ws-servlet.xml b/samples/mtom/server/src/main/webapp/WEB-INF/spring-ws-servlet.xml index a43b304c..58e0614f 100644 --- a/samples/mtom/server/src/main/webapp/WEB-INF/spring-ws-servlet.xml +++ b/samples/mtom/server/src/main/webapp/WEB-INF/spring-ws-servlet.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"> @@ -10,7 +10,12 @@ - + + + + + + @@ -25,7 +30,6 @@ -