First time here? Check out the site's "greatest hits" or read a post from the archives. Feel free to leave a comment or ask a question, and consider subscribing to the latest posts via RSS or e-mail. Thanks for visiting!
« "Gotchas" around Primary Interop Assembl... | Main | Schweet: Free .NET Hosting for Developer... »

So let me start my own little possee here and cry: Say No to inline schema definitions in WSDL! Import is your friend.... [Commonality]

I'm with Tomas on this one. Schemas should be written as standalone documents and then be imported into the WSDL document. Not only is this easier to manage for the developer writing the schema and WSDL, but it's also easier for those who have to grok the two. Besides, the service you're writing the WSDL for probably isn't the only thing that's going to need access to the types you define in the schemas. [Drew Marsh]

Totally...not only WSDL First! and <xs:import> but (maybe this is obvious) I'm getting in the habit of putting the Domain Object-y definitions that we use elsewhere and the SOAP-y GetDomainObjectResult/Response definitions into separate XSDs.  I preached this at TechEd last week and spoke briefly to Tomas about it although we didn't have enough time to really dig in.

 <wsdl:types>
    <xs:schema>
   <xs:import namespace="
http://banking.corillian.com/Account.xsd" schemaLocation="Account.xsd"/>
   <xs:import namespace="
http://banking.corillian.com/Banking/GetAccounts" schemaLocation="GetAccounts.xsd"/>
  </xs:schema>
 </wsdl:types>

In this small example, the Account.xsd schema contains all sorts of Account-specific definitions that we may pass around internally to our app (on Queues, to functions, as objects, without SOAP) and GetAccounts.xsd contains definitions for GetAccountsResult and GetAccountsResponse and other useful "container" definitions in a separate namespace.



Tuesday, June 10, 2003 5:39:32 PM (Pacific Standard Time, UTC-08:00)
wouldn't you be better of using wsdl:import ?, then you don't need a types section at all.
Tuesday, June 10, 2003 10:21:27 PM (Pacific Standard Time, UTC-08:00)
I used the schema import because I was _sure_ that I wanted to import/reuse schema...I've seen some talk about the wsdl:import vs. xsd:import deal...(http://lists.w3.org/Archives/Public/www-ws-desc/2002Oct/0115.html)
Tuesday, June 10, 2003 10:22:03 PM (Pacific Standard Time, UTC-08:00)
I have to agree with Simon - I also prefer wsdl:import here.
Wednesday, June 11, 2003 3:26:16 AM (Pacific Standard Time, UTC-08:00)
It's also worth mentioning that the WS-I Basic Profile says you should only use xsd:import to import schemas. The rational is to keep the schema stuff together in on place (ie all in the wsdl:types section) and the rest of the stuff (operations, etc) outside that.

Wednesday, June 11, 2003 8:47:59 AM (Pacific Standard Time, UTC-08:00)
I have to agree with Jorgen and disagree with Simon and Christian. After the "wsdl:types" section, WSDL's job is responsibilities there are done and if I'm importing schema, I'll use xsd:import. If I'm importing split-up WSDLs from elsewhere I'll use wsdl:import. IMHO.
Thursday, June 12, 2003 6:40:09 AM (Pacific Standard Time, UTC-08:00)
OK, guys - after reading a bit ... lessons learned. Thanks for this hint, Jorgen!
Comments are closed.

Contact

Sponsors

Hosting By

On this page...

Tags

Calendar

<January 2009>
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567

Archives

Google Ads