You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Jean-Sebastien Delfino <js...@apache.org> on 2006/12/11 22:43:31 UTC

[C++] SDOXMLWriter not writing ns prefixes correctly

With the SDO head (r485883) the XML response from the AccountDataService 
in the HttpdBigBank scenario is incorrect (and breaks the scenario):

<getStockAccountResponse xmlns="http://tempuri.org" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:tns="http://tempuri.org" 
xmlns:tns2="http://www.bigbank.com/AccountService"><tns2:return 
xsi:type="StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></tns2:return></getStockAccountResponse>

- xsi:type="StockAccount" is missing the tns2 namespace prefix.
- return is not from the tns2 namespace and should not be prefixed by tns2.


Going back to an older revision of SDOXMLWriter.cpp (r480964) I am 
getting the correct XML:

<getStockAccountResponse xmlns="http://tempuri.org" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:tns="http://tempuri.org" 
xmlns:tns2="http://www.bigbank.com/AccountService"><return 
xsi:type="tns2:StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></return></getStockAccountResponse>

I have stepped through the SDO runtime code and I'm not sure yet why 
this is happening, but this is caused by some of the recent changes to 
SDOXMLWriter.cpp. Any idea?

-- 
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [C++] SDOXMLWriter not writing ns prefixes correctly

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Pete Robbins wrote:
> On 13/12/06, Pete Robbins <ro...@googlemail.com> wrote:
>>
>>
>>
>> On 13/12/06, Pete Robbins <ro...@googlemail.com> wrote:
>> >
>> >
>> >
>> >  On 13/12/06, Jean-Sebastien Delfino < jsdelfino@apache.org> wrote:
>> > >
>> > > Pete Robbins wrote:
>> > > > On 13/12/06, Pete Robbins < robbinspg@googlemail.com > wrote:
>> > > >
>> > > >> OK... I've checked in a change for this. The result is that
>> > > xsi:type is
>> > > >> written correctly. Unfortunately the element prefix is not always
>> > > >> written
>> > > >> correctly. The problem is that we do not record the namespace uri
>> > > of a
>> > > >> property so when we come to write the graph to xml we are, at the
>> > > >> moment,
>> > > >> assuming that the property element namespace uri is the same 
>> as the
>> > >
>> > > >> uri of
>> > > >> the property type. This is not always the case as in Sebastien's
>> > > example
>> > > >> above.
>> > > >>
>> > > >> I think what is there now will work for Caroline and also for
>> > > Sebastien
>> > > >> (though the xml is actually incorrect).
>> > > >>
>> > > >> A perfect fix will need more thought and changes in schema 
>> parsing,
>> > >
>> > > >> document loading and document writing. It is possible to have an
>> > > >> improved
>> > > >> fix without too much rework where we only write out the element
>> > > >> prefix after
>> > > >> validating that a global element of the property name was defined
>> > > >> (Property
>> > > >> on the "RootType" of the namespace) exists. So for the 
>> examples in
>> > > this
>> > > >> thread:
>> > > >>
>> > > >>
>> > > >>    - return would be written as <return .. > because there is no
>> > > >>    property named "return" on the Type
>> > > >> http://www.bigbank.com/AccountService#RootType .
>> > > >>
>> > > >>    - address would be written as <tns2:address ... > because
>> > > "address"
>> > > >>    is a property (of the correct Type) on
>> > > >>
>> > > >> 
>> http://schemas.xmlsoap.org/wsdl/soap/<http://schemas.xmlsoap.org/wsdl/soap/#RootType>< 
>>
>> > > http://schemas.xmlsoap.org/wsdl/soap/>
>> > > >>
>> > > >>    #RootType
>> > > >>
>> > > >>
>> > > >> I'll look at this again tomorrow.
>> > > >>
>> > > >> Cheers,
>> > > >>
>> > > >>
>> > > >
>> > > >
>> > > >
>> > > > I've checked in another update which should write the element 
>> prefix
>> > > > correctly. I think there are still cases where we should write
>> > > > prefixes on
>> > > > attributes as well.
>> > > >
>> > > > I also fixed the fact that Sequence elements were written as the
>> > > property
>> > > > name and not the element name. There is a similar problem when
>> > > writing
>> > > > references which I'll fix in the next update.
>> > > >
>> > > > Cheers,
>> > > >
>> > > >
>> > > >
>> > > >>
>> > > >> On 12/12/06, Pete Robbins < robbinspg@googlemail.com > wrote:
>> > > >> >
>> > > >> >
>> > > >> >
>> > > >> >  On 12/12/06, Jean-Sebastien Delfino < jsdelfino@apache.org>
>> > > wrote:
>> > > >> > >
>> > > >> > > Pete Robbins wrote:
>> > > >> > > > On 11/12/06, Jean-Sebastien Delfino < jsdelfino@apache.org>
>> > > wrote:
>> > > >> > > >>
>> > > >> > > >> With the SDO head (r485883) the XML response from the
>> > > >> > > AccountDataService
>> > > >> > > >> in the HttpdBigBank scenario is incorrect (and breaks the
>> > > >> > > scenario):
>> > > >> > > >>
>> > > >> > > >> <getStockAccountResponse xmlns=" http://tempuri.org"
>> > > >> > > >> xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance "
>> > > >> > > >> xmlns:tns=" http://tempuri.org"
>> > > >> > > >> xmlns:tns2=" 
>> http://www.bigbank.com/AccountService"><tns2:return
>> > >
>> > > >> > > >>
>> > > >> > > >>
>> > > >> > >
>> > > >>
>> > > 
>> xsi:type="StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></tns2:return></getStockAccountResponse> 
>>
>> > >
>> > > >>
>> > > >> > >
>> > > >> > > >>
>> > > >> > > >>
>> > > >> > > >> - xsi:type="StockAccount" is missing the tns2 namespace
>> > > prefix.
>> > > >> > > >> - return is not from the tns2 namespace and should not be
>> > > >> prefixed
>> > > >> > > by
>> > > >> > > >> tns2.
>> > > >> > > >>
>> > > >> > > >>
>> > > >> > > >> Going back to an older revision of 
>> SDOXMLWriter.cpp(r480964)
>> > > >> I am
>> > > >> > > >> getting the correct XML:
>> > > >> > > >>
>> > > >> > > >> <getStockAccountResponse xmlns=" http://tempuri.org "
>> > > >> > > >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "
>> > > >> > > >> xmlns:tns=" http://tempuri.org "
>> > > >> > > >> xmlns:tns2=" 
>> http://www.bigbank.com/AccountService"><return
>> > > >> > > >>
>> > > >> > > >>
>> > > >> > >
>> > > >>
>> > > 
>> xsi:type="tns2:StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></return></getStockAccountResponse> 
>>
>> > >
>> > > >>
>> > > >> > >
>> > > >> > > >>
>> > > >> > > >>
>> > > >> > > >> I have stepped through the SDO runtime code and I'm not 
>> sure
>> > > yet
>> > > >> > > why
>> > > >> > > >> this is happening, but this is caused by some of the 
>> recent
>> > > >> changes
>> > > >> > > to
>> > > >> > > >> SDOXMLWriter.cpp. Any idea?
>> > > >> > > >>
>> > > >> > > >> --
>> > > >> > > >> Jean-Sebastien
>> > > >> > > >
>> > > >> > > >
>> > > >> > > > What namespace is the element <return> supposed to be 
>> in? In
>> > > the
>> > > >> > > first
>> > > >> > > > it is
>> > > >> > > > in "tns2" and in the second the default namespace
>> > > >> http://tempuri.org
>> > > >> > > .
>> > > >> > > > What
>> > > >> > > > Types/Properties are defined in the DataFactory?
>> > > >> > > >
>> > > >> > > > I'll take a look at this. There have been a number of 
>> "fixes"
>> > > in
>> > > >> > > this
>> > > >> > > > area
>> > > >> > > > and each change breaks something else!
>> > > >> > > >
>> > > >> > > > Cheers,
>> > > >> > > >
>> > > >> > > Pete,
>> > > >> > >
>> > > >> > > In my example, checkingAccountResponse is open content so the
>> > > >> <return>
>> > > >> > > element is not defined by a schema, but the instance of
>> > > StockAccount
>> > > >> > > is
>> > > >> > > from tns2.
>> > > >> > >
>> > > >> > > --
>> > > >> > > Jean-Sebastien
>> > > >> >
>> > > >> >
>> > > >> >
>> > > >> > OK. I know how to fix this. Sebastien, you put some code in to
>> > > >> check for
>> > > >> > an open content property and not write the element uri. This
>> > > caused a
>> > > >> > failure that Caroline saw so we backed out that change.
>> > > >> >
>> > > >> > The problem is actually that your check at the top of the 
>> writeDO
>> > >
>> > > >> method
>> > > >> > was using the *element* name and not the *property* name. The
>> > > name of
>> > > >> > the element to be written is passed into writeDO, not the 
>> name of
>> > > the
>> > > >> > property that is being processed. These are often the same, but
>> > > are
>> > > >> not the
>> > > >> > same in cases where substitutions, aliases or sdo:name
>> > > annotations
>> > > >> are used.
>> > > >> >
>> > > >> >
>> > > >> > I'm on the case and hope to have a fix in the next couple of
>> > > hours.
>> > > >> >
>> > > >> > Cheers,
>> > > >> >
>> > > >> > --
>> > > >> > Pete
>> > > >> >
>> > > >>
>> > > >>
>> > > >>
>> > > >> --
>> > > >> Pete
>> > > >
>> > > >
>> > > >
>> > > >
>> > >
>> > > Pete,
>> > >
>> > > I'm afraid that a number of scenarios are broken with the latest SDO
>> > > changes (I just tried the SDO head r486738):
>> > > - PythonWeatherForecast
>> > > - HttpdBigBank
>> > > - RestCalculator
>> > > - RestCustomer
>> > >
>> > > Going back to r480964 of SDOXMLWriter.cpp they all work.
>> >
>> >
>> >
>>
>> PythonWeatherForecast works fine for me. It was failing and I checked 
>> out
>> about 10 different SDO versions going back to r480964 .. and they all 
>> failed
>> the same way. Reverted to head and all is fine! Not sure if the 
>> webservice
>> itself was returning bad data.
>>
>>
>
> The webservice called by the PythonWeatherForecast sample sometimes 
> returns
> a null <weatherData> element. The sample was failing in the Python 
> code when
> retrieving null values. It depends on what time of day you run the 
> sample.
> They always return 7 days in the array but sometims they haven't got data
> for the 7th day!!
>
> Anyho... I fixed the sample code to cope with this.
>

