• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Question about WSDL import element

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all I was reading notes on WSDL topic given on xyzws.com it gives following description about use of wsdl:import element



WSDL import element can only be used to import other WSDL files. For example:


INCORRECT:
<definitions name="StockQuote"
targetNamespace="http://example.com/stockquote/definitions"
xmlns:xsd1="http://example.com/stockquote/schemas""
...
xmlns="http://schemas.xmlsoap.org/wsdl/">

<import namespace="http://example.com/stockquote/schemas"
location="http://example.com/stockquote/stockquote.xsd"/>

<message name="GetLastTradePriceInput">
<part name="body" element="xsd1:TradePriceRequest"/>
</message>
...
</definitions>

CORRECT:
<definitions name="StockQuote"
targetNamespace="http://example.com/stockquote/definitions">
<import namespace="http://example.com/stockquote/definitions"
location="http://example.com/stockquote/stockquote.wsdl"/>
<message name="GetLastTradePriceInput">
<part name="body" element="..."/>
</message>
...
</definitions>


Does this mean if I want to write separate file for schema definition and use this schema definition in WSDL then I need to write schema definition in another wsdl file and import this file .Why can't I directly import xsd file in WSDL.

Please help
Thanks in advance
Apratim
SCJP 1.5
SCEA Part I
Mission SCDJWS
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Apratim Khandalkar:
Does this mean if I want to write separate file for schema definition and use this schema definition in WSDL then I need to write schema definition in another wsdl file and import this file .Why can't I directly import xsd file in WSDL.



You can import an XML Schema inside the XML Schema that resides inside the WSDL types section.

See WSDL file imports

Also make sure you understand the difference between XML Schema import and include. Import allows you to reference elements in the other namespace. Include adds the elements to your targetNamespace.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic