You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Lee Theobald <Le...@openobjects.com> on 2010/06/04 15:35:03 UTC

Validation & WSDL2Java Generated Classes

Hi all,

I'm trying to generate some classes for a third party web service but not
having much luck.  It appears that the WSDL is "invalid".  It's not
fantastically formed by the looks of things but I don't think it's invalid. 
Does anyone know if there's anyway I can disable the validation for this
WSDL?

The error message I am getting looks like the following:

Caused by: javax.wsdl.WSDLException: WSDLException (at /head):
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
org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:230)
        at
org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:179)
        at
org.apache.cxf.wsdl11.WSDLServiceFactory.(WSDLServiceFactory.java:91)
        ... 104 more


(full stack trace if needed: 
http://old.nabble.com/file/p28780040/fullstacktrace.txt fullstacktrace.txt )

The WSDL I'm trying to parse can be seen at: 
https://www.parentknowhowdirectory.org.uk/isppsoap/deposit/?wsdl
https://www.parentknowhowdirectory.org.uk/isppsoap/deposit/?wsdl 

I unfortunately have no control over the WSDL's contents so I cannot change
it in anyway way so I need a way of getting a client to this service with
the WSDL as is.

Cheers for any help,

Lee

-- 
View this message in context: http://old.nabble.com/Validation---WSDL2Java-Generated-Classes-tp28780040p28780040.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Validation & WSDL2Java Generated Classes

Posted by Lee Theobald <Le...@openobjects.com>.
Thanks for the input guys.  I had noticed the duplicate imports and should
have realised that was the issue.  I'll get back to them and see if they'll
change it.  Chances are slim as "it works for other people" (and indeed it
does work in things like SoapUI).  For now I'm doing as suggested and
keeping a local version but, to me, that defeats the point of publishing the
WSDL in the first place.
-- 
View this message in context: http://old.nabble.com/Validation---WSDL2Java-Generated-Classes-tp28780040p28802232.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Validation & WSDL2Java Generated Classes

Posted by Daniel Kulp <dk...@apache.org>.
Well,  that wsdl is definitely not valid.   If you look in the schemas:
<types>
<xsd:schema>
<xsd:import namespace="http://dcsf.gov.uk/ISPP/Webservice/encodedTypes" 
schemaLocation="https://www.parentknowhowdirectory.org.uk/isppsoap/deposit?xsd=1" 
/>
</xsd:schema>
<xsd:schema>
<xsd:import namespace="http://dcsf.gov.uk/ISPP/Webservice" 
schemaLocation="https://www.parentknowhowdirectory.org.uk/isppsoap/deposit?xsd=1" 
/>
</xsd:schema>
</types>


You see that its importing the SAME xsds, but with two different namespaces.   
That's definitely not going to work.  


Dan

On Friday 04 June 2010 9:35:03 am Lee Theobald wrote:
> Hi all,
> 
> I'm trying to generate some classes for a third party web service but not
> having much luck.  It appears that the WSDL is "invalid".  It's not
> fantastically formed by the looks of things but I don't think it's invalid.
> Does anyone know if there's anyway I can disable the validation for this
> WSDL?
> 
> The error message I am getting looks like the following:
> 
> Caused by: javax.wsdl.WSDLException: WSDLException (at /head):
> 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
> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:2
> 30) at
> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:17
> 9) at
> org.apache.cxf.wsdl11.WSDLServiceFactory.(WSDLServiceFactory.java:91)
>         ... 104 more
> 
> 
> (full stack trace if needed:
> http://old.nabble.com/file/p28780040/fullstacktrace.txt fullstacktrace.txt
> )
> 
> The WSDL I'm trying to parse can be seen at:
> https://www.parentknowhowdirectory.org.uk/isppsoap/deposit/?wsdl
> https://www.parentknowhowdirectory.org.uk/isppsoap/deposit/?wsdl
> 
> I unfortunately have no control over the WSDL's contents so I cannot change
> it in anyway way so I need a way of getting a client to this service with
> the WSDL as is.
> 
> Cheers for any help,
> 
> Lee

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

Re: Validation & WSDL2Java Generated Classes

Posted by Glen Mazza <gl...@gmail.com>.
You can try Metro's wsimport (a copy of which should be in your JDK's bin
directory) to see what Metro has to say about whether or not the WSDL is
actually invalid.

If it is, you can save the WSDL locally, and (however nonideal and formally
frowned upon) alter it just prior to generating your JAX-WS objects with
it--as long as the generated JAX-WS artifacts will generate what the web
service is expecting you should be OK.

Glen


Lee Theobald wrote:
> 
> Hi all,
> 
> I'm trying to generate some classes for a third party web service but not
> having much luck.  It appears that the WSDL is "invalid".  It's not
> fantastically formed by the looks of things but I don't think it's
> invalid.  Does anyone know if there's anyway I can disable the validation
> for this WSDL?
> 
> The error message I am getting looks like the following:
> 
> <pre>Caused by: javax.wsdl.WSDLException: WSDLException (at /head):
> 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
> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:230)
>         at
> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:179)
>         at
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
>         ... 104 more</pre>
> 
> (full stack trace if needed: 
> http://old.nabble.com/file/p28780040/fullstacktrace.txt fullstacktrace.txt
> )
> 
> <p>The WSDL I'm trying to parse can be seen at: 
> https://www.parentknowhowdirectory.org.uk/isppsoap/deposit/?wsdl
> https://www.parentknowhowdirectory.org.uk/isppsoap/deposit/?wsdl </p>
> <p>I unfortunately have no control over the WSDL's contents so I cannot
> change it in anyway way so I need a way of getting a client to this
> service with the WSDL as is.</p>
> <p>Cheers for any help,<br />
> Lee</p>
> 

-- 
View this message in context: http://old.nabble.com/Validation---WSDL2Java-Generated-Classes-tp28780040p28785750.html
Sent from the cxf-user mailing list archive at Nabble.com.