Wow, good catch!

I was starting to get really confused here, as I had tested with all 
kinds of combinations, SDO levels, Axis2C levels, rebuilding everything 
each time, and I was sure it was breaking before and this morning was 
not able to reproduce the problem again... That explains it. Thanks!!

P.S: I added a samples/runtest.sh script to help run and verify all the 
samples in one go. Hope this helps.

-- 
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [C++] SDOXMLWriter not writing ns prefixes correctly

Posted by Pete Robbins <ro...@googlemail.com>.
On 13/12/06, Pete Robbins <ro...@googlemail.com> wrote:
>
>
>
> On 13/12/06, Pete Robbins <ro...@googlemail.com> wrote:
> >
> >
> >
> >  On 13/12/06, Jean-Sebastien Delfino < jsdelfino@apache.org> wrote:
> > >
> > > Pete Robbins wrote:
> > > > On 13/12/06, Pete Robbins < robbinspg@googlemail.com > wrote:
> > > >
> > > >> OK... I've checked in a change for this. The result is that
> > > xsi:type is
> > > >> written correctly. Unfortunately the element prefix is not always
> > > >> written
> > > >> correctly. The problem is that we do not record the namespace uri
> > > of a
> > > >> property so when we come to write the graph to xml we are, at the
> > > >> moment,
> > > >> assuming that the property element namespace uri is the same as the
> > >
> > > >> uri of
> > > >> the property type. This is not always the case as in Sebastien's
> > > example
> > > >> above.
> > > >>
> > > >> I think what is there now will work for Caroline and also for
> > > Sebastien
> > > >> (though the xml is actually incorrect).
> > > >>
> > > >> A perfect fix will need more thought and changes in schema parsing,
> > >
> > > >> document loading and document writing. It is possible to have an
> > > >> improved
> > > >> fix without too much rework where we only write out the element
> > > >> prefix after
> > > >> validating that a global element of the property name was defined
> > > >> (Property
> > > >> on the "RootType" of the namespace) exists. So for the examples in
> > > this
> > > >> thread:
> > > >>
> > > >>
> > > >>    - return would be written as <return .. > because there is no
> > > >>    property named "return" on the Type
> > > >> http://www.bigbank.com/AccountService#RootType .
> > > >>
> > > >>    - address would be written as <tns2:address ... > because
> > > "address"
> > > >>    is a property (of the correct Type) on
> > > >>
> > > >> http://schemas.xmlsoap.org/wsdl/soap/<http://schemas.xmlsoap.org/wsdl/soap/#RootType><
> > > http://schemas.xmlsoap.org/wsdl/soap/>
> > > >>
> > > >>    #RootType
> > > >>
> > > >>
> > > >> I'll look at this again tomorrow.
> > > >>
> > > >> Cheers,
> > > >>
> > > >>
> > > >
> > > >
> > > >
> > > > I've checked in another update which should write the element prefix
> > > > correctly. I think there are still cases where we should write
> > > > prefixes on
> > > > attributes as well.
> > > >
> > > > I also fixed the fact that Sequence elements were written as the
> > > property
> > > > name and not the element name. There is a similar problem when
> > > writing
> > > > references which I'll fix in the next update.
> > > >
> > > > Cheers,
> > > >
> > > >
> > > >
> > > >>
> > > >> On 12/12/06, Pete Robbins < robbinspg@googlemail.com > wrote:
> > > >> >
> > > >> >
> > > >> >
> > > >> >  On 12/12/06, Jean-Sebastien Delfino < jsdelfino@apache.org>
> > > wrote:
> > > >> > >
> > > >> > > Pete Robbins wrote:
> > > >> > > > On 11/12/06, Jean-Sebastien Delfino < jsdelfino@apache.org>
> > > wrote:
> > > >> > > >>
> > > >> > > >> With the SDO head (r485883) the XML response from the
> > > >> > > AccountDataService
> > > >> > > >> in the HttpdBigBank scenario is incorrect (and breaks the
> > > >> > > scenario):
> > > >> > > >>
> > > >> > > >> <getStockAccountResponse xmlns=" http://tempuri.org"
> > > >> > > >> xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance "
> > > >> > > >> xmlns:tns=" http://tempuri.org"
> > > >> > > >> xmlns:tns2=" http://www.bigbank.com/AccountService"><tns2:return
> > >
> > > >> > > >>
> > > >> > > >>
> > > >> > >
> > > >>
> > > xsi:type="StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></tns2:return></getStockAccountResponse>
> > >
> > > >>
> > > >> > >
> > > >> > > >>
> > > >> > > >>
> > > >> > > >> - xsi:type="StockAccount" is missing the tns2 namespace
> > > prefix.
> > > >> > > >> - return is not from the tns2 namespace and should not be
> > > >> prefixed
> > > >> > > by
> > > >> > > >> tns2.
> > > >> > > >>
> > > >> > > >>
> > > >> > > >> Going back to an older revision of SDOXMLWriter.cpp(r480964)
> > > >> I am
> > > >> > > >> getting the correct XML:
> > > >> > > >>
> > > >> > > >> <getStockAccountResponse xmlns=" http://tempuri.org "
> > > >> > > >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "
> > > >> > > >> xmlns:tns=" http://tempuri.org "
> > > >> > > >> xmlns:tns2=" http://www.bigbank.com/AccountService"><return
> > > >> > > >>
> > > >> > > >>
> > > >> > >
> > > >>
> > > xsi:type="tns2:StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></return></getStockAccountResponse>
> > >
> > > >>
> > > >> > >
> > > >> > > >>
> > > >> > > >>
> > > >> > > >> I have stepped through the SDO runtime code and I'm not sure
> > > yet
> > > >> > > why
> > > >> > > >> this is happening, but this is caused by some of the recent
> > > >> changes
> > > >> > > to
> > > >> > > >> SDOXMLWriter.cpp. Any idea?
> > > >> > > >>
> > > >> > > >> --
> > > >> > > >> Jean-Sebastien
> > > >> > > >
> > > >> > > >
> > > >> > > > What namespace is the element <return> supposed to be in? In
> > > the
> > > >> > > first
> > > >> > > > it is
> > > >> > > > in "tns2" and in the second the default namespace
> > > >> http://tempuri.org
> > > >> > > .
> > > >> > > > What
> > > >> > > > Types/Properties are defined in the DataFactory?
> > > >> > > >
> > > >> > > > I'll take a look at this. There have been a number of "fixes"
> > > in
> > > >> > > this
> > > >> > > > area
> > > >> > > > and each change breaks something else!
> > > >> > > >
> > > >> > > > Cheers,
> > > >> > > >
> > > >> > > Pete,
> > > >> > >
> > > >> > > In my example, checkingAccountResponse is open content so the
> > > >> <return>
> > > >> > > element is not defined by a schema, but the instance of
> > > StockAccount
> > > >> > > is
> > > >> > > from tns2.
> > > >> > >
> > > >> > > --
> > > >> > > Jean-Sebastien
> > > >> >
> > > >> >
> > > >> >
> > > >> > OK. I know how to fix this. Sebastien, you put some code in to
> > > >> check for
> > > >> > an open content property and not write the element uri. This
> > > caused a
> > > >> > failure that Caroline saw so we backed out that change.
> > > >> >
> > > >> > The problem is actually that your check at the top of the writeDO
> > >
> > > >> method
> > > >> > was using the *element* name and not the *property* name. The
> > > name of
> > > >> > the element to be written is passed into writeDO, not the name of
> > > the
> > > >> > property that is being processed. These are often the same, but
> > > are
> > > >> not the
> > > >> > same in cases where substitutions, aliases or sdo:name
> > > annotations
> > > >> are used.
> > > >> >
> > > >> >
> > > >> > I'm on the case and hope to have a fix in the next couple of
> > > hours.
> > > >> >
> > > >> > Cheers,
> > > >> >
> > > >> > --
> > > >> > Pete
> > > >> >
> > > >>
> > > >>
> > > >>
> > > >> --
> > > >> Pete
> > > >
> > > >
> > > >
> > > >
> > >
> > > Pete,
> > >
> > > I'm afraid that a number of scenarios are broken with the latest SDO
> > > changes (I just tried the SDO head r486738):
> > > - PythonWeatherForecast
> > > - HttpdBigBank
> > > - RestCalculator
> > > - RestCustomer
> > >
> > > Going back to r480964 of SDOXMLWriter.cpp they all work.
> >
> >
> >
>
> PythonWeatherForecast works fine for me. It was failing and I checked out
> about 10 different SDO versions going back to r480964 .. and they all failed
> the same way. Reverted to head and all is fine! Not sure if the webservice
> itself was returning bad data.
>
>

