wsrp message
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]
Subject: Re: [wsrp] User Profile Items - Samples
- From: Rich Thompson <richt2@us.ibm.com>
- To: wsrp <wsrp@lists.oasis-open.org>
- Date: Thu, 21 Jul 2005 16:58:27 -0400
Nate,
Thanks for producing these examples.
In looking at them, I think a couple of things are turned around:
1. the name attribute in the metadata
should match the element name in the runtime message as this carries the
semantic information about what the item is;
2. the type information in the metadata
is for the preparation of serializers/deserializers and should be carried
at runtime using the xsi:type attribute; and
3. rather than the isArray style of
RPC-encoded, I recommend a maxOccurs attribute like what schema uses and
perhaps even pushing this attribute down into the schema for the type.
Making these changes results in the
following message formats for the extensions case ... the only difference
for the customUserItems case is the name of the parent element.
Other changes I would propose (but did
not include here in order to limit the scope of the next part of the discussion)
would be broadening the metadata type so that it was not explicit to customUserProfileItems
(perhaps ExtensionItemDescription), including a ResourceList for multi-language
versions of the description and possibly a ModelTypes for carrying schema
information inline.
Rich
Nathan Lipke <nlipke@bea.com>
07/20/05 12:27 PM
|
To
| wsrp <wsrp@lists.oasis-open.org>
|
cc
|
|
Subject
| [wsrp] User Profile Items
- Samples |
|
On Friday's call I was asked to come up with samples
showing custom user
profile items using extensions and using a schema specified field.
Attached files:
* customUserProps.xsd - schema used for the samples
* customItems.xml - sample registration and getMarkup using a specified
location
* extensions.xml - sample registration and getMarkup using extensions
Thanks for reviewing them,
Nathan Lipke
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<urn:register xmlns:urn="urn:oasis:names:tc:wsrp:v1:types">
<!-- ... -->
<!-- Here location is not an xpath,
but rather a profile section name from Chapter 11 of spec The section is the item's parent. If location missing the default
is a direct descendant of the profile -->
<urn:customUserProfileData name="spouseName"
type="xs:string">
<urn:description xml:lang="en">The
user's spouse's name</urn:description>
<urn:location>name</urn:location>
</urn:customUserProfileData>
<urn:customUserProfileData name="hireDate"
type="xs:dateTime">
<urn:description xml:lang="en">The
user's date of hire</urn:description>
<urn:location>employerInfo</urn:location>
</urn:customUserProfileData>
<urn:customUserProfileData name="IM"
type="custom:im" isArray="true">
<urn:description xml:lang="en">The
user's IM handles</urn:description>
<urn:location>homeInfo/online</urn:location>
<urn:location>businessInfo/online</urn:location>
</urn:customUserProfileData>
<urn:customUserProfileData name="importantNumbers"
type="xs:int" isArray="true">
<urn:description xml:lang="en">Numbers
to remember</urn:description>
</urn:customUserProfileData>
<urn:customUserProfileData name="luckyNumbers"
type="xs:int" isArray="true">
<urn:description xml:lang="en">Play
lotto with these</urn:description>
</urn:customUserProfileData>
</urn:register>
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<urn:getMarkup xmlns:urn="urn:oasis:names:tc:wsrp:v1:types">
<!-- ... -->
<urn:profile xmlns:xs="http://www.w3.org/2001/XMLSchema">>
<urn:name> <urn:customItems>
<urn:customItem
name="spouseName"><xs:string>Susan</xs:string></urn:customItem>
</urn:customItems> </urn:name>
<urn:employerInfo> <urn:customItems>
<urn:customItem
name="hireDate"><xs:dateTime>2005-03-24T09:38:11-07:00</xs:dateTime></urn:customItem>
</urn:customItems> </urn:employerInfo>
<urn:homeInfo> <urn:online>
<urn:customItems>
<urn:customItem
name="IM">
<custom:im
xmlns:custom="..." service="Yahoo">yahoo_home_user</custom:im>
<custom:im
xmlns:custom="..." service="AIM">aim_home_user</custom:im>
</urn:customItem>
</urn:customItems> </urn:online>
</urn:homeInfo>
<urn:businessInfo> <urn:online>
<urn:customItems>
<urn:customItem
name="IM">
<custom:im
xmlns:custom="..." service="Yahoo">yahoo_business_user</custom:im>
<custom:im
xmlns:custom="..." service="AIM">aim_business_user</custom:im>
</urn:customItem>
</urn:customItems> </urn:online>
</urn:businessInfo>
<urn:customItems>
<urn:customItem
name="luckyNumbers">
<xs:int>7</xs:int>
<xs:int>11</xs:int>
<xs:int>13</xs:int>
</urn:customItem>
<urn:customItem
name="importantNumbers">
<xs:int>0</xs:int>
<xs:int>10</xs:int>
<xs:int>100</xs:int>
<xs:int>1000</xs:int>
</urn:customItem>
</urn:customItems>
</urn:profile>
<!-- ... -->
</urn:getMarkup>
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<urn:register xmlns:urn="urn:oasis:names:tc:wsrp:v1:types">
<!-- ... -->
<!-- Here the location is an XPath
to the item's node (not parent) This requires both the producer
and consumer to understand the full xpath spec. -->
<!-- Could query on attr/child value
if the schema provides a name. What if the schema does not
have such an attr? -->
<urn:customUserProfileData name="spouseName"
type="custom:nameHolder">
<urn:description xml:lang="en">The
user's spouse's name</urn:description>
<urn:location>name/extensions/stringHolder[@name='spouseName']</urn:location>
</urn:customUserProfileData>
<urn:customUserProfileData name="hireDate"
type="custom:dateHolder">
<urn:description xml:lang="en">The
user's date of hire</urn:description>
<urn:location>employerInfo/extensions/dateHolder[0]</urn:location>
</urn:customUserProfileData>
<urn:customUserProfileData name="IM"
type="custom:im" isArray="true">
<urn:description xml:lang="en">The
user's IM handles</urn:description>
<urn:location>homeInfo/online/extensions/im[0]</urn:location>
<urn:location>businessInfo/online/extensions/im[0]</urn:location>
</urn:customUserProfileData>
<!-- The consumer must ensure order. What to do if an item is not
present? This will mess up the order. -->
<urn:customUserProfileData name="importantNumbers"
type="custom:intArray" isArray="true">
<urn:description xml:lang="en">Numbers
to remember</urn:description>
<urn:location>extensions/intArray[1]</urn:location>
</urn:customUserProfileData>
<urn:customUserProfileData name="luckyNumbers"
type="cutom:intArray" isArray="true">
<urn:description xml:lang="en">Play
lotto with these</urn:description>
<urn:location>extensions/intArray[0]</urn:location>
</urn:customUserProfileData>
<!-- What if xpath matches multiple elements?
-->
<urn:customUserProfileData name="trouble"
type="cutom:intArray" isArray="true">
<urn:description xml:lang="en">Xpath
matches too much</urn:description>
<urn:location>extensions/*</urn:location>
</urn:customUserProfileData>
</urn:register>
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<urn:getMarkup xmlns:urn="urn:oasis:names:tc:wsrp:v1:types">
<!-- ... -->
<urn:profile xmlns:xs="http://www.w3.org/2001/XMLSchema">>
<urn:name> <urn:extensions>
<custom:stringHolder
name="spouseName"><xs:string>Susan</xs:string></custom:stringHolder>
</urn:extensions> </urn:name>
<urn:employerInfo> <urn:extensions>
<custom:dateHolder
name="hireDate"><xs:dateTime>2005-03-24T09:38:11-07:00</xs:dateTime></custom:dateHolder>
</urn:extensions> </urn:employerInfo>
<urn:homeInfo> <urn:online>
<urn:extensions>
<custom:im name="IM">
<custom:im
xmlns:custom="..." service="Yahoo">yahoo_home_user</custom:im>
<custom:im
xmlns:custom="..." service="AIM">aim_home_user</custom:im>
</custom:im>
</urn:extensions> </urn:online>
</urn:homeInfo>
<urn:businessInfo> <urn:online>
<urn:extensions>
<custom:im name="IM">
<custom:im
xmlns:custom="..." service="Yahoo">yahoo_business_user</custom:im>
<custom:im
xmlns:custom="..." service="AIM">aim_business_user</custom:im>
</custom:im>
</urn:extensions> </urn:online>
</urn:businessInfo>
<urn:extensions>
<custom:intArray>
<xs:int>7</xs:int>
<xs:int>11</xs:int>
<xs:int>13</xs:int>
</custom:intArray>
<custom:intArray>
<xs:int>0</xs:int>
<xs:int>10</xs:int>
<xs:int>100</xs:int>
<xs:int>1000</xs:int>
</custom:intArray>
</urn:extensions>
</urn:profile>
<!-- ... -->
</urn:getMarkup>
</soapenv:Body>
</soapenv:Envelope>
---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that
generates this mail. You may a link to this group and all your TCs
in OASIS
at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<urn:getMarkup xmlns:urn="urn:oasis:names:tc:wsrp:v1:types">
<!-- ... -->
<urn:profile xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:custom="...">
<urn:name> <urn:extensions>
<spouseName xsi:type="xs:string">Susan</spouseName>
</urn:extensions> </urn:name>
<urn:employerInfo> <urn:extensions>
<hireDate xsi:type="xs:dateTime">2005-03-24T09:38:11-07:00</hireDate>
</urn:extensions> </urn:employerInfo>
<urn:homeInfo> <urn:online> <urn:extensions>
<custom:im_holder xsi:type="custom:IM">
<custom:service>Yahoo</custom:service>
<custom:imID>yahoo_home_user</custom:imID>
</custom:im_holder>
<custom:im_holder xsi:type="custom:IM">
<custom:service>AIM</custom:service>
<custom:imID>aim_home_user</custom:imID>
</custom:im_holder>
</urn:extensions> </urn:online> </urn:homeInfo>
<urn:businessInfo> <urn:online> <urn:extensions>
<custom:im_holder xsi:type="custom:IM">
<custom:service>Yahoo</custom:service>
<custom:imID>yahoo_business_user</custom:imID>
</custom:im_holder>
<custom:im_holder xsi:type="custom:IM">
<custom:service>AIM</custom:service>
<custom:imID>aim_business_user</custom:imID>
</custom:im_holder>
</urn:extensions> </urn:online> </urn:businessInfo>
<urn:extensions>
<luckyNumber type="xs:int">7 </luckyNumber>
<luckyNumber type="xs:int">11</luckyNumber>
<luckyNumber type="xs:int">13</luckyNumber>
<importantNumber type="xs:int"> 0 </importantNumber>
<importantNumber type="xs:int"> 10 </importantNumber>
<importantNumber type="xs:int"> 100 </importantNumber>
<importantNumber type="xs:int"> 1000 </importantNumber>
</urn:extensions>
</urn:profile>
<!-- ... -->
</urn:getMarkup>
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<urn:register xmlns:urn="urn:oasis:names:tc:wsrp:v1:types">
<!-- ... -->
<!--
Here the location is an XPath to the item's node (not parent)
This requires both the producer and consumer to understand the
full xpath spec.
-->
<!--
Could query on attr/child value if the schema provides a name.
What if the schema does not have such an attr?
-->
<urn:customUserProfileData name="spouseName" type="xs:string">
<urn:description xml:lang="en">The user's spouse's name</urn:description>
<urn:location>name</urn:location>
</urn:customUserProfileData>
<urn:customUserProfileData name="hireDate" type="xs:dateTime">
<urn:description xml:lang="en">The user's date of hire</urn:description>
<urn:location>employerInfo</urn:location>
</urn:customUserProfileData>
<urn:customUserProfileData name="im_holder" type="custom:IM" maxOccurs="unbounded">
<urn:description xml:lang="en">The user's IM handles</urn:description>
<urn:location>homeInfo/online</urn:location>
<urn:location>businessInfo/online</urn:location>
</urn:customUserProfileData>
<urn:customUserProfileData name="importantNumbers" type="xs:int" maxOccurs="unbounded">
<urn:description xml:lang="en">Numbers to remember</urn:description>
<urn:location>extensions</urn:location>
</urn:customUserProfileData>
<urn:customUserProfileData name="luckyNumbers" type="xs:int" maxOccurs="unbounded">
<urn:description xml:lang="en">Play lotto with these</urn:description>
<urn:location>extensions</urn:location>
</urn:customUserProfileData>
<!-- What if xpath matches multiple elements? -->
<!-- Not XPaths! Location should name parent element(s)
<urn:customUserProfileData name="trouble" type="cutom:intArray" isArray="true">
<urn:description xml:lang="en">Xpath matches too much</urn:description>
<urn:location>extensions/*</urn:location>
</urn:customUserProfileData>
-->
</urn:register>
</soapenv:Body>
</soapenv:Envelope>
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]