0

I'm here because I have trouble understanding why in my contract first web service created with spring the handler code is never executed. I'm using a SpringJUnit test with Mock to run tests.

Here is my endpoint:

@Endpoint
public class InscriptionEndpoint {
private InscriptionService inscriptionService;

private static final String NAMESPACE_URI = "http://iaws/ws/contractfirst/inscription";

public InscriptionEndpoint(InscriptionService inscriptionService) {
    this.inscriptionService = inscriptionService;
}

@PayloadRoot(namespace = NAMESPACE_URI, localPart = "InscriptionRequest")
@Namespace(prefix = "cv", uri = NAMESPACE_URI)
@ResponsePayload
public Element handleInscriptionRequest(...)

Here is the message sender:

Source requestPayload = new StreamSource(new ClassPathResource(
            "InscriptionRequest.xml").getInputStream());
mockClient.sendRequest(withPayload(requestPayload));

And here the begining of the InscriptionRequest.xml file:

<InscriptionRequest xmlns="http://iaws/ws/contractfirst/inscription"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://iaws/ws/contractfirst/inscription InscriptionRequest.xsd">

The result on the tests is good, but if I try to make a print in the handler it seems to be never executed. I don't think the problem comes from the endpoint because it constructor is successfully called.

Have anyone had the same problem or knows how to fix it?

If you want more details i can give you the git address of the project: https://github.com/Ornro/CVWS

0 Answers0