views:

644

answers:

2

Hi all. I'm trying to create a WS based on a WSDL that defines one Request and one Response. The incoming request should be mapped to an endpoint depending on the SOAPAction defined in the SOAP message. To achieve this I'm trying to use the SoapActionEndpointMapping in my servlet.xml config file and define the mappings, as described in the Spring documentation.

 <bean id="endpointMapping" class="org.springframework.ws.soap.server.endpoint.mapping.SoapActionEndpointMapping">
    <property name="mappings">
        <props>
            <prop key="http://myCompany/MyService/MyRequest/mySoapActionOne"&gt;myFirstEndpoint&lt;/prop&gt;
            <prop key="http://myCompany/MyService/MyRequest/mySoapActionTwo"&gt;mySecondEndpoint&lt;/prop&gt;
        </props>
    </property>

My endpoint extends AbstractMarshallingPayloadEndpoint and should be able to handle the requests.

The problem is that when I try to send a request (with SoapUI) i get the following error in the log:

WARN  [EndpointNotFound] No endpoint mapping found for [SaajSoapMessage {http://schemas.mycompany/MyService}MyRequest]

I have used the PayloadRootQNameEndpointMapping with great success earlier but can not this to work.

Any help is appreciated.

Regards.

A: 

Do you have a handler adapter bean defined also? You'll need one in order to use a MarshallingPayloadEndpoint, so that spring knows how to perform the marshalling. The adapter is called something like MarshallingEndpointHandlerAdapter, or similar.

skaffman
I have not defined any MarshallingPayloadEndpoint. What I have done is setting the marshaller/unmarshaller properties of the AbstractMarshallingPayloadEndpoint. This works with the PayloadRootQNameEndpointMapping, but I will look into the MarshallingEndpointHandlerAdapter. Thanks
maskefjes
A: 

In your SOAP client (SOAPUI), you'll need to add the SOAPAction header to your request, to supply spring with the SOAP action to use in its mapping.

E.g. SOAPAction=http://myCompany/MyService/MyRequest/mySoapActionOne

It shouldn't make any difference what type of Endpoint you're using, because currently, you're receiving a 404 response - your request isn't finding its way to any endpoint.

Lee Kowalkowski