Hi Christian,

I think this could be down to the fact that you haven't declared a
target namespace or a default namespace, avoiding this will probably
cause problems with the HelloWorldPort input message. Try sticking
something like this into the definitions element:

<wsdl:definitions
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/";
    xmlns:xs="http://www.w3.org/2001/XMLSchema";
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/";
    xmlns="http://tempuri.org";
    targetNamespace="http://tempuri.org";>
.....

Regards,
- Martin

-----Original Message-----
From: Christian Vest Hansen [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 24, 2007 4:15 PM
To: cxf-user@incubator.apache.org
Subject: Cannot find the declaration of element 'wsdl:definitions'

Hi,

Using the (currently) latest snapshot, namely
apache-cxf-2.1-incubator-20070720.011624-1(.zip).

An error (see bellow) is produced when you expose the following WSDL
file to the wsdlvalidator application:

================= The WSDL ===================== <?xml version="1.0"
encoding="UTF-8"?> <wsdl:definitions
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/";
    xmlns:xs="http://www.w3.org/2001/XMLSchema";
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/";>

        <wsdl:message name="Msg">
                <wsdl:part name="msg" type="xs:string"/>
        </wsdl:message>
        <wsdl:portType name="HelloWorldPort">
                <wsdl:operation name="SayHello">
                        <wsdl:input message="Msg"/>
                        <wsdl:output message="Msg"/>
                </wsdl:operation>
        </wsdl:portType>
        <wsdl:binding name="HelloWorldSOAP" type="HelloWorldPort">
                <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
                <wsdl:operation name="SayHello">
                        <soap:operation
soapAction="http://unwire.dk/SayHello"/>
                        <wsdl:input>
                                <soap:body use="literal"
namespace="http://ws.unwire.dk/"/>
                        </wsdl:input>
                        <wsdl:output>
                                <soap:body use="literal"
namespace="http://ws.unwire.dk/"/>
                        </wsdl:output>
                </wsdl:operation>
        </wsdl:binding>
        <wsdl:service name="HelloWorld">
                <wsdl:port name="HelloWorldDev"
binding="HelloWorldSOAP">
                        <soap:address
location="http://localhost:8080/Services/HelloWorld"/>
                </wsdl:port>
        </wsdl:service>
</wsdl:definitions>



================= The Error =====================

wsdlvalidator -verbose
/Users/vest/workspace/Service/src/main/resources/HelloWorld.wsdl
wsdlvalidator - 2.1-incubator-SNAPSHOT

WSDLValidator Error :
line 8 column 56 of
file:/Users/vest/workspace/Statistics2/src/main/resources/HelloWorld.wsd
l:
cvc-elt.1: Cannot find the declaration of element 'wsdl:definitions'.

[+] Verbose turned on

org.apache.cxf.tools.common.ToolException:
line 8 column 56 of
file:/Users/vest/workspace/Statistics2/src/main/resources/HelloWorld.wsd
l:
cvc-elt.1: Cannot find the declaration of element 'wsdl:definitions'.
        at
org.apache.cxf.tools.validator.internal.SchemaValidator.validate(SchemaV
alidator.java:202)
        at
org.apache.cxf.tools.validator.internal.SchemaValidator.validate(SchemaV
alidator.java:118)
        at
org.apache.cxf.tools.validator.internal.SchemaValidator.isValid(SchemaVa
lidator.java:102)
        at
org.apache.cxf.tools.validator.internal.WSDL11Validator.isValid(WSDL11Va
lidator.java:113)
        at
org.apache.cxf.tools.validator.WSDLValidator.execute(WSDLValidator.java:
65)
        at
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:
83)
        at
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:
52)
        at
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:
39)
        at
org.apache.cxf.tools.validator.WSDLValidator.main(WSDLValidator.java:93)


Any idears? I honestly can't see what would be wrong with my WSDL.

--
Venlig hilsen / Kind regards,
Christian Vest Hansen.

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Reply via email to