Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is purpose of CXF or Spring WS

I am new to consuming web services. I am trying to consume a SOAP service. This is currently in the test environment. What I have done is

  1. Use wsdl2java to generate a wsdl that I have copied to my domain folder.
  2. Use the API to send requests and receive responses.

What concerns me is do I need CXF or Spring WS to wire the service or is what I have sufficient. I am asking this because I have seen elsewhere like

What I don't get is where I would generate property when environments are switching from development to QA to production. And do I need to use CXF or Spring WS or are the annotated classes (@WebServiceClient sufficient) to consume the SOAP service. Basically, how to connect to different endpoints.

I apologize if this is rudimentary question. Thanks.

like image 690
Kelly Roper Avatar asked Aug 30 '11 17:08

Kelly Roper


People also ask

What is CXF used for?

CXF helps you build and develop services using frontend programming APIs, like JAX-WS and JAX-RS. These services can speak a variety of protocols such as SOAP, XML/HTTP, RESTful HTTP, or CORBA and work over a variety of transports such as HTTP, JMS or JBI.

What is spring CXF?

The application context loads Spring elements defined in a configuration file. In this case, the name of the servlet is cxf, therefore the context looks for those elements in a file named cxf-servlet. xml by default. Lastly, the CXF servlet is mapped to a relative URL: dispatcher.addMapping("/services");

What is Spring WS-Security?

Supports WS-Security: WS-Security allows you to sign SOAP messages, encrypt and decrypt them, or authenticate against them. Integrates with Acegi Security: The WS-Security implementation of Spring Web Services provides integration with Spring Security.

What is CXF endpoint?

In Apache Camel, the Camel CXF component is the key to integrating routes with Web services. You can use the Camel CXF component to create a CXF endpoint, which can be used in either of the following ways: Consumer — (at the start of a route) represents a Web service instance, which integrates with the route.


1 Answers

Spring-WS and Apache CXF are primarily useful for creating web-services. They are alternative web service implementations to the one that ships with Java6.

You can use them for writing clients, but there's not really much point, unless you're really keen on the alternative API that those provide.

The standard JAX-WS artifacts generated by wsdl2java should be perfectly sufficient for what you need.

As for your second question regarding how to target different prod/QA endpoints, you should ask a separate question for that, with full examples of what you have.

like image 82
skaffman Avatar answered Oct 12 '22 09:10

skaffman