The webservice called by the PythonWeatherForecast sample sometimes returns
a null <weatherData> element. The sample was failing in the Python code when
retrieving null values. It depends on what time of day you run the sample.
They always return 7 days in the array but sometims they haven't got data
for the 7th day!!

Anyho... I fixed the sample code to cope with this.

-- 
Pete

Re: [C++] SDOXMLWriter not writing ns prefixes correctly

Posted by Pete Robbins <ro...@googlemail.com>.
On 13/12/06, Pete Robbins <ro...@googlemail.com> wrote:
>
>
>
>  On 13/12/06, Jean-Sebastien Delfino <js...@apache.org> wrote:
> >
> > Pete Robbins wrote:
> > > On 13/12/06, Pete Robbins <robbinspg@googlemail.com > wrote:
> > >
> > >> OK... I've checked in a change for this. The result is that xsi:type
> > is
> > >> written correctly. Unfortunately the element prefix is not always
> > >> written
> > >> correctly. The problem is that we do not record the namespace uri of
> > a
> > >> property so when we come to write the graph to xml we are, at the
> > >> moment,
> > >> assuming that the property element namespace uri is the same as the
> > >> uri of
> > >> the property type. This is not always the case as in Sebastien's
> > example
> > >> above.
> > >>
> > >> I think what is there now will work for Caroline and also for
> > Sebastien
> > >> (though the xml is actually incorrect).
> > >>
> > >> A perfect fix will need more thought and changes in schema parsing,
> > >> document loading and document writing. It is possible to have an
> > >> improved
> > >> fix without too much rework where we only write out the element
> > >> prefix after
> > >> validating that a global element of the property name was defined
> > >> (Property
> > >> on the "RootType" of the namespace) exists. So for the examples in
> > this
> > >> thread:
> > >>
> > >>
> > >>    - return would be written as <return .. > because there is no
> > >>    property named "return" on the Type
> > >> http://www.bigbank.com/AccountService#RootType.
> > >>
> > >>    - address would be written as <tns2:address ... > because
> > "address"
> > >>    is a property (of the correct Type) on
> > >>
> > >> http://schemas.xmlsoap.org/wsdl/soap/<http://schemas.xmlsoap.org/wsdl/soap/#RootType
> > ><http://schemas.xmlsoap.org/wsdl/soap/>
> > >>
> > >>    #RootType
> > >>
> > >>
> > >> I'll look at this again tomorrow.
> > >>
> > >> Cheers,
> > >>
> > >>
> > >
> > >
> > >
> > > I've checked in another update which should write the element prefix
> > > correctly. I think there are still cases where we should write
> > > prefixes on
> > > attributes as well.
> > >
> > > I also fixed the fact that Sequence elements were written as the
> > property
> > > name and not the element name. There is a similar problem when writing
> > > references which I'll fix in the next update.
> > >
> > > Cheers,
> > >
> > >
> > >
> > >>
> > >> On 12/12/06, Pete Robbins <robbinspg@googlemail.com > wrote:
> > >> >
> > >> >
> > >> >
> > >> >  On 12/12/06, Jean-Sebastien Delfino < jsdelfino@apache.org> wrote:
> > >> > >
> > >> > > Pete Robbins wrote:
> > >> > > > On 11/12/06, Jean-Sebastien Delfino < jsdelfino@apache.org>
> > wrote:
> > >> > > >>
> > >> > > >> With the SDO head (r485883) the XML response from the
> > >> > > AccountDataService
> > >> > > >> in the HttpdBigBank scenario is incorrect (and breaks the
> > >> > > scenario):
> > >> > > >>
> > >> > > >> <getStockAccountResponse xmlns=" http://tempuri.org"
> > >> > > >> xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance "
> > >> > > >> xmlns:tns=" http://tempuri.org"
> > >> > > >> xmlns:tns2=" http://www.bigbank.com/AccountService"><tns2:return
> >
> > >> > > >>
> > >> > > >>
> > >> > >
> > >>
> > xsi:type="StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></tns2:return></getStockAccountResponse>
> >
> > >>
> > >> > >
> > >> > > >>
> > >> > > >>
> > >> > > >> - xsi:type="StockAccount" is missing the tns2 namespace
> > prefix.
> > >> > > >> - return is not from the tns2 namespace and should not be
> > >> prefixed
> > >> > > by
> > >> > > >> tns2.
> > >> > > >>
> > >> > > >>
> > >> > > >> Going back to an older revision of SDOXMLWriter.cpp (r480964)
> > >> I am
> > >> > > >> getting the correct XML:
> > >> > > >>
> > >> > > >> <getStockAccountResponse xmlns=" http://tempuri.org "
> > >> > > >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "
> > >> > > >> xmlns:tns=" http://tempuri.org "
> > >> > > >> xmlns:tns2=" http://www.bigbank.com/AccountService"><return
> > >> > > >>
> > >> > > >>
> > >> > >
> > >>
> > xsi:type="tns2:StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></return></getStockAccountResponse>
> >
> > >>
> > >> > >
> > >> > > >>
> > >> > > >>
> > >> > > >> I have stepped through the SDO runtime code and I'm not sure
> > yet
> > >> > > why
> > >> > > >> this is happening, but this is caused by some of the recent
> > >> changes
> > >> > > to
> > >> > > >> SDOXMLWriter.cpp. Any idea?
> > >> > > >>
> > >> > > >> --
> > >> > > >> Jean-Sebastien
> > >> > > >
> > >> > > >
> > >> > > > What namespace is the element <return> supposed to be in? In
> > the
> > >> > > first
> > >> > > > it is
> > >> > > > in "tns2" and in the second the default namespace
> > >> http://tempuri.org
> > >> > > .
> > >> > > > What
> > >> > > > Types/Properties are defined in the DataFactory?
> > >> > > >
> > >> > > > I'll take a look at this. There have been a number of "fixes"
> > in
> > >> > > this
> > >> > > > area
> > >> > > > and each change breaks something else!
> > >> > > >
> > >> > > > Cheers,
> > >> > > >
> > >> > > Pete,
> > >> > >
> > >> > > In my example, checkingAccountResponse is open content so the
> > >> <return>
> > >> > > element is not defined by a schema, but the instance of
> > StockAccount
> > >> > > is
> > >> > > from tns2.
> > >> > >
> > >> > > --
> > >> > > Jean-Sebastien
> > >> >
> > >> >
> > >> >
> > >> > OK. I know how to fix this. Sebastien, you put some code in to
> > >> check for
> > >> > an open content property and not write the element uri. This caused
> > a
> > >> > failure that Caroline saw so we backed out that change.
> > >> >
> > >> > The problem is actually that your check at the top of the writeDO
> > >> method
> > >> > was using the *element* name and not the *property* name. The name
> > of
> > >> > the element to be written is passed into writeDO, not the name of
> > the
> > >> > property that is being processed. These are often the same, but are
> >
> > >> not the
> > >> > same in cases where substitutions, aliases or sdo:name annotations
> > >> are used.
> > >> >
> > >> >
> > >> > I'm on the case and hope to have a fix in the next couple of hours.
> >
> > >> >
> > >> > Cheers,
> > >> >
> > >> > --
> > >> > Pete
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> Pete
> > >
> > >
> > >
> > >
> >
> > Pete,
> >
> > I'm afraid that a number of scenarios are broken with the latest SDO
> > changes (I just tried the SDO head r486738):
> > - PythonWeatherForecast
> > - HttpdBigBank
> > - RestCalculator
> > - RestCustomer
> >
> > Going back to r480964 of SDOXMLWriter.cpp they all work.
>
>
>

