File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes error in accessing the webservice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "error in accessing the webservice " Watch "error in accessing the webservice " New topic
Author

error in accessing the webservice

Satchidananda Mohanty
Ranch Hand

Joined: Mar 12, 2008
Posts: 77

Hi,

I am using netbeans 7.0 and java 6 update 21. While trying to access the webservice client it shows the following errors.

parsing WSDL...


[WARNING] src-resolve: Cannot resolve the name 's1:char' to a(n) 'type definition' component.
line 37 of file:/F:/maxtest/src/conf/xml-resources/web-service-references/xxxxxxxxxxx.asmx.wsdl#types?schema1

[WARNING] src-resolve.4.2: Error resolving component 's:schema'. It was detected that 's:schema' is in namespace 'http://www.w3.org/2001/XMLSchema', but components from this namespace are not referenceable from schema document 'file:/F:/maxtest/src/conf/xml-resources/web-service-references/xxxxxxxxx.asmx.wsdl#types?schema1'. If this is the incorrect namespace, perhaps the prefix of 's:schema' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:/F:/maxtest/src/conf/xml-resources/web-service-references/xxxxxxxxxxxxxxxxx.asmx.wsdl#types?schema1'.
line 287 of file:/F:/maxtest/src/conf/xml-resources/web-service-references/xxxxxxxxxxx.asmx.wsdl#types?schema1

[ERROR] undefined element declaration 's:schema'
line 287 of file:/F:/maxtest/src/conf/xml-resources/web-service-references/xxxxxxxxxxxxxxxxxxxxxxxxxx.asmx.wsdl

[ERROR] undefined element declaration 's:schema'
line 304 of file:/F:/maxtest/src/conf/xml-resources/web-service-references/xxxxxxxxxxxxxxxxxxxxxxxxx.asmx.wsdl

[ERROR] undefined element declaration 's:schema'
line 362 of file:/F:/maxtest/src/conf/xml-resources/web-service-references/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.asmx.wsdl

[ERROR] undefined element declaration 's:schema'
line

and the error pop up is web service client can not created by JAXWS:wsimport utility reason:undefined element declaration 's:schema'

error pop up
In the same application i have used the another webservice before and it works fine.

Please help.

Thanks,


Zeet

SCJP 6.0
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
There seems to be something wrong with the WSDL. Have you tried to validate it?
Regretfully, I cannot say much more without having seen the WSDL - can you post it here?
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Satchidananda Mohanty
Ranch Hand

Joined: Mar 12, 2008
Posts: 77

Dear Ivan,

Thanks a lot for your reply.
unfortunately I could not share the url over here . but I can share that with you in private message.

According to you I have validated the xml and it shows the following details.

XML validation started.
Checking file:/F:/maxtest/src/conf/xml-resources/web-service-references/xxxxxxxxxxxxxxxxxxxxxxxxxx.asmx.wsdl...
cvc-elt.1: Cannot find the declaration of element 'wsdl:definitions'. [2]
XML validation finished.

Damian Cardozo
Greenhorn

Joined: Aug 04, 2011
Posts: 10
Hello Satchidananda, were you ever able to fix this? I'm having the same issue. It seems that wsimport has problems parsing this:



Thanks
Satchidananda Mohanty
Ranch Hand

Joined: Mar 12, 2008
Posts: 77

Hello Damian ,

I could not fixed that issue. Because problem was there in the wsdl file with my client. And that version of ASP supports method overloading which is a big problem with my java environment.

Thanks,
Damian Cardozo
Greenhorn

Joined: Aug 04, 2011
Posts: 10
Hello! that's bad news... but thanks for replying!

Damian
Utkarsh Jauhari
Greenhorn

Joined: Jan 12, 2013
Posts: 2
Hi Damian,

I am facing the same issue and getting undefined 's:schema' error. Could you please help us if this issue has been resolved. Or if you have any other alternative for this problem.

Regards,
Utkarsh
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 520
    
    3
...and getting undefined 's:schema' error.

You cannot expect otherwise if you have not import the namespace corresponding to http://www.w3.org/2001/XMLSchema.

The schema defines the targetNamespace which is usually not the namespace of the XMLSchema. That's why you use ref to refer the vocabulary of another namespace which happens to be the XMLSchema.

To import it, something like this would be a start.

If validation is needed, you need further have to code an EntityResolver to fetch the schema of schemas, locally or over the net. That's the general setting. The detail? you're on your own.

ps: The query string after ...XMLSchema above is an artifact of the post handling of the forum, not of mine.
Rob Chillingworth
Greenhorn

Joined: Sep 27, 2007
Posts: 2
All,
I know this is a little late, but I was having the same issue as above, but using Rational Application Developer. After much searching, I found this article:
http://stackoverflow.com/questions/18898261/undefined-element-declaration-xsschema

Basically, you need to explicitly use a couple of binding references, and that will at least get rid of the errors, so that wsimport will generate / compile the code.

customization.xjb file:



Then run this command (with your service wsdl location):


Regards,

Rob.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: error in accessing the webservice