Questions tagged [jax-ws]

JAX-WS is the JSR 224 defining a Java API for XML-Based Web Services

Specifications:

  • JavaTM API for XML-Based Web Services (JAX-WS) 2.0 - JSR 224
  • Web Services Metadata for the Java Platform 2.1 - JSR 181
  • Web Services for Java EE, version 1.3 - JSR 109


Implementations:


Useful links:

JAX-WS Reference Implementation (RI) Project

4067 questions
52
votes
2 answers

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

Using code that was generated with wsimport, can the service endpoint be overridden without having to regenerate the code? I have written a simple java webservice, following are the steps: I compile the java class and generate a war file Deploy the…
user363808
  • 527
  • 1
  • 4
  • 5
51
votes
6 answers

Use CXF JaxWsServerFactoryBean exception Cannot find any registered HttpDestinationFactory from the Bus

When use Apache CXF JaxWsServerFactoryBean in console mode (try to start the server by java command line) Will get exception like below: Caused by: java.io.IOException: Cannot find any registered HttpDestinationFactory from the Bus. at…
Anderson Mao
  • 1,101
  • 1
  • 9
  • 7
50
votes
4 answers

JAXWS — how to change the endpoint address

How can I dynamically change the address which my JAXWS client is using? This client was generated by wsimport.
Kico Lobo
  • 4,374
  • 4
  • 35
  • 48
49
votes
4 answers

How does one intercept a request during the Jersey lifecycle?

I've used Jersey for the better part of a year now and have just stumbled upon a problem to which I can't find the answer: how do you intercept (or hook into) the Jersey request lifecycle? Ideally, I'd be able to perform some custom…
cww
  • 1,128
  • 1
  • 8
  • 15
48
votes
9 answers

RMI vs. Web Services. What's best for Java2Java remoting?

I'm new to both Web Services and RMI and I wonder which is the better way to do remoting between different web applications, when these applications are all written in Java, that is when different programming languages don't matter (which would be…
cretzel
  • 19,864
  • 19
  • 58
  • 71
47
votes
1 answer

Java 11 package javax.xml.soap does not exist

I'm trying to create a simple message using SOAP: MessageFactory mf = MessageFactory.newInstance(); SOAPMessage message = mf.createMessage(); When I build the project with Java 8 it's fine, but building it with Java 11 fails with a compilation…
Boris
  • 22,667
  • 16
  • 50
  • 71
47
votes
4 answers

How to make generated classes contain Javadoc from XML Schema documentation

I'm currently working with an XML Schema that has / on most types and elements. When I generate Java Beans from this XML Schema, then the Javadoc of those Beans only contains some generic generated information…
Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614
46
votes
13 answers

JAX-WS Loading WSDL from jar

I'm writing a fat client that makes use of a SOAP service for some features (bug reporting etc.) I've got JAX-WS working fine, but by default (in netbeans at least) it fetches the WSDL from the remote server every time the service is initialized. I…
Cogsy
  • 5,584
  • 4
  • 35
  • 47
43
votes
2 answers

@XMLRootElement versus @XmlType

What's the difference between annotating a class with @XMLRootElement and @XMLType. I've been annotating classes with @XMLType when the structure will be used more than once within an XML schema and with @XMLRootElement when it will be used only…
CodeClimber
  • 4,584
  • 8
  • 46
  • 55
41
votes
3 answers

How to choose between JAX-RS and JAX-WS web services implementation?

In what contexts is it better to use one over the other and why? Thanks!
kgautron
  • 7,915
  • 9
  • 39
  • 60
41
votes
2 answers

How can I access the ServletContext from within a JAX-WS web service?

I want to share an object between my servlets and my webservice (JAX-WS) by storing it as a servlet context attribute. But how can I retrieve the servlet context from a web service?
Jens Bannmann
  • 4,845
  • 5
  • 49
  • 76
40
votes
3 answers

How to retrieve JSON Response from a javax.ws.rs.core.Response response?

I am making a request to an API and getting a response status code of 200. Response of the api includes a json response. import javax.ws.rs.core.Response; Response response = webclient.post(SomeReqString); How can I retrieve the json response as…
goodmayhem
  • 3,364
  • 4
  • 16
  • 17
39
votes
1 answer

maven: How to add resources which are generated after compilation phase

I have a maven project which uses wsgen to generate XSD files from the compiled java classes. The problem is that I want to add the generated files to the jar as resources. But since the resource phase runs before the process-classes phase, I…
Avner Levy
  • 6,601
  • 9
  • 53
  • 92
38
votes
3 answers

Best way to consume RPC/encoded webservice?

I need to consume old-school RPC/encoded WSDL webservice for my backend. At first I tried to use Apache CXF and JAX-WS for that, but JAX-WS wsimport tool doesn't eat rpc/enoded WSDL. [ERROR] rpc/encoded wsdls are not supported in JAXWS 2.0. I'm…
ilvez
  • 1,235
  • 3
  • 16
  • 27
38
votes
2 answers

How can I use an HTTP proxy for a JAX-WS request without setting a system-wide property?

I have an application that needs to make a SOAP client request to a system on the Internet, so it needs to go though our HTTP proxy. One can do this by setting system-wide values such as system properties: // Cowboy-style. Blow away anything any…
jbindel
  • 5,535
  • 2
  • 25
  • 38