PythonWeatherForecast works fine for me. It was failing and I checked out
about 10 different SDO versions going back to r480964 .. and they all failed
the same way. Reverted to head and all is fine! Not sure if the webservice
itself was returning bad data.

I'll try the Rest samples next

Re: [C++] SDOXMLWriter not writing ns prefixes correctly

Posted by Pete Robbins <ro...@googlemail.com>.
On 13/12/06, Jean-Sebastien Delfino <js...@apache.org> wrote:
>
> Pete Robbins wrote:
> > On 13/12/06, Pete Robbins <ro...@googlemail.com> wrote:
> >
> >> OK... I've checked in a change for this. The result is that xsi:type is
> >> written correctly. Unfortunately the element prefix is not always
> >> written
> >> correctly. The problem is that we do not record the namespace uri of a
> >> property so when we come to write the graph to xml we are, at the
> >> moment,
> >> assuming that the property element namespace uri is the same as the
> >> uri of
> >> the property type. This is not always the case as in Sebastien's
> example
> >> above.
> >>
> >> I think what is there now will work for Caroline and also for Sebastien
> >> (though the xml is actually incorrect).
> >>
> >> A perfect fix will need more thought and changes in schema parsing,
> >> document loading and document writing. It is possible to have an
> >> improved
> >> fix without too much rework where we only write out the element
> >> prefix after
> >> validating that a global element of the property name was defined
> >> (Property
> >> on the "RootType" of the namespace) exists. So for the examples in this
> >> thread:
> >>
> >>
> >>    - return would be written as <return .. > because there is no
> >>    property named "return" on the Type
> >> http://www.bigbank.com/AccountService#RootType.
> >>
> >>    - address would be written as <tns2:address ... > because "address"
> >>    is a property (of the correct Type) on
> >>
> >> http://schemas.xmlsoap.org/wsdl/soap/<
> http://schemas.xmlsoap.org/wsdl/soap/#RootType><
> http://schemas.xmlsoap.org/wsdl/soap/>
> >>
> >>    #RootType
> >>
> >>
> >> I'll look at this again tomorrow.
> >>
> >> Cheers,
> >>
> >>
> >
> >
> >
> > I've checked in another update which should write the element prefix
> > correctly. I think there are still cases where we should write
> > prefixes on
> > attributes as well.
> >
> > I also fixed the fact that Sequence elements were written as the
> property
> > name and not the element name. There is a similar problem when writing
> > references which I'll fix in the next update.
> >
> > Cheers,
> >
> >
> >
> >>
> >> On 12/12/06, Pete Robbins <ro...@googlemail.com> wrote:
> >> >
> >> >
> >> >
> >> >  On 12/12/06, Jean-Sebastien Delfino < jsdelfino@apache.org> wrote:
> >> > >
> >> > > Pete Robbins wrote:
> >> > > > On 11/12/06, Jean-Sebastien Delfino < jsdelfino@apache.org>
> wrote:
> >> > > >>
> >> > > >> With the SDO head (r485883) the XML response from the
> >> > > AccountDataService
> >> > > >> in the HttpdBigBank scenario is incorrect (and breaks the
> >> > > scenario):
> >> > > >>
> >> > > >> <getStockAccountResponse xmlns="http://tempuri.org"
> >> > > >> xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance "
> >> > > >> xmlns:tns="http://tempuri.org"
> >> > > >> xmlns:tns2=" http://www.bigbank.com/AccountService"><tns2:return
> >> > > >>
> >> > > >>
> >> > >
> >>
> xsi:type="StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></tns2:return></getStockAccountResponse>
> >>
> >> > >
> >> > > >>
> >> > > >>
> >> > > >> - xsi:type="StockAccount" is missing the tns2 namespace prefix.
> >> > > >> - return is not from the tns2 namespace and should not be
> >> prefixed
> >> > > by
> >> > > >> tns2.
> >> > > >>
> >> > > >>
> >> > > >> Going back to an older revision of SDOXMLWriter.cpp (r480964)
> >> I am
> >> > > >> getting the correct XML:
> >> > > >>
> >> > > >> <getStockAccountResponse xmlns=" http://tempuri.org"
> >> > > >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "
> >> > > >> xmlns:tns="http://tempuri.org "
> >> > > >> xmlns:tns2=" http://www.bigbank.com/AccountService"><return
> >> > > >>
> >> > > >>
> >> > >
> >>
> xsi:type="tns2:StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></return></getStockAccountResponse>
> >>
> >> > >
> >> > > >>
> >> > > >>
> >> > > >> I have stepped through the SDO runtime code and I'm not sure yet
> >> > > why
> >> > > >> this is happening, but this is caused by some of the recent
> >> changes
> >> > > to
> >> > > >> SDOXMLWriter.cpp. Any idea?
> >> > > >>
> >> > > >> --
> >> > > >> Jean-Sebastien
> >> > > >
> >> > > >
> >> > > > What namespace is the element <return> supposed to be in? In the
> >> > > first
> >> > > > it is
> >> > > > in "tns2" and in the second the default namespace
> >> http://tempuri.org
> >> > > .
> >> > > > What
> >> > > > Types/Properties are defined in the DataFactory?
> >> > > >
> >> > > > I'll take a look at this. There have been a number of "fixes" in
> >> > > this
> >> > > > area
> >> > > > and each change breaks something else!
> >> > > >
> >> > > > Cheers,
> >> > > >
> >> > > Pete,
> >> > >
> >> > > In my example, checkingAccountResponse is open content so the
> >> <return>
> >> > > element is not defined by a schema, but the instance of
> StockAccount
> >> > > is
> >> > > from tns2.
> >> > >
> >> > > --
> >> > > Jean-Sebastien
> >> >
> >> >
> >> >
> >> > OK. I know how to fix this. Sebastien, you put some code in to
> >> check for
> >> > an open content property and not write the element uri. This caused a
> >> > failure that Caroline saw so we backed out that change.
> >> >
> >> > The problem is actually that your check at the top of the writeDO
> >> method
> >> > was using the *element* name and not the *property* name. The name of
> >> > the element to be written is passed into writeDO, not the name of the
> >> > property that is being processed. These are often the same, but are
> >> not the
> >> > same in cases where substitutions, aliases or sdo:name annotations
> >> are used.
> >> >
> >> >
> >> > I'm on the case and hope to have a fix in the next couple of hours.
> >> >
> >> > Cheers,
> >> >
> >> > --
> >> > Pete
> >> >
> >>
> >>
> >>
> >> --
> >> Pete
> >
> >
> >
> >
>
> Pete,
>
> I'm afraid that a number of scenarios are broken with the latest SDO
> changes (I just tried the SDO head r486738):
> - PythonWeatherForecast
> - HttpdBigBank
> - RestCalculator
> - RestCustomer
>
> Going back to r480964 of SDOXMLWriter.cpp they all work.


