membrane / soa-model

Toolkit and Java API for WSDL, WADL and XML Schema.
http://www.membrane-soa.org/soa-model/
Apache License 2.0
93 stars 73 forks source link

Questions about root element. #255

Closed holiiveira closed 8 years ago

holiiveira commented 8 years ago

I'm using the soa-model-core-1.5.4 and groovy-1.8.6 version. I'm running tests with soa-model, and in particular wsdl, I have the following exception:

Caused by: com.predic8.soamodel.WrongGrammarException: Expected root element '{http://schemas.xmlsoap.org/wsdl/}definitions' for the WSDL document but was' {http://www.w3.org/2001 / XMLSchema} schema '

What I would like to know is, is this a compatibility problem between soa-model and wsdl, or can it be a problem in my code?

predic8 commented 8 years ago

Looks like you feed a file containing a XML schema into the WSDL parser instead of a WSDL file. Please open the file and have a look if the root element is really definitions in the WSDL namespace.

holiiveira commented 8 years ago

Looking at my WSDL, the definition is correct:

<?xml version="1.0" encoding="UTF-8" ?> 
<definitions name="TESTE" targetNamespace="urn:applic:services:TESTE" xmlns:tns="urn:applic:services:TESTE" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://schemas.xmlsoap.org/wsdl/"

Can the order of the settings interfere?

helpermethod commented 8 years ago

Hi @holiiveira,

if your WSDL document doesn't contain sensitive information you can upload it to

WSDL Analyzer

which may tell you what's wrong with your WSDL (if at all).

holiiveira commented 8 years ago

Hi @helpermethod,

I did the analysis, everything is fine with the WSDL.

holiiveira commented 8 years ago

I made some tests and realized that the error only occurs when the WSDL has a schema to import. Here's the xsd definition in question:

<?xml version="1.0" encoding="UTF-8" ?> 
<schema elementFormDefault="qualified" targetNamespace="urn::applic:services:TESTE" xmlns:tns="urn::applic:servicesTESTE" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://www.w3.org/2001/XMLSchema">