This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: WSDL external schema import
 
Similar Threads
Doubt in WSDL import element
Doubt about import statement in RMH
Question about importing XML Schema in WSDL
MZ notes - fault about import/types ?
JAX-WS xsd:import