That's a long time ago! 485600 is the revision before I made these changes.
Could you test against that so we can eliminate the other changes.

We need to add some of these more complex tests into the SDO testing. Can
you pin down exactly what is failing?

Cheers,

-- 
Pete

Re: [C++] SDOXMLWriter not writing ns prefixes correctly

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Pete Robbins wrote:
> On 13/12/06, Pete Robbins <ro...@googlemail.com> wrote:
>
>> OK... I've checked in a change for this. The result is that xsi:type is
>> written correctly. Unfortunately the element prefix is not always 
>> written
>> correctly. The problem is that we do not record the namespace uri of a
>> property so when we come to write the graph to xml we are, at the 
>> moment,
>> assuming that the property element namespace uri is the same as the 
>> uri of
>> the property type. This is not always the case as in Sebastien's example
>> above.
>>
>> I think what is there now will work for Caroline and also for Sebastien
>> (though the xml is actually incorrect).
>>
>> A perfect fix will need more thought and changes in schema parsing,
>> document loading and document writing. It is possible to have an 
>> improved
>> fix without too much rework where we only write out the element 
>> prefix after
>> validating that a global element of the property name was defined 
>> (Property
>> on the "RootType" of the namespace) exists. So for the examples in this
>> thread:
>>
>>
>>    - return would be written as <return .. > because there is no
>>    property named "return" on the Type 
>> http://www.bigbank.com/AccountService#RootType.
>>
>>    - address would be written as <tns2:address ... > because "address"
>>    is a property (of the correct Type) on
>>    
>> http://schemas.xmlsoap.org/wsdl/soap/<http://schemas.xmlsoap.org/wsdl/soap/#RootType><http://schemas.xmlsoap.org/wsdl/soap/> 
>>
>>    #RootType
>>
>>
>> I'll look at this again tomorrow.
>>
>> Cheers,
>>
>>
>
>
>
> I've checked in another update which should write the element prefix
> correctly. I think there are still cases where we should write 
> prefixes on
> attributes as well.
>
> I also fixed the fact that Sequence elements were written as the property
> name and not the element name. There is a similar problem when writing
> references which I'll fix in the next update.
>
> Cheers,
>
>
>
>>
>> On 12/12/06, Pete Robbins <ro...@googlemail.com> wrote:
>> >
>> >
>> >
>> >  On 12/12/06, Jean-Sebastien Delfino < jsdelfino@apache.org> wrote:
>> > >
>> > > Pete Robbins wrote:
>> > > > On 11/12/06, Jean-Sebastien Delfino < jsdelfino@apache.org> wrote:
>> > > >>
>> > > >> With the SDO head (r485883) the XML response from the
>> > > AccountDataService
>> > > >> in the HttpdBigBank scenario is incorrect (and breaks the
>> > > scenario):
>> > > >>
>> > > >> <getStockAccountResponse xmlns="http://tempuri.org"
>> > > >> xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance "
>> > > >> xmlns:tns="http://tempuri.org"
>> > > >> xmlns:tns2=" http://www.bigbank.com/AccountService"><tns2:return
>> > > >>
>> > > >>
>> > > 
>> xsi:type="StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></tns2:return></getStockAccountResponse> 
>>
>> > >
>> > > >>
>> > > >>
>> > > >> - xsi:type="StockAccount" is missing the tns2 namespace prefix.
>> > > >> - return is not from the tns2 namespace and should not be 
>> prefixed
>> > > by
>> > > >> tns2.
>> > > >>
>> > > >>
>> > > >> Going back to an older revision of SDOXMLWriter.cpp (r480964) 
>> I am
>> > > >> getting the correct XML:
>> > > >>
>> > > >> <getStockAccountResponse xmlns=" http://tempuri.org"
>> > > >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "
>> > > >> xmlns:tns="http://tempuri.org "
>> > > >> xmlns:tns2=" http://www.bigbank.com/AccountService"><return
>> > > >>
>> > > >>
>> > > 
>> xsi:type="tns2:StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></return></getStockAccountResponse> 
>>
>> > >
>> > > >>
>> > > >>
>> > > >> I have stepped through the SDO runtime code and I'm not sure yet
>> > > why
>> > > >> this is happening, but this is caused by some of the recent 
>> changes
>> > > to
>> > > >> SDOXMLWriter.cpp. Any idea?
>> > > >>
>> > > >> --
>> > > >> Jean-Sebastien
>> > > >
>> > > >
>> > > > What namespace is the element <return> supposed to be in? In the
>> > > first
>> > > > it is
>> > > > in "tns2" and in the second the default namespace 
>> http://tempuri.org
>> > > .
>> > > > What
>> > > > Types/Properties are defined in the DataFactory?
>> > > >
>> > > > I'll take a look at this. There have been a number of "fixes" in
>> > > this
>> > > > area
>> > > > and each change breaks something else!
>> > > >
>> > > > Cheers,
>> > > >
>> > > Pete,
>> > >
>> > > In my example, checkingAccountResponse is open content so the 
>> <return>
>> > > element is not defined by a schema, but the instance of StockAccount
>> > > is
>> > > from tns2.
>> > >
>> > > --
>> > > Jean-Sebastien
>> >
>> >
>> >
>> > OK. I know how to fix this. Sebastien, you put some code in to 
>> check for
>> > an open content property and not write the element uri. This caused a
>> > failure that Caroline saw so we backed out that change.
>> >
>> > The problem is actually that your check at the top of the writeDO 
>> method
>> > was using the *element* name and not the *property* name. The name of
>> > the element to be written is passed into writeDO, not the name of the
>> > property that is being processed. These are often the same, but are 
>> not the
>> > same in cases where substitutions, aliases or sdo:name annotations 
>> are used.
>> >
>> >
>> > I'm on the case and hope to have a fix in the next couple of hours.
>> >
>> > Cheers,
>> >
>> > --
>> > Pete
>> >
>>
>>
>>
>> -- 
>> Pete
>
>
>
>

