473,387 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

invalidcastexception

Hi,
I have developed a webservice with OTA compliance using WSCF 0.6.
Now eveything works fine but the soap messages with paymentcard node is
giving me following error.

(70, 29). ---> System.InvalidCastException: Operator '<>'
is not defined for 'Nothing'
and type 'PaymentCardType'

Please let me know what am I doing wrong.

Regards,
Nis

Dec 11 '06 #1
5 1321
"imonline" <ni****@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
I have developed a webservice with OTA compliance using WSCF 0.6.
Now eveything works fine but the soap messages with paymentcard node is
giving me following error.

(70, 29). ---&gt; System.InvalidCastException: Operator '&lt;&gt;'
is not defined for 'Nothing'
and type 'PaymentCardType'

Please let me know what am I doing wrong.
Without seeing your code (sigh...) it's a little difficult to tell, but it
looks as though you are either HTMLEncoding / URLEncoding when you shouldn't
or not HTMLDecoding / URLEncoding when you should...

Either that or your webservice is not returning a value in a node where the
caller is expecting to find a value...
Dec 11 '06 #2
Hey Mark,
Thanks for your reply. Let me know which code do you
wanna see. Let me explain you the whole scenario. I have created my
webservice using wscf 0.6 using XSDs. The webservice works fine with
almost all messages. But Some of the messages which contain paymentcard
gives the error as given in my first mail. If I remove that node the
service works fine.

Let me know which code you want to review.

Thanks,
Nis
Mark Rae wrote:
"imonline" <ni****@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
I have developed a webservice with OTA compliance using WSCF 0.6.
Now eveything works fine but the soap messages with paymentcard node is
giving me following error.

(70, 29). ---&gt; System.InvalidCastException: Operator '&lt;&gt;'
is not defined for 'Nothing'
and type 'PaymentCardType'

Please let me know what am I doing wrong.

Without seeing your code (sigh...) it's a little difficult to tell, but it
looks as though you are either HTMLEncoding / URLEncoding when you shouldn't
or not HTMLDecoding / URLEncoding when you should...

Either that or your webservice is not returning a value in a node where the
caller is expecting to find a value...
Dec 11 '06 #3
Somewhere you have a piece of code that does

x <y

where y is a variable of type PaymentCardType and x is of type
Nothing....and VB doesn't know how to compare nothing to PaymentCardType.

You should probably check X for nothing before moving on...

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"imonline" <ni****@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
Hi,
I have developed a webservice with OTA compliance using WSCF 0.6.
Now eveything works fine but the soap messages with paymentcard node is
giving me following error.

(70, 29). ---&gt; System.InvalidCastException: Operator '&lt;&gt;'
is not defined for 'Nothing'
and type 'PaymentCardType'

Please let me know what am I doing wrong.

Regards,
Nis
Dec 11 '06 #4
Hey Karl,
Thanks a lot for reply and throwing some light on the
issue. The inner exception indicates the following code as problematic;
<System.Xml.Serialization.XmlElementAttribute("Ban kAcct",
GetType(BankAcctType), Order:=0), _
System.Xml.Serialization.XmlElementAttribute("Cash ",
GetType(PaymentFormTypeCash), Order:=0), _
System.Xml.Serialization.XmlElementAttribute("Dire ctBill",
GetType(DirectBillType), Order:=0), _

System.Xml.Serialization.XmlElementAttribute("Loya ltyRedemption",
GetType(PaymentFormTypeLoyaltyRedemption), Order:=0), _

System.Xml.Serialization.XmlElementAttribute("Misc ChargeOrder",
GetType(PaymentFormTypeMiscChargeOrder), Order:=0), _
System.Xml.Serialization.XmlElementAttribute("Paym entCard",
GetType(PaymentCardType), Order:=0), _
System.Xml.Serialization.XmlElementAttribute("Vouc her",
GetType(PaymentFormTypeVoucher), Order:=0) _
Public Property Item() As Object
Get
Return Me._item
End Get
Set
If (Me._item <value) Then
Me._item = value
End If
End Set
End Property

Can u tell me what am I doing Wrong?

Thanks,
Nis
Karl Seguin wrote:
Somewhere you have a piece of code that does

x <y

where y is a variable of type PaymentCardType and x is of type
Nothing....and VB doesn't know how to compare nothing to PaymentCardType.

You should probably check X for nothing before moving on...

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"imonline" <ni****@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
Hi,
I have developed a webservice with OTA compliance using WSCF 0.6.
Now eveything works fine but the soap messages with paymentcard node is
giving me following error.

(70, 29). ---&gt; System.InvalidCastException: Operator '&lt;&gt;'
is not defined for 'Nothing'
and type 'PaymentCardType'

