Grails-Plugin-Consortium / grails-cxf-client

Easy cxf client for grails
http://grails.org/plugin/cxf-client
27 stars 30 forks source link

SOAP 1.2 Support #48

Open strelok1 opened 9 years ago

strelok1 commented 9 years ago

Hi,

It seems that SOAP 1.2 support is missing from this plugin. Is that correct?

Setting

proxyFactoryBindingId = 'http://schemas.xmlsoap.org/wsdl/soap12/'

seems to be insufficient as the message generated is still Soap 1.1. The only way I found it would work is by explicitly setting a SoapBindingConfiguration on the JaxWSProxyFactoryBean like so:

JaxWsProxyFactoryBean clientProxyFactory = new JaxWsProxyFactoryBean(serviceClass: serviceInterface,
                address: serviceEndpointAddress,
                bus: BusFactory.defaultBus)
       SoapBindingConfiguration configuration = new SoapBindingConfiguration()
       configuration.version = Soap12.instance
       clientProxyFactory.bindingConfig = configuration

I'm happy to provide a patch to add Soap 1.2 support (with a config flag for the client) unless I am missing something and it should actually work?

Cheers, R

ctoestreich commented 9 years ago

Easiest is to fork and submit pull request. I will gladly merge and release

mariodavid commented 9 years ago

Is there an update on this? I need to send SOAP 1.2 messages and i'm not sure, if this issue is already closed because the feature is implemented already? Can anyone give me a hint? thx

ctoestreich commented 9 years ago

I have fixed this so that using the proxyFactoryBindingId = 'http://schemas.xmlsoap.org/wsdl/soap12/' in the config should add a soapbindingconfig and work correctly now. Please get version 2.0.3 and test.

mariodavid commented 9 years ago

hi, thanks for the quick response. It worked out quite well. I additionally had to configure the contentType in the config.groovy to be application/soap+xml as the SOAP 1.2 spec requires:

    myClient {
        wsdl = "..."

        proxyFactoryBindingId = 'http://schemas.xmlsoap.org/wsdl/soap12/'
        contentType = 'application/soap+xml; charset=UTF-8'

    }

What i'm wondering about is, if in the given wsdl document only a soap12 binding is declared, why wsdl2java does not recognizes the situation and creates a corrent client binding. Or do i get something wrong here? Would that even be possible?