Pete,

I'm afraid that a number of scenarios are broken with the latest SDO 
changes (I just tried the SDO head r486738):
- PythonWeatherForecast
- HttpdBigBank
- RestCalculator
- RestCustomer

Going back to r480964 of SDOXMLWriter.cpp they all work.

-- 
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [C++] SDOXMLWriter not writing ns prefixes correctly

Posted by Pete Robbins <ro...@googlemail.com>.
On 13/12/06, Pete Robbins <ro...@googlemail.com> wrote:

> OK... I've checked in a change for this. The result is that xsi:type is
> written correctly. Unfortunately the element prefix is not always written
> correctly. The problem is that we do not record the namespace uri of a
> property so when we come to write the graph to xml we are, at the moment,
> assuming that the property element namespace uri is the same as the uri of
> the property type. This is not always the case as in Sebastien's example
> above.
>
> I think what is there now will work for Caroline and also for Sebastien
> (though the xml is actually incorrect).
>
> A perfect fix will need more thought and changes in schema parsing,
> document loading and document writing. It is possible to have an improved
> fix without too much rework where we only write out the element prefix after
> validating that a global element of the property name was defined (Property
> on the "RootType" of the namespace) exists. So for the examples in this
> thread:
>
>
>    - return would be written as <return .. > because there is no
>    property named "return" on the Type http://www.bigbank.com/AccountService#RootType.
>
>    - address would be written as <tns2:address ... > because "address"
>    is a property (of the correct Type) on
>    http://schemas.xmlsoap.org/wsdl/soap/<http://schemas.xmlsoap.org/wsdl/soap/#RootType><http://schemas.xmlsoap.org/wsdl/soap/>
>    #RootType
>
>
> I'll look at this again tomorrow.
>
> Cheers,
>
>



I've checked in another update which should write the element prefix
correctly. I think there are still cases where we should write prefixes on
attributes as well.

I also fixed the fact that Sequence elements were written as the property
name and not the element name. There is a similar problem when writing
references which I'll fix in the next update.

Cheers,



