roskart / dropwizard-jaxws

Dropwizard bundle that enables building SOAP web services and clients using JAX-WS API
Apache License 2.0
43 stars 36 forks source link

Suggestion - return Endpoint after publishing #13

Closed mDehning closed 6 years ago

mDehning commented 6 years ago

After publishing an endpoint, there are cases where some properties of the Enpoint may be needed to be changed or added - for example if you want to set up a custom UserPasswordValidator. Specifically you would want to access endpoint.setProperties()

Currently the builder does not offer this and the endpoint reference is only visible within the scope of the publishEndpoint() method in the JaxWSEnvironment.

If this method would return the endpoint (as does the original Endpoint.publish() Method by cxf), further configuration would be available.

mDehning commented 6 years ago

While reading issue #2 i realize it is not in your interest to expose the endpoint. However an addition to the builder and environment to set properties would be helpful.

roskart commented 6 years ago

Ok. EndpointBuilder shall be extended with the following method to enable injecting properties:

EndpointBuilder properties(Map<String, Object> propeties)

JAXWSEnvironment.publishEndpoint shall return javax.xml.ws.Endpoint to enable further customization:

Endpoint publishEndpoint(EndpointBuilder endpointBuilder)

roskart commented 6 years ago

This fix is included in 1.0.3 release.

mDehning commented 6 years ago

Release 1.0.3 does not contain the updated JaxWSBundle. Method publishEndpoint(Endpoint) is still of return type void.

Edit: In the JAXWSEnvironment there is now a returned Endpoint but the JaxWSEnvironment is not accessible from outside the JaxWSBundle, I realize now, that I mistated this in the issue.

roskart commented 6 years ago

Properies can also be provided using EndpointBuilder.properties. Does this work for you?

mDehning commented 6 years ago

It does not. I have several manipulations to do, due to the fact that I have to accomodate a proxy and other stuff down the line.

roskart commented 6 years ago

Well, I don't see a problem with updating JAXWSBundle - this change will not break existing clients. I missed updating it, since I obviously didn't take enough time. I will fix this as I find the time. Pull requests are welcome.