How to use WS-Addressing and get messageId

209 Views Asked by At

I'm stuck on WS-Addressing with Apache CXF. I tried everything I found on the Web but without good results. There are two applications, a server and a client, that communicate through WS-Addressing. What I want to do is to obtain the "messageId" field with the server, so I can output it on logs.

Can you help me, please? I tried two different solutions but without results

  1. Using EndpointImpl
public static void main(String[] args) {
        ChangeStudentDetailsImpl implementor =  new ChangeStudentDetailsImpl();
        EndpointImpl ep = (EndpointImpl) Endpoint.create(implementor);
        ep.getFeatures().add(new WSAddressingFeature());
        ep.publish("http://localhost:8087/MidtermServer/Implementor");
    }
  1. Using Apache CXF

I really don't understand how to get params passed using WS Addressing Feature, using a client application or SoapUI

Any help is appreciated

1

There are 1 best solutions below

0
On

After some tests, I found I can use apache CXF and get the request through

@Resource
private WebServiceContext ctx;
...
ctx.getMessageContext(); //into the function called