>
> On 12/12/06, Pete Robbins <ro...@googlemail.com> wrote:
> >
> >
> >
> >  On 12/12/06, Jean-Sebastien Delfino < jsdelfino@apache.org> wrote:
> > >
> > > Pete Robbins wrote:
> > > > On 11/12/06, Jean-Sebastien Delfino < jsdelfino@apache.org> wrote:
> > > >>
> > > >> With the SDO head (r485883) the XML response from the
> > > AccountDataService
> > > >> in the HttpdBigBank scenario is incorrect (and breaks the
> > > scenario):
> > > >>
> > > >> <getStockAccountResponse xmlns="http://tempuri.org"
> > > >> xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance "
> > > >> xmlns:tns="http://tempuri.org"
> > > >> xmlns:tns2=" http://www.bigbank.com/AccountService"><tns2:return
> > > >>
> > > >>
> > > xsi:type="StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></tns2:return></getStockAccountResponse>
> > >
> > > >>
> > > >>
> > > >> - xsi:type="StockAccount" is missing the tns2 namespace prefix.
> > > >> - return is not from the tns2 namespace and should not be prefixed
> > > by
> > > >> tns2.
> > > >>
> > > >>
> > > >> Going back to an older revision of SDOXMLWriter.cpp (r480964) I am
> > > >> getting the correct XML:
> > > >>
> > > >> <getStockAccountResponse xmlns=" http://tempuri.org"
> > > >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "
> > > >> xmlns:tns="http://tempuri.org "
> > > >> xmlns:tns2=" http://www.bigbank.com/AccountService"><return
> > > >>
> > > >>
> > > xsi:type="tns2:StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></return></getStockAccountResponse>
> > >
> > > >>
> > > >>
> > > >> I have stepped through the SDO runtime code and I'm not sure yet
> > > why
> > > >> this is happening, but this is caused by some of the recent changes
> > > to
> > > >> SDOXMLWriter.cpp. Any idea?
> > > >>
> > > >> --
> > > >> Jean-Sebastien
> > > >
> > > >
> > > > What namespace is the element <return> supposed to be in? In the
> > > first
> > > > it is
> > > > in "tns2" and in the second the default namespace http://tempuri.org
> > > .
> > > > What
> > > > Types/Properties are defined in the DataFactory?
> > > >
> > > > I'll take a look at this. There have been a number of "fixes" in
> > > this
> > > > area
> > > > and each change breaks something else!
> > > >
> > > > Cheers,
> > > >
> > > Pete,
> > >
> > > In my example, checkingAccountResponse is open content so the <return>
> > > element is not defined by a schema, but the instance of StockAccount
> > > is
> > > from tns2.
> > >
> > > --
> > > Jean-Sebastien
> >
> >
> >
> > OK. I know how to fix this. Sebastien, you put some code in to check for
> > an open content property and not write the element uri. This caused a
> > failure that Caroline saw so we backed out that change.
> >
> > The problem is actually that your check at the top of the writeDO method
> > was using the *element* name and not the *property* name. The name of
> > the element to be written is passed into writeDO, not the name of the
> > property that is being processed. These are often the same, but are not the
> > same in cases where substitutions, aliases or sdo:name annotations are used.
> >
> >
> > I'm on the case and hope to have a fix in the next couple of hours.
> >
> > Cheers,
> >
> > --
> > Pete
> >
>
>
>
> --
> Pete




-- 
Pete

Re: [C++] SDOXMLWriter not writing ns prefixes correctly

Posted by Pete Robbins <ro...@googlemail.com>.
OK... I've checked in a change for this. The result is that xsi:type is
written correctly. Unfortunately the element prefix is not always written
correctly. The problem is that we do not record the namespace uri of a
property so when we come to write the graph to xml we are, at the moment,
assuming that the property element namespace uri is the same as the uri of
the property type. This is not always the case as in Sebastien's example
above.

I think what is there now will work for Caroline and also for Sebastien
(though the xml is actually incorrect).

A perfect fix will need more thought and changes in schema parsing, document
loading and document writing. It is possible to have an improved fix without
too much rework where we only write out the element prefix after validating
that a global element of the property name was defined (Property on the
"RootType" of the namespace) exists. So for the examples in this thread:


   - return would be written as <return .. > because there is no property
   named "return" on the Type
   http://www.bigbank.com/AccountService#RootType.
   - address would be written as <tns2:address ... > because "address" is
   a property (of the correct Type) on
   http://schemas.xmlsoap.org/wsdl/soap/<http://schemas.xmlsoap.org/wsdl/soap/#RootType>
   #RootType <http://schemas.xmlsoap.org/wsdl/soap/>


I'll look at this again tomorrow.

Cheers,




On 12/12/06, Pete Robbins <ro...@googlemail.com> wrote:
>
>
>
>  On 12/12/06, Jean-Sebastien Delfino <js...@apache.org> wrote:
> >
> > Pete Robbins wrote:
> > > On 11/12/06, Jean-Sebastien Delfino < jsdelfino@apache.org> wrote:
> > >>
> > >> With the SDO head (r485883) the XML response from the
> > AccountDataService
> > >> in the HttpdBigBank scenario is incorrect (and breaks the scenario):
> > >>
> > >> <getStockAccountResponse xmlns="http://tempuri.org"
> > >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "
> > >> xmlns:tns="http://tempuri.org"
> > >> xmlns:tns2="http://www.bigbank.com/AccountService"><tns2:return
> > >>
> > >>
> > xsi:type="StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></tns2:return></getStockAccountResponse>
> >
> > >>
> > >>
> > >> - xsi:type="StockAccount" is missing the tns2 namespace prefix.
> > >> - return is not from the tns2 namespace and should not be prefixed by
> > >> tns2.
> > >>
> > >>
> > >> Going back to an older revision of SDOXMLWriter.cpp (r480964) I am
> > >> getting the correct XML:
> > >>
> > >> <getStockAccountResponse xmlns=" http://tempuri.org"
> > >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > >> xmlns:tns="http://tempuri.org "
> > >> xmlns:tns2="http://www.bigbank.com/AccountService"><return
> > >>
> > >>
> > xsi:type="tns2:StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></return></getStockAccountResponse>
> >
> > >>
> > >>
> > >> I have stepped through the SDO runtime code and I'm not sure yet why
> > >> this is happening, but this is caused by some of the recent changes
> > to
> > >> SDOXMLWriter.cpp. Any idea?
> > >>
> > >> --
> > >> Jean-Sebastien
> > >
> > >
> > > What namespace is the element <return> supposed to be in? In the first
> > > it is
> > > in "tns2" and in the second the default namespace http://tempuri.org.
> > > What
> > > Types/Properties are defined in the DataFactory?
> > >
> > > I'll take a look at this. There have been a number of "fixes" in this
> > > area
> > > and each change breaks something else!
> > >
> > > Cheers,
> > >
> > Pete,
> >
> > In my example, checkingAccountResponse is open content so the <return>
> > element is not defined by a schema, but the instance of StockAccount is
> > from tns2.
> >
> > --
> > Jean-Sebastien
>
>
>
> OK. I know how to fix this. Sebastien, you put some code in to check for
> an open content property and not write the element uri. This caused a
> failure that Caroline saw so we backed out that change.
>
> The problem is actually that your check at the top of the writeDO method
> was using the *element* name and not the *property* name. The name of the
> element to be written is passed into writeDO, not the name of the property
> that is being processed. These are often the same, but are not the same in
> cases where substitutions, aliases or sdo:name annotations are used.
>
> I'm on the case and hope to have a fix in the next couple of hours.
>
> Cheers,
>
> --
> Pete
>



-- 
Pete

