How to make generated classes contain Javadoc from XML Schema documentation

I’ve never been able to get regular xsd:documentation to be placed in the java source except if and only if it was a Complex Type. Documentation for elements, simple types, etc are ignored. So, I end up using jxb:javadoc. To do so, include the definition of xmlns:jxb=”http://java.sun.com/xml/ns/jaxb” in your <xsd:schema> element. Add a child to … Read more

How does one intercept a request during the Jersey lifecycle?

I’ve found the answer. First, create a class that implements ContainerRequestFilter. The interface specifies the following method, in which the filtering takes place. The ContainerRequest object contains information about the current request. public ContainerRequest filter(ContainerRequest req); After that, include the following XML in the servlet configuration in web.xml <init-param> <param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name> <param-value>path.to.filtering.class</param-value> </init-param> Sources: http://jersey.576304.n2.nabble.com/ContainerRequestFilter-and-Resources-td4419975.html http://markmail.org/message/p7yxygz4wpakqno5

JAXWS — how to change the endpoint address [duplicate]

You can achieve that using the BindingProvider interface. JAX-WS custom endpoint /** * The following snippets shows how to set a custom endpoint for a JAX-WS generated WebClient on runtime */ // Get the service and the port SampleService service = new SampleService(); Sample port = service.getESamplePort(); // Use the BindingProvider’s context to set the … Read more

overriding or setting web service endpoint at runtime for code generated with wsimport

Your client can set the end-point in the service “port” at runtime via the BindingProvider interface. Consider the JAX-WS client in this JAX-WS tutorial. Another way to write this code would be: HelloService service = new HelloService(); Hello port = service.getHelloPort(); BindingProvider bindingProvider = (BindingProvider) port; bindingProvider.getRequestContext().put( BindingProvider.ENDPOINT_ADDRESS_PROPERTY, “http://foo:8086/HelloWhatever”); String response = port.sayHello(name); Caveat: I … Read more

What’s the difference between and in WSDL?

portType (Analogs to Java interface) PortType is an abstraction part of WSDL. An abstract set of operations supported by one or more endpoints. binding Binding is an concrete part of WSDL. Describes how the operation is invoked by specifying concrete protocol and data format specifications for the operations and messages. bindings are three types SOAP … Read more

java: Rpc/encoded wsdls are not supported in JAXWS 2.0

RPC/encoded is a vestige from before SOAP objects were defined with XML Schema. It’s not widely supported anymore. You will need to generate the stubs using Apache Axis 1.0, which is from the same era. java org.apache.axis.wsdl.WSDL2Java http://someurl?WSDL You will need the following jars or equivalents in the -cp classpath param: axis-1.4.jar commons-logging-1.1.ja commons-discovery-0.2.jar jaxrpc-1.1.jar … Read more