The pipeline of service A will complete before returning to the client if you are using sendSync to invoke service B. Can you elaborate on what leads you to believe that service A is returning before service B returns? Do you see any errors in your log during the invocation?
A does not complete before B. When B completes further actions are performed on A - the last action in A is meant to set a default Message that can be picked up by EBWS and used as payload for the soap response. But unfortunately when B completes the soap response is built using the default Message on pipeline B as soap response payload. I attached a debugger to ServiceInvoker and tried stepping though the code - it appears EBWS response was triggered prematurely by a filter class when B completed. I can't check the error msg right now but it amounted to saying that building the soap msg failed because the Message didn't have a xml document root at position 1:1. This is because the default Message on pipeline B is just a number - not XML.
If I remove the action containing the ServiceInvoker.deliverSync() from Service A then EBWS uses the default Message on pipeline A as soap response payload when A completes as expected.
Sounds as if you may be reusing the current message without initialising the call header, as such it will still refer to the ReplyTo for service A.
Either create a new message or, if you must reuse the current one, set the reply to to null.
Call call = message.getHeader().getCall();
Thanks that was it.