Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RequestCreators withSoapEnvelope can not found endpoint [SWS-1019] #1089

Closed
gregturn opened this issue May 10, 2018 · 3 comments
Closed

RequestCreators withSoapEnvelope can not found endpoint [SWS-1019] #1089

gregturn opened this issue May 10, 2018 · 3 comments

Comments

@gregturn
Copy link
Member

@gregturn gregturn commented May 10, 2018

Tomas Hudec opened SWS-1019 and commented

I continue with my project with testing aop and make some basic tests. I find that with version 3.0.0+ RequestCreators.withSoapEnvelope can not find endpoint because of different implementation of SaajSoapMessage. In version 3.0.0+ envelop is already set up because of method getVersion in constructor. And RequestCreators is trying to change document after envelop in SaajSoapMessage si already initialized. I made my custom withEnhancedSoapEnvelope and add just one line to reinitialized envelop after document from test is set and test is now OK:

soapMessage.setDocument((Document) result.getNode());
// TODO magic line here
soapMessage.setSaajMessage(soapMessage.getSaajMessage());

 

All online in my github:

https://github.com/hudi1/aop-test/blob/master/src/test/java/org/example/CountryEndpointTest.java


Affects: 3.0.0.RELEASE

Reference URL: https://github.com/hudi1/aop-test

Issue Links:

  • #1088 SaajSoapMessage created with default (empty) SoapEnvelope
    ("duplicates")

5 votes, 7 watchers

@gregturn
Copy link
Member Author

@gregturn gregturn commented Jun 5, 2018

Pankaj Agrawal commented

Yes, I face same issue. It works when using withPayload instead of soapEnvelope

@gregturn
Copy link
Member Author

@gregturn gregturn commented Jun 11, 2018

John Fletcher commented

I face a parallel issue (envelop is already set up because of method getVersion in constructor) when trying to mock backend responses using:

webServiceServer = MockWebServiceServer.createServer(webServiceTemplate);

webServiceServer.expect(matcher).andRespond(ResponseCreators.withSoapEnvelope(...));

This causes the mocking to fail as inside MarshallingUtils.unmarshal, the call message.getPayloadSource() returns null.

If anyone knows a workaround for this case please let me know, for now I'll have to revert to 2.4.

@gregturn
Copy link
Member Author

@gregturn gregturn commented Jun 21, 2018

jaminh commented

I included a proposal for a long-term fix to this issue on #1088 if anyone wants to try that. Code is at https://github.com/jaminh/spring-ws/tree/SWS-1018.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant