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
> [email protected]
> 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.

Reply via email to