You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Diginside <ho...@digitalinsight.com> on 2009/03/05 20:46:27 UTC

What does this WSDLException mean?

I've a client consuming a web service using the WSDL file given. When I
started to test, I got the following exception thrown.

javax.wsdl.WSDLException: WSDLException (at /soapenv:Envelope):
faultCode=INVALID_WSDL: Expected element
'{http://schemas.xmlsoap.org/wsdl/}definitions'.
	at com.ibm.wsdl.xml.WSDLReaderImpl.checkElementName(Unknown Source)
	at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
	at
org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:211)
	at
org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:176)
	at
org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:81)
	... 7 more
Disconnected from the target VM, address: '127.0.0.1:1180', transport:
'socket'

I've searched the internet all over but found only somewhat related thread,
indicating the WSDL file might be done in 1.0. But looking at the WSDL I
have, I don't think that's the case.

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2007 sp1 (http://www.altova.com) -->
<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:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:nts="http://www.mycompany.com/as/notification/pub/xsd"
xmlns:tns="http://www.mycompany.com/as/notification/pub/wsdl"
xmlns:ns1="http://www.mycompany.com/as/common/xsd"
targetNamespace="http://www.mycompany.com/as/notification/pub/wsdl">
	<wsdl:types>
		<xsd:schema
targetNamespace="http://www.mycompany.com/as/notification/pub/xsd"
elementFormDefault="qualified">
			<xsd:include schemaLocation="notification.xsd"/>
		</xsd:schema>
		<xsd:schema targetNamespace="http://www.mycompany.com/as/common/xsd"
elementFormDefault="qualified">
			<xsd:include schemaLocation="common.xsd"/>
		</xsd:schema>
	</wsdl:types>
...

I am new to CXF. Any idea or suggestion would be greatly appreciated.
-- 
View this message in context: http://www.nabble.com/What-does-this-WSDLException-mean--tp22359116p22359116.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: What does this WSDLException mean?

Posted by Diginside <ho...@digitalinsight.com>.
Thanks Dan.

Well, in the CXF generated service, there is an annotation, and a static
instantiation of url,

@WebServiceClient(name = "NotificationService", 
                  wsdlLocation =
"file:/E:/home/perforce/depot/development/software/client1/schema/notification/notification.wsdl",
                  targetNamespace =
"http://www.mycompany.com/as/notification/pub/wsdl") 
public class NotificationService extends Service {

    public final static URL WSDL_LOCATION;
    public final static QName SERVICE = new
QName("http://www.mycompany.com/as/notification/pub/wsdl",
"NotificationService");
    public final static QName NotificationPort = new
QName("http://www.mycompany.com/as/notification/pub/wsdl",
"NotificationPort");
    static {
        URL url = null;
        try {
            url = new
URL("file:/E:/home/perforce/depot/development/software/client1/schema/notification/notification.wsdl");
        } catch (MalformedURLException e) {
            System.err.println("Can not initialize the default wsdl from
file:/E:/home/perforce/depot/development/software/client1/schema/notification/notification.wsdl");
            // e.printStackTrace();
        }
        WSDL_LOCATION = url;
    }

    public NotificationService(URL wsdlLocation) {
        super(wsdlLocation, SERVICE);
    }
...

And I instantiate my following client with a live wsdl file, say,
https://10.11.100.10/.../notification?wsdl
...

    public Client(String endpointStr) {
        try {
            serviceUrl = new URL(endpointStr);
        } catch (MalformedURLException e) {
            e.printStackTrace();  
        } catch (IOException e) {
            e.printStackTrace();  
        }
        turnoffSSLHostMatchCheck();
        NotificationService svc = new NotificationService(serviceUrl);
        port = svc.getNotificationPort();
    }
...

When I noticed the difference between "live" and local wsdl files, I changed
them all to the live wsdl. But I still got the exception...


dkulp wrote:
> 
> 
> Is the client grabbing the "live" wsdl at runtime at startup?    It LOOKS
> like 
> you pointed it at the endpoint address without adding the ?wsdl to the end
> of 
> the URL.   It's thus getting a SOAP message back (probably a fault)
> instead of 
> the wsdl.
> 
> Dan
> 
> 
> On Thu March 5 2009 2:46:27 pm Diginside wrote:
>> I've a client consuming a web service using the WSDL file given. When I
>> started to test, I got the following exception thrown.
>>
>> javax.wsdl.WSDLException: WSDLException (at /soapenv:Envelope):
>> faultCode=INVALID_WSDL: Expected element
>> '{http://schemas.xmlsoap.org/wsdl/}definitions'.
>> 	at com.ibm.wsdl.xml.WSDLReaderImpl.checkElementName(Unknown Source)
>> 	at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
>> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>> 	at
>> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:2
>>11) at
>> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:17
>>6) at
>> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:81)
>> 	... 7 more
>> Disconnected from the target VM, address: '127.0.0.1:1180', transport:
>> 'socket'
>>
>> I've searched the internet all over but found only somewhat related
>> thread,
>> indicating the WSDL file might be done in 1.0. But looking at the WSDL I
>> have, I don't think that's the case.
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!-- edited with XMLSpy v2007 sp1 (http://www.altova.com) -->
>> <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:xsd="http://www.w3.org/2001/XMLSchema"
>> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
>> xmlns:nts="http://www.mycompany.com/as/notification/pub/xsd"
>> xmlns:tns="http://www.mycompany.com/as/notification/pub/wsdl"
>> xmlns:ns1="http://www.mycompany.com/as/common/xsd"
>> targetNamespace="http://www.mycompany.com/as/notification/pub/wsdl">
>> 	<wsdl:types>
>> 		<xsd:schema
>> targetNamespace="http://www.mycompany.com/as/notification/pub/xsd"
>> elementFormDefault="qualified">
>> 			<xsd:include schemaLocation="notification.xsd"/>
>> 		</xsd:schema>
>> 		<xsd:schema targetNamespace="http://www.mycompany.com/as/common/xsd"
>> elementFormDefault="qualified">
>> 			<xsd:include schemaLocation="common.xsd"/>
>> 		</xsd:schema>
>> 	</wsdl:types>
>> ...
>>
>> I am new to CXF. Any idea or suggestion would be greatly appreciated.
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://www.nabble.com/What-does-this-WSDLException-mean--tp22359116p22362435.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: What does this WSDLException mean?

Posted by Daniel Kulp <dk...@apache.org>.
Is the client grabbing the "live" wsdl at runtime at startup?    It LOOKS like 
you pointed it at the endpoint address without adding the ?wsdl to the end of 
the URL.   It's thus getting a SOAP message back (probably a fault) instead of 
the wsdl.

Dan


On Thu March 5 2009 2:46:27 pm Diginside wrote:
> I've a client consuming a web service using the WSDL file given. When I
> started to test, I got the following exception thrown.
>
> javax.wsdl.WSDLException: WSDLException (at /soapenv:Envelope):
> faultCode=INVALID_WSDL: Expected element
> '{http://schemas.xmlsoap.org/wsdl/}definitions'.
> 	at com.ibm.wsdl.xml.WSDLReaderImpl.checkElementName(Unknown Source)
> 	at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
> 	at
> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:2
>11) at
> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:17
>6) at
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:81)
> 	... 7 more
> Disconnected from the target VM, address: '127.0.0.1:1180', transport:
> 'socket'
>
> I've searched the internet all over but found only somewhat related thread,
> indicating the WSDL file might be done in 1.0. But looking at the WSDL I
> have, I don't think that's the case.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- edited with XMLSpy v2007 sp1 (http://www.altova.com) -->
> <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:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> xmlns:nts="http://www.mycompany.com/as/notification/pub/xsd"
> xmlns:tns="http://www.mycompany.com/as/notification/pub/wsdl"
> xmlns:ns1="http://www.mycompany.com/as/common/xsd"
> targetNamespace="http://www.mycompany.com/as/notification/pub/wsdl">
> 	<wsdl:types>
> 		<xsd:schema
> targetNamespace="http://www.mycompany.com/as/notification/pub/xsd"
> elementFormDefault="qualified">
> 			<xsd:include schemaLocation="notification.xsd"/>
> 		</xsd:schema>
> 		<xsd:schema targetNamespace="http://www.mycompany.com/as/common/xsd"
> elementFormDefault="qualified">
> 			<xsd:include schemaLocation="common.xsd"/>
> 		</xsd:schema>
> 	</wsdl:types>
> ...
>
> I am new to CXF. Any idea or suggestion would be greatly appreciated.

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: What does this WSDLException mean?

Posted by Diginside <ho...@digitalinsight.com>.
Thanks for the quick reply. I just removed the comment from the local wsdl
file I used to generate my client stub, and tested it again. The error
remains. I'll ask the wsdl author to remove the comment from the live wsdl
and see if it helps.



Glen Mazza wrote:
> 
> I'm unsure, but I think that the XMLSpy comment you have on line two may
> be causing the problem.  (It's possible that such comments are not
> allowed, and hence the parser is complaining that it can't find the
> definitions element on line 2 where it is expecting it.)  Can you remove
> that and see if that fixes things?
> 
> Glen
> 
> 
> Diginside wrote:
>> 
>> I've a client consuming a web service using the WSDL file given. When I
>> started to test, I got the following exception thrown.
>> 
>> javax.wsdl.WSDLException: WSDLException (at /soapenv:Envelope):
>> faultCode=INVALID_WSDL: Expected element
>> '{http://schemas.xmlsoap.org/wsdl/}definitions'.
>> 	at com.ibm.wsdl.xml.WSDLReaderImpl.checkElementName(Unknown Source)
>> 	at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
>> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>> 	at
>> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:211)
>> 	at
>> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:176)
>> 	at
>> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:81)
>> 	... 7 more
>> Disconnected from the target VM, address: '127.0.0.1:1180', transport:
>> 'socket'
>> 
>> I've searched the internet all over but found only somewhat related
>> thread, indicating the WSDL file might be done in 1.0. But looking at the
>> WSDL I have, I don't think that's the case.
>> 
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!-- edited with XMLSpy v2007 sp1 (http://www.altova.com) -->
>> <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:xsd="http://www.w3.org/2001/XMLSchema"
>> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
>> xmlns:nts="http://www.mycompany.com/as/notification/pub/xsd"
>> xmlns:tns="http://www.mycompany.com/as/notification/pub/wsdl"
>> xmlns:ns1="http://www.mycompany.com/as/common/xsd"
>> targetNamespace="http://www.mycompany.com/as/notification/pub/wsdl">
>> 	<wsdl:types>
>> 		<xsd:schema
>> targetNamespace="http://www.mycompany.com/as/notification/pub/xsd"
>> elementFormDefault="qualified">
>> 			<xsd:include schemaLocation="notification.xsd"/>
>> 		</xsd:schema>
>> 		<xsd:schema targetNamespace="http://www.mycompany.com/as/common/xsd"
>> elementFormDefault="qualified">
>> 			<xsd:include schemaLocation="common.xsd"/>
>> 		</xsd:schema>
>> 	</wsdl:types>
>> ...
>> 
>> I am new to CXF. Any idea or suggestion would be greatly appreciated.
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/What-does-this-WSDLException-mean--tp22359116p22362180.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: What does this WSDLException mean?

Posted by Glen Mazza <gl...@gmail.com>.
I'm unsure, but I think that the XMLSpy comment you have on line two may be
causing the problem.  (It's possible that such comments are not allowed, and
hence the parser is complaining that it can't find the definitions element
on line 2 where it is expecting it.)  Can you remove that and see if that
fixes things?

Glen


Diginside wrote:
> 
> I've a client consuming a web service using the WSDL file given. When I
> started to test, I got the following exception thrown.
> 
> javax.wsdl.WSDLException: WSDLException (at /soapenv:Envelope):
> faultCode=INVALID_WSDL: Expected element
> '{http://schemas.xmlsoap.org/wsdl/}definitions'.
> 	at com.ibm.wsdl.xml.WSDLReaderImpl.checkElementName(Unknown Source)
> 	at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
> 	at
> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:211)
> 	at
> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:176)
> 	at
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:81)
> 	... 7 more
> Disconnected from the target VM, address: '127.0.0.1:1180', transport:
> 'socket'
> 
> I've searched the internet all over but found only somewhat related
> thread, indicating the WSDL file might be done in 1.0. But looking at the
> WSDL I have, I don't think that's the case.
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- edited with XMLSpy v2007 sp1 (http://www.altova.com) -->
> <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:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> xmlns:nts="http://www.mycompany.com/as/notification/pub/xsd"
> xmlns:tns="http://www.mycompany.com/as/notification/pub/wsdl"
> xmlns:ns1="http://www.mycompany.com/as/common/xsd"
> targetNamespace="http://www.mycompany.com/as/notification/pub/wsdl">
> 	<wsdl:types>
> 		<xsd:schema
> targetNamespace="http://www.mycompany.com/as/notification/pub/xsd"
> elementFormDefault="qualified">
> 			<xsd:include schemaLocation="notification.xsd"/>
> 		</xsd:schema>
> 		<xsd:schema targetNamespace="http://www.mycompany.com/as/common/xsd"
> elementFormDefault="qualified">
> 			<xsd:include schemaLocation="common.xsd"/>
> 		</xsd:schema>
> 	</wsdl:types>
> ...
> 
> I am new to CXF. Any idea or suggestion would be greatly appreciated.
> 

-- 
View this message in context: http://www.nabble.com/What-does-this-WSDLException-mean--tp22359116p22360169.html
Sent from the cxf-user mailing list archive at Nabble.com.