No such property: style for class: com.predic8.wsdl.http.HTTPBinding

265 views
Skip to first unread message

Bertrand Goetzmann

unread,
Sep 19, 2013, 11:41:13 AM9/19/13
to soa-...@googlegroups.com
Hello,

I get the exception "groovy.lang.MissingPropertyException: No such property: style for class: com.predic8.wsdl.http.HTTPBinding" when trying to generate SOAP message requests against the WSDL document found here: "http://www.webservicex.net/stockquote.asmx?WSDL", with a Groovy script using GRAPE (so you can run it with the groovy command).

@GrabResolver(name='predic8-releases', root='http://repository.membrane-soa.org/content/repositories/releases')
@Grab(group='com.predic8', module='soa-model-core', version='1.4.1', transitive=false)
@Grab(group='org.apache.httpcomponents', module='httpclient', version='4.2.2') 
import com.predic8.wsdl.*
import com.predic8.wstool.creator.*
import groovy.xml.MarkupBuilder


// Use a ExternalResolver instance if you are behind a proxy
//def er = new com.predic8.xml.util.ExternalResolver(proxyHost: 'proxy.company.net', proxyPort: 8080)

def parser = new WSDLParser(/*resourceResolver: er*/)



def writer = new StringWriter()
     
def creator = new SOARequestCreator(wsdl, new RequestTemplateCreator(), new MarkupBuilder(writer))

 
wsdl.services.each { service ->
    service.ports.each { port ->
    println "\n<!-- Port name: ${port.name} -->"
        def binding = port.binding
        def portType = binding.portType
        portType.operations.each { op ->
            creator.createRequest(port.name, op.name, binding.name)

            System.out.println(writer)

            writer.buffer.length = 0
        }
    }
}

I'm running this script with Groovy 2.1.1.

The problem seems related to the style attribute found in the WSDL.

Any idea?


Cheers,

Bertrand.


PS: I'm preparing an article about groovy-wslite and Membrane SOA Model.

Kaveh Keshavarzi

unread,
Sep 19, 2013, 12:11:32 PM9/19/13
to soa-...@googlegroups.com
Hello Bertrand,

tank you for your report.
You are right. The problem is because of the style attribute. In a WSDL each binding has its own style (or doesn't have any!). The WSDL your are trying to parse provides multiple bindings, including HTTP bindings. An HTTP binding doesn't have a style and so SOA Model can't get the value of it. Therefore the exception.

The SOARequestCreator supports also only SOAP1.1 and SOAP1.2 Bindings.

you can add the following line to your code to avoid the exception:

if(binding.protocol != 'SOAP11' || binding.protocol != 'SOAP12') return

I hope this could help you and am excited to read your article ;-)

Cheers,

Kaveh

Kaveh Keshavarzi

unread,
Sep 20, 2013, 2:53:28 AM9/20/13
to soa-...@googlegroups.com
It should be: 

if(!(binding.protocol == 'SOAP11' || binding.protocol == 'SOAP12')) return

Sorry about my mistake! 
Reply all
Reply to author
Forward
0 new messages