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 Certification (SCDJWS/OCEJWSD) and the fly likes WSDL external schema import Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "WSDL external schema import" Watch "WSDL external schema import" New topic
Author

WSDL external schema import

Jim Janssens
Ranch Hand

Joined: Sep 24, 2004
Posts: 210
I have a WSDL document belonging to tns 'myWebserviceTNS'. Next, I have an external schema belonging to tns 'testschema'. I want to import the schema in the WSDL document. I can do this like:




Now, in a message element I can refer to the external element as 'ts:myElement' (myElement being an element in the 'testschema.xsd').

Is this the only way to accomplish this ? I find it rather strange to create a new schema just to import an existing schema. Agreed, the new schema does not contain any elements, but it feels weird ?
[ December 27, 2006: Message edited by: Jim Janssens ]
Rizwan Mohammad
Ranch Hand

Joined: Sep 02, 2005
Posts: 445
I find it rather strange to create a new schema just to import an existing schema. ...


You are not creating new schema here. Just you are refering to the already existing schema.. Thats how it is defined in WSDL spec as a syntax for importing other reusable schemas.. I dont feel odd in this.. How do you think this should be designed??


Rizwan
SCJA, SCJP, SCWCD, SCBCD, SCDJWS.
Jim Janssens
Ranch Hand

Joined: Sep 24, 2004
Posts: 210
Originally posted by Rizwan Mohammad:


You are not creating new schema here. Just you are refering to the already existing schema.. Thats how it is defined in WSDL spec as a syntax for importing other reusable schemas.. I dont feel odd in this.. How do you think this should be designed??


"<xsd:schema..." points out the beginning of a new schema, or not ? If you look at it is perhaps not that weird. But I feel that a separate WSDL function for importing schemas (like the import element for WSDL files) would perhaps be a better solution ?
Rizwan Mohammad
Ranch Hand

Joined: Sep 02, 2005
Posts: 445
I understand what you are saying.. But thats how they have defined.
How I read that syntax myself is...

"For this wsdl document I need to define all types that I use....
So start defining new elements with schema element...
Start the definition of Schema...
I have 10 types to definie in this document...
I see that already 7 types are defined in some other document...
Lets import that first...
Now add additional 3 types now...
End the definition of schmea."

Sorry if I didn't make sense to you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WSDL external schema import