REPOST: <Obsolete tag causing server to barf

  • Thread starter Thread starter teddysnips
  • Start date Start date
T

teddysnips

In the class declaration of a web service that I've just picked up for
maintenance:

<Obsolete("Superseded by OrderPaymentElements")> Public PaymentType
As OrderPaymentType
Public OrderPaymentElements As OrderPaymentList

Apparently there's a problem with the generated SOAP. This is what
the client said:

"Server was unable to read request. --> There is an error in XML
document (1, 1553). --> '0' is not a valid value for OrderPaymentType"

Looking at the request that is the position of the PaymentType element
in the soap document."

Can anyone tell me what possible purpose the <Obsolete tag has? Are
there any reasons not to use <XmlIgnore()> instead? More worryingly,
why is the server barfing?

DISCLAIMER: I'm new to this and it's a pretty complex, and completely
undocumented application. Aren't I the lucky one?

Thanks

Edward
 
In the class declaration of a web service that I've just picked up for
maintenance:

<Obsolete("Superseded by OrderPaymentElements")> Public PaymentType
As OrderPaymentType
Public OrderPaymentElements As OrderPaymentList

Apparently there's a problem with the generated SOAP. This is what
the client said:

"Server was unable to read request. --> There is an error in XML
document (1, 1553). --> '0' is not a valid value for OrderPaymentType"

Looking at the request that is the position of the PaymentType element
in the soap document."

Can anyone tell me what possible purpose the <Obsolete tag has? Are
there any reasons not to use <XmlIgnore()> instead? More worryingly,
why is the server barfing?

DISCLAIMER: I'm new to this and it's a pretty complex, and completely
undocumented application. Aren't I the lucky one?

Thanks

Edward
XmlIgnore and Obsolete are two very different attributes, the former says do
not include this property in XML serialisation, the latter is marking the
property as obsolete.
Sound to me like the WSDL schema has payment type down as an enumeration or
the like with 0 an invalid choice.
Can you show the schema?
 
Joe said:
XmlIgnore and Obsolete are two very different attributes, the former says do
not include this property in XML serialisation, the latter is marking the
property as obsolete.
Sound to me like the WSDL schema has payment type down as an enumeration or
the like with 0 an invalid choice.
Can you show the schema?

What is the point of an obsolete property? Why not just delete it?

I *can* show the schema, I think, but I'm not in the office. I'll do
my best to dig it out tomorrow.

Edward
 
Because deleting it might break existing applications. Obsolete is one step
up from Deprecated.
 
Joe Fawcett wrote:
[...]
XmlIgnore and Obsolete are two very different attributes, the former says do
not include this property in XML serialisation, the latter is marking the
property as obsolete.
Sound to me like the WSDL schema has payment type down as an enumeration or
the like with 0 an invalid choice.
Can you show the schema?

Here's part of it: it's 3,100 lines long or I'd post the lot!

<s:complexType name="Order">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="GrandTotal"
type="s:decimal" />
<s:element minOccurs="0" maxOccurs="1" name="IndividualKey"
type="tns:IndividualKey" />
<s:element minOccurs="0" maxOccurs="1" name="InvoiceAddress"
type="tns:Address" />
<s:element minOccurs="0" maxOccurs="1"
name="OrderItemGroupList" type="tns:ArrayOfOrderItemGroup" />
<s:element minOccurs="1" maxOccurs="1" name="SubTotal"
type="s:decimal" />
<s:element minOccurs="1" maxOccurs="1" name="Vat"
type="s:decimal" />
<s:element minOccurs="1" maxOccurs="1" name="PostageAmount"
type="s:decimal" />
<s:element minOccurs="0" maxOccurs="1" name="InvoiceNumber"
type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="OrderReference"
type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="IndividualName"
type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="DiscountAmount"
type="s:decimal" />
<s:element minOccurs="1" maxOccurs="1" name="OverrideTotal"
type="s:boolean" />
<s:element minOccurs="0" maxOccurs="1" name="OverrideReason"
type="s:string" />
<s:element minOccurs="0" maxOccurs="1"
name="OrderPaymentElements" type="tns:ArrayOfOrderPayment" />
</s:sequence>
</s:complexType>
<s:complexType name="OrderPayment">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="PaymentAmount"
type="s:decimal" />
<s:element minOccurs="1" maxOccurs="1" name="PaymentType"
type="tns:OrderPaymentType" />
<s:element minOccurs="0" maxOccurs="1" name="OrderReference"
type="s:string" />
</s:sequence>
</s:complexType>
<s:simpleType name="OrderPaymentType">
<s:restriction base="s:string">
<s:enumeration value="None" />
<s:enumeration value="DataCash" />
<s:enumeration value="ManualCash" />
<s:enumeration value="ManualCheque" />
<s:enumeration value="CreditCard" />
</s:restriction>
</s:simpleType>

Thanks

Edward
 
Joe Fawcett wrote:
[...]
XmlIgnore and Obsolete are two very different attributes, the former says
do
not include this property in XML serialisation, the latter is marking the
property as obsolete.
Sound to me like the WSDL schema has payment type down as an enumeration
or
the like with 0 an invalid choice.
Can you show the schema?

Here's part of it: it's 3,100 lines long or I'd post the lot!


The payment order type is defined below:
<s:simpleType name="OrderPaymentType">
<s:restriction base="s:string">
<s:enumeration value="None" />
<s:enumeration value="DataCash" />
<s:enumeration value="ManualCash" />
<s:enumeration value="ManualCheque" />
<s:enumeration value="CreditCard" />
</s:restriction>
</s:simpleType>

So 0 is not a valid option, looks like it should be the string None.
 
Back
Top