Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ When using the annotation, the property values will only be used if the correspo
EndpointType expose() default EndpointType.JAX_WS
boolean soap12() default false
String wsdl() default ''
String namespace() default ''
//Interceptors
String[] inInterceptors() default []
String[] outInterceptors() default []
Expand Down Expand Up @@ -283,14 +284,10 @@ class CarService {

**WSDL**

To expose as a wsdl first jax web service endpoint <http://cxf.apache.org/docs/jax-ws-configuration.html> add the wsdl property and classpath to the wsdl as well as setting the endpoint type to `EndpointType.JAX_WS_WSDL`.
To expose as a wsdl first jax web service endpoint <http://cxf.apache.org/docs/jax-ws-configuration.html> add the wsdl property.

```groovy
@WebService(name = 'CustomerServiceWsdlEndpoint',
targetNamespace = 'http://test.cxf.grails.org/',
serviceName = 'CustomerServiceWsdlEndpoint',
portName = 'CustomerServiceWsdlPort')
@GrailsCxfEndpoint(wsdl = 'org/grails/cxf/test/soap/CustomerService.wsdl', expose = EndpointType.JAX_WS_WSDL)
@GrailsCxfEndpoint(wsdl = 'org/grails/cxf/test/soap/CustomerService.wsdl', address='/customerServiceWsdlEndpoint')
class AnnotatedCustomerServiceWsdlEndpoint {

CustomerServiceEndpoint customerServiceEndpoint
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.grails.cxf.utils
package org.grails.cxf.utils;

import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
Expand Down Expand Up @@ -31,6 +31,7 @@ class EndpointRegistrationUtil {
GrailsCxfEndpoint annotation = getAnnotation(implementor)
//needs to happen first
setServiceAndPortName(endpoint, implementor, annotation)
addWsdl(annotation, endpoint)
publishEndpointUrl(endpoint, implementor, annotation)
//needs to happen last due to changing factory service stuff
addConfiguredProperties(endpoint, implementor, annotation, context)
Expand Down Expand Up @@ -59,7 +60,6 @@ class EndpointRegistrationUtil {
assert implementor != null
if (annotation != null) {
addSoap12(annotation, endpoint)
addWsdl(annotation, endpoint)
addProperties(annotation, implementor, endpoint)
addInInterceptors(annotation, endpoint, context)
addInFaultInterceptors(annotation, endpoint, context)
Expand All @@ -85,7 +85,7 @@ class EndpointRegistrationUtil {
private static void addServiceName(GrailsCxfEndpoint annotation, Object implementor, EndpointImpl endpoint) {
if (annotation?.name()) {
endpoint.serviceName =
new QName(getNamespaceURI(implementor),
new QName(getNamespaceURI(annotation, implementor),
annotation.name(),
XMLConstants.DEFAULT_NS_PREFIX)
}
Expand All @@ -94,14 +94,14 @@ class EndpointRegistrationUtil {
private static void addPortName(GrailsCxfEndpoint annotation, Object implementor, EndpointImpl endpoint) {
if (annotation?.port()) {
endpoint.endpointName =
new QName(getNamespaceURI(implementor),
new QName(getNamespaceURI(annotation, implementor),
annotation.port(),
XMLConstants.DEFAULT_NS_PREFIX)
}
}

private static String getNamespaceURI(implementor) {
'http://' + implementor.getClass().package.name.split('\\.').reverse().join(".")
private static String getNamespaceURI(GrailsCxfEndpoint annotation, Object implementor) {
return annotation?.namespace() ?: ( 'http://' + implementor.getClass().package.name.split('\\.').reverse().join(".") )
}

private static void addWsdl(GrailsCxfEndpoint annotation, EndpointImpl endpoint) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import java.lang.annotation.Target
EndpointType expose() default EndpointType.JAX_WS
boolean soap12() default false
String wsdl() default ''
String namespace() default ''
//Interceptors
String[] inInterceptors() default []
String[] outInterceptors() default []
Expand Down