Re: [C++] SDOXMLWriter not writing ns prefixes correctly

Posted by Pete Robbins <ro...@googlemail.com>.
On 12/12/06, Jean-Sebastien Delfino <js...@apache.org> wrote:
>
> Pete Robbins wrote:
> > On 11/12/06, Jean-Sebastien Delfino <js...@apache.org> wrote:
> >>
> >> With the SDO head (r485883) the XML response from the
> AccountDataService
> >> in the HttpdBigBank scenario is incorrect (and breaks the scenario):
> >>
> >> <getStockAccountResponse xmlns="http://tempuri.org"
> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >> xmlns:tns="http://tempuri.org"
> >> xmlns:tns2="http://www.bigbank.com/AccountService"><tns2:return
> >>
> >>
> xsi:type="StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></tns2:return></getStockAccountResponse>
> >>
> >>
> >> - xsi:type="StockAccount" is missing the tns2 namespace prefix.
> >> - return is not from the tns2 namespace and should not be prefixed by
> >> tns2.
> >>
> >>
> >> Going back to an older revision of SDOXMLWriter.cpp (r480964) I am
> >> getting the correct XML:
> >>
> >> <getStockAccountResponse xmlns="http://tempuri.org"
> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >> xmlns:tns="http://tempuri.org"
> >> xmlns:tns2="http://www.bigbank.com/AccountService"><return
> >>
> >>
> xsi:type="tns2:StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></return></getStockAccountResponse>
> >>
> >>
> >> I have stepped through the SDO runtime code and I'm not sure yet why
> >> this is happening, but this is caused by some of the recent changes to
> >> SDOXMLWriter.cpp. Any idea?
> >>
> >> --
> >> Jean-Sebastien
> >
> >
> > What namespace is the element <return> supposed to be in? In the first
> > it is
> > in "tns2" and in the second the default namespace http://tempuri.org.
> > What
> > Types/Properties are defined in the DataFactory?
> >
> > I'll take a look at this. There have been a number of "fixes" in this
> > area
> > and each change breaks something else!
> >
> > Cheers,
> >
> Pete,
>
> In my example, checkingAccountResponse is open content so the <return>
> element is not defined by a schema, but the instance of StockAccount is
> from tns2.
>
> --
> Jean-Sebastien



OK. I know how to fix this. Sebastien, you put some code in to check for an
open content property and not write the element uri. This caused a failure
that Caroline saw so we backed out that change.

The problem is actually that your check at the top of the writeDO method was
using the *element* name and not the *property* name. The name of the
element to be written is passed into writeDO, not the name of the property
that is being processed. These are often the same, but are not the same in
cases where substitutions, aliases or sdo:name annotations are used.

I'm on the case and hope to have a fix in the next couple of hours.

Cheers,

-- 
Pete

Re: [C++] SDOXMLWriter not writing ns prefixes correctly

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Pete Robbins wrote:
> On 11/12/06, Jean-Sebastien Delfino <js...@apache.org> wrote:
>>
>> With the SDO head (r485883) the XML response from the AccountDataService
>> in the HttpdBigBank scenario is incorrect (and breaks the scenario):
>>
>> <getStockAccountResponse xmlns="http://tempuri.org"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:tns="http://tempuri.org"
>> xmlns:tns2="http://www.bigbank.com/AccountService"><tns2:return
>>
>> xsi:type="StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></tns2:return></getStockAccountResponse> 
>>
>>
>> - xsi:type="StockAccount" is missing the tns2 namespace prefix.
>> - return is not from the tns2 namespace and should not be prefixed by
>> tns2.
>>
>>
>> Going back to an older revision of SDOXMLWriter.cpp (r480964) I am
>> getting the correct XML:
>>
>> <getStockAccountResponse xmlns="http://tempuri.org"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:tns="http://tempuri.org"
>> xmlns:tns2="http://www.bigbank.com/AccountService"><return
>>
>> xsi:type="tns2:StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></return></getStockAccountResponse> 
>>
>>
>> I have stepped through the SDO runtime code and I'm not sure yet why
>> this is happening, but this is caused by some of the recent changes to
>> SDOXMLWriter.cpp. Any idea?
>>
>> -- 
>> Jean-Sebastien
>
>
> What namespace is the element <return> supposed to be in? In the first 
> it is
> in "tns2" and in the second the default namespace http://tempuri.org. 
> What
> Types/Properties are defined in the DataFactory?
>
> I'll take a look at this. There have been a number of "fixes" in this 
> area
> and each change breaks something else!
>
> Cheers,
>
Pete,

In my example, checkingAccountResponse is open content so the <return> 
element is not defined by a schema, but the instance of StockAccount is 
from tns2.

-- 
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [C++] SDOXMLWriter not writing ns prefixes correctly

Posted by Caroline Maynard <ca...@gmail.com>.
On 12/12/06, Pete Robbins <ro...@googlemail.com> wrote:

>
> What namespace is the element <return> supposed to be in? In the first it
> is
> in "tns2" and in the second the default namespace http://tempuri.org. What
> Types/Properties are defined in the DataFactory?
>
> I'll take a look at this. There have been a number of "fixes" in this area
> and each change breaks something else!
>

It's likely this was the
http://issues.apache.org/jira/browse/TUSCANY-962fix. Please make sure
this scenario continues to work, as it's crucial for
SOAP support.

Re: [C++] SDOXMLWriter not writing ns prefixes correctly

Posted by Pete Robbins <ro...@googlemail.com>.
On 11/12/06, Jean-Sebastien Delfino <js...@apache.org> wrote:
>
> With the SDO head (r485883) the XML response from the AccountDataService
> in the HttpdBigBank scenario is incorrect (and breaks the scenario):
>
> <getStockAccountResponse xmlns="http://tempuri.org"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:tns="http://tempuri.org"
> xmlns:tns2="http://www.bigbank.com/AccountService"><tns2:return
>
> xsi:type="StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></tns2:return></getStockAccountResponse>
>
> - xsi:type="StockAccount" is missing the tns2 namespace prefix.
> - return is not from the tns2 namespace and should not be prefixed by
> tns2.
>
>
> Going back to an older revision of SDOXMLWriter.cpp (r480964) I am
> getting the correct XML:
>
> <getStockAccountResponse xmlns="http://tempuri.org"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:tns="http://tempuri.org"
> xmlns:tns2="http://www.bigbank.com/AccountService"><return
>
> xsi:type="tns2:StockAccount"><accountNumber>1234_STA12345</accountNumber><symbol>IBM</symbol><quantity>100</quantity><balance></balance></return></getStockAccountResponse>
>
> I have stepped through the SDO runtime code and I'm not sure yet why
> this is happening, but this is caused by some of the recent changes to
> SDOXMLWriter.cpp. Any idea?
>
> --
> Jean-Sebastien


What namespace is the element <return> supposed to be in? In the first it is
in "tns2" and in the second the default namespace http://tempuri.org. What
Types/Properties are defined in the DataFactory?

I'll take a look at this. There have been a number of "fixes" in this area
and each change breaks something else!

Cheers,

-- 
Pete