Please let me know what am I doing wrong.

Regards,
Nis
Dec 11 '06 #5
Thanks a lot Ciaran for the solution. Your suggestion has solved my
problem.
Regards,
Nis
Ciaran O''Donnell wrote:
--Me._item <value
one of these is null, probably the member variable considering this is
deserialising,
try changing it to:
--Me._item Is Nothing OrElse Me._item <value

--
Ciaran O''''Donnell
http://wannabedeveloper.spaces.live.com
"imonline" wrote:
Hey Karl,
Thanks a lot for reply and throwing some light on the
issue. The inner exception indicates the following code as problematic;
<System.Xml.Serialization.XmlElementAttribute("Ban kAcct",
GetType(BankAcctType), Order:=0), _
System.Xml.Serialization.XmlElementAttribute("Cash ",
GetType(PaymentFormTypeCash), Order:=0), _
System.Xml.Serialization.XmlElementAttribute("Dire ctBill",
GetType(DirectBillType), Order:=0), _

System.Xml.Serialization.XmlElementAttribute("Loya ltyRedemption",
GetType(PaymentFormTypeLoyaltyRedemption), Order:=0), _

System.Xml.Serialization.XmlElementAttribute("Misc ChargeOrder",
GetType(PaymentFormTypeMiscChargeOrder), Order:=0), _
System.Xml.Serialization.XmlElementAttribute("Paym entCard",
GetType(PaymentCardType), Order:=0), _
System.Xml.Serialization.XmlElementAttribute("Vouc her",
GetType(PaymentFormTypeVoucher), Order:=0) _
Public Property Item() As Object
Get
Return Me._item
End Get
Set
If (Me._item <value) Then
Me._item = value
End If
End Set
End Property

Can u tell me what am I doing Wrong?

Thanks,
Nis
Karl Seguin wrote:
Somewhere you have a piece of code that does
>
x <y
>
where y is a variable of type PaymentCardType and x is of type
Nothing....and VB doesn't know how to compare nothing to PaymentCardType.
>
You should probably check X for nothing before moving on...
>
Karl
>
--
http://www.openmymind.net/
http://www.fuelindustries.com/
>
>
"imonline" <ni****@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
Hi,
I have developed a webservice with OTA compliance using WSCF 0.6.
Now eveything works fine but the soap messages with paymentcard node is
giving me following error.

(70, 29). ---System.InvalidCastException: Operator '<>'
is not defined for 'Nothing'
and type 'PaymentCardType'

Please let me know what am I doing wrong.

Regards,
Nis
Dec 12 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Johan Appelgren | last post by:
Hi, I'm trying to serialize a class hierarchy using System.Xml.Serialization.XmlSerializer from a class that is loaded as a Com object. But it fails with a InvalidCastException. I don't know...
1
by: bob scola | last post by:
I have a csharp, VS 2003 solution for a winform application The application uses an object called a "matter" and the class is defined in matter.cs. I can load matter objects into a combobox ...
11
by: Roy Lawson | last post by:
I have no idea what is going on here. I wrote a simple application in VB.NET to generate a Crystal Report, and I am now trying to move it to ASP.NET with Crstal Enterprise. I wish I could tell...
4
by: DOTNET | last post by:
Hi, Anybody help me regarding this error: I am assigning the values to the session variables when the button is clicked and passing these session variables to the next page and when I am...
0
by: QA | last post by:
I am using a Business Scorecard Accelarator in a Sharepoint Portal 2003 using SQL Server 2005 I am getting the following error: Error,5/7/2005 10:50:14 AM,580,AUE1\Administrator,"Specified cast is...
1
by: Marc | last post by:
Hi! I'm working with a C# client that calls a php web service. I've created a wrapper to call the service using .NET wsdl tool (adding a web reference). The call to the server works fine, it...
8
by: Gamma | last post by:
I'm trying to inherit subclass from System.Diagnostics.Process, but whenever I cast a "Process" object to it's subclass, I encounter an exception "System.InvalidCastException" ("Specified cast is...
8
by: =?Utf-8?B?YXVsZGg=?= | last post by:
i trying to collect windows services. i'm getting inconsistencies. the collection works every time locally. but remote collection yields different result depending on my lab environment. 1) in...
4
by: rsdev | last post by:
Hi, I have an InvalidCastException which is completely puzzling me. I have checked all the members in the stored procedure against my data provider and seems to be ok. Also in the stack trace it...
8
by: Joe HM | last post by:
Hello - I was wondering that the "cleanest" way is to determine whether a CType() will throw an InvalidCastException? I have data I receive as an Object and I want to convert it to a String...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.