Discussion:
SDO_DAS_Relational + SCA soap binding?
Tony
2007-05-09 14:36:03 UTC
Permalink
sorry for my ignorance,but I was wondering could I use
SDO_DAS_Relational to execute a query(just like example "contact"),
and use the result DataGraph or DataObject in it as the return of a
service, with webservice soap binding.

If so, should I define the DataObject by both the XML Schema and RDB
schema (just like contacts_schema.inc.php do in examples/SDO/
contacts). Is there any examples like this?

Thanks a lot


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "phpsoa" group.
To post to this group, send email to phpsoa-/***@public.gmane.org
To unsubscribe from this group, send email to phpsoa-unsubscribe-/***@public.gmane.org
For more options, visit this group at http://groups.google.co.uk/group/phpsoa?hl=en
-~----------~----~----~----~------~----~------~--~---
Graham Charters
2007-05-10 11:59:40 UTC
Permalink
Hi Tony,

This is something which has been on the SDO wish list for a long
time. It's on the SDO list because that's where the majority of the
work needs to be done. I had a go at prototyping this last night
thinking a small scenario might work, but hit a few snag. The issues
I encountered were as follows:

SDOs do not currently move well between data factories. In other
words, if I create an SDO using the Relational DAS and then try to
send it out over soap, that SDO must first be copied into an XML DAS
to be serialized as XML. To do this the namespace and type names must
match.

The Relational DAS always gives its SDOs the namespace
"app_namespace" (this is a const defined in Relational.php). This is
not a valid XML namespace, so I changed it to "urn:app_namespace" on
my local machine (I actually think the right thing to do would be to
make it configurable).

I wrote an XML schema to match the schema used by the relational DAS
(i.e. using the urn:app_namespace, and all primitives were strings).
This got me nearly all the way there, but then I hit the main snag
which I hadn't foreseen. The XML which was produced did not follow
that of the XML schema. It was basically using the default SDO
serialization, where all primitives are attributes (the schema defined
them as elements). This meant that on the client side the result came
back as empty (did not deserialize properly).

I think what is happening is the SDO's type still ties back to the
Relational DAS, rather than the XML, during serialization. The
equivalent XML type has some additional information which enables it
to be serialized according to the XML schema. Because the SDO type is
the relational one, this information is not available so the default
XML serialization rules are used.

Fixing these issues will enable the 'retrieve' scenario, but update is
a different matter. We could not use the existing Relational DAS to
do this because it implements a technique known as 'optimistic
concurrency' to handle updates. To do this, the SDO keeps a record of
the original data retrieved from the database, and the Relational DAS
then uses this information to determine whether the database has been
modified. It is unlikely that you would want to surface the change
summary on the soap service API as this would require the client to
understand and produce appropriate change summaries.

There are other ways of doing optimistic concurrency, which are
probably more appropriate (e.g. using a timestamp column or
calculating a hash of the data when retrieved and comparing it with a
hash during update). These could all be done by writing a new
Relational DAS. Of course, optimistic concurrency is not always
necessary and a simple Relational DAS which doesn't support it might
be sufficient.

I hope this info helps.

Graham.
Post by Tony
sorry for my ignorance,but I was wondering could I use
SDO_DAS_Relational to execute a query(just like example "contact"),
and use the result DataGraph or DataObject in it as the return of a
service, with webservice soap binding.
If so, should I define the DataObject by both the XML Schema and RDB
schema (just like contacts_schema.inc.php do in examples/SDO/
contacts). Is there any examples like this?
Thanks a lot
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "phpsoa" group.
To post to this group, send email to phpsoa-/***@public.gmane.org
To unsubscribe from this group, send email to phpsoa-unsubscribe-/***@public.gmane.org
For more options, visit this group at http://groups.google.co.uk/group/phpsoa?hl=en
-~----------~----~----~----~------~----~------~--~---
Tony
2007-05-11 17:28:29 UTC
Permalink
Thank you so much for your work, it help a lot .
I'll continue to try to handle this issue.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "phpsoa" group.
To post to this group, send email to phpsoa-/***@public.gmane.org
To unsubscribe from this group, send email to phpsoa-unsubscribe-/***@public.gmane.org
For more options, visit this group at http://groups.google.co.uk/group/phpsoa?hl=en
-~----------~----~----~----~------~----~------~--~---
simonslaws-gM/Ye1E23mwN+
2007-05-23 13:12:34 UTC
Permalink
Graham

I was just thinking about this part of your issue...

snip
Post by Graham Charters
I wrote an XML schema to match the schema used by the relational DAS
(i.e. using the urn:app_namespace, and all primitives were strings).
This got me nearly all the way there, but then I hit the main snag
which I hadn't foreseen. The XML which was produced did not follow
that of the XML schema. It was basically using the default SDO
serialization, where all primitives are attributes (the schema defined
them as elements). This meant that on the client side the result came
back as empty (did not deserialize properly).
How about writing your schema so that it matches the default
serialization of SDO?
Post by Graham Charters
I think what is happening is the SDO's type still ties back to the
Relational DAS, rather than the XML, during serialization. The
equivalent XML type has some additional information which enables it
to be serialized according to the XML schema. Because the SDO type is
the relational one, this information is not available so the default
XML serialization rules are used.
This tricky issue you raise here is what the technology specifc schema
is going to look like. In your situation what you did is hand generate
it. In fact what you did is introduce a transformation based on how
you though the output XML should look. There are many ways that XML
schema can be constructed to represent, in this case, relational
schema. To cater for this variability we would have to introduce some
sort of transformation step to ensure that the SDO model can be
converted to the required schema and ensure that that it is output in
that form. ALternatively we could instigate a default transformation
that determines how relational models will be represented in XML. I
guess the output you see now is the default rule.

Regards

Simon


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "phpsoa" group.
To post to this group, send email to phpsoa-/***@public.gmane.org
To unsubscribe from this group, send email to phpsoa-unsubscribe-/***@public.gmane.org
For more options, visit this group at http://groups.google.co.uk/group/phpsoa?hl=en
-~----------~----~----~----~------~----~------~--~---
Graham Charters
2007-05-25 09:22:34 UTC
Permalink
Hi Simon, thanks for your thoughts. My comment are below.
Post by Graham Charters
Graham
I was just thinking about this part of your issue...
snip> I wrote an XML schema to match the schema used by the relational DAS
Post by Graham Charters
(i.e. using the urn:app_namespace, and all primitives were strings).
This got me nearly all the way there, but then I hit the main snag
which I hadn't foreseen. The XML which was produced did not follow
that of the XML schema. It was basically using the default SDO
serialization, where all primitives are attributes (the schema defined
them as elements). This meant that on the client side the result came
back as empty (did not deserialize properly).
How about writing your schema so that it matches the default
serialization of SDO?
Doh! That would work. I got hung up on trying to match the existing
contacts schema so I didn't consider that.
Post by Graham Charters
Post by Graham Charters
I think what is happening is the SDO's type still ties back to the
Relational DAS, rather than the XML, during serialization. The
equivalent XML type has some additional information which enables it
to be serialized according to the XML schema. Because the SDO type is
the relational one, this information is not available so the default
XML serialization rules are used.
This tricky issue you raise here is what the technology specifc schema
is going to look like. In your situation what you did is hand generate
it. In fact what you did is introduce a transformation based on how
you though the output XML should look. There are many ways that XML
schema can be constructed to represent, in this case, relational
schema. To cater for this variability we would have to introduce some
sort of transformation step to ensure that the SDO model can be
converted to the required schema and ensure that that it is output in
that form. ALternatively we could instigate a default transformation
that determines how relational models will be represented in XML. I
guess the output you see now is the default rule.
I think there are probably three classes of transformation:

1. Default SDO serialization (primitives as attributes, complex types
as elements).
2. Serialization following an XML schema whose model is logically
equivalent to the SDO model (this is what I was trying to do with the
contact example (e.g. primitives as elements)).
3. Transformation where the SDO model (types an hierarchy) are not
preserved (e.g. remove properties, add properties, change types).

Class 1 we should, and do, get for free, although I've not tried this
without a schema (do the APIs support this?).
Class 2 is what I think should be enabled in SDO as it makes sense to
follow a schema during serialization if there is one.
Class 3 is where I think people need to write some code :-) .
Post by Graham Charters
Regards
Simon
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "phpsoa" group.
To post to this group, send email to phpsoa-/***@public.gmane.org
To unsubscribe from this group, send email to phpsoa-unsubscribe-/***@public.gmane.org
For more options, visit this group at http://groups.google.co.uk/group/phpsoa?hl=en
-~----------~----~----~----~------~----~------~--~---

Loading...