class problem (class)

S

Savas Ates

i have two class and i create them but i dont assign a value and run the
subroutines.. what is my mistake?

the error is --- Object reference not set to an instance of an
object.----

i think it is about this line

ws2.ProductDefinitions(i) = New WebReference1.ProductDefinitionType()

*************************************

Public Class ProductUpdateServiceImpl

Public Sub getProductUpdate(ByVal productUpdate As ProductUpdate_TYPE)

Me.Invoke("getProductUpdate", New Object() {productUpdate})

End Sub

End Class

**********************************

Public Class ProductUpdate_TYPE



Public KangurumShopId As String



Public ProductDefinitions() As ProductDefinitionType

Public UpdateDate As Date

End Class

******************************

************codes******************

Dim ws2 As New WebReference1.ProductUpdate_TYPE()

Dim wsbaba As New WebReference1.ProductUpdateServiceImpl()



for i=0 to 100

ws2.ProductDefinitions(i) = New WebReference1.ProductDefinitionType()

wsbaba.getProductUpdate(ws2)

next

**************************************
 
D

Dan Rogers

Hi Savas,

This approach, if I understand what you're written here, isn't going to
work.

In the case where you are assigning what appear to be array members in a
loop, I would expect issues since you haven't sized the array at runtime.
Since your variables are named webreference_something_or_other, I'm
assuming these are standard proxy classes and the types that would be
defined by them.

Which line of code is throwing the exception? Try placing a break point in
both your client and server code (one instance of VS on the service, and
another instance on the client) and place them both into debug mode and
step thru the calls.

I'm also suspicious that the types you seem to be sharing between your
proxies will not be of the same type - and you'll eventually get casting
exceptions.

Finally, what are you trying to accomplish with your me.Invoke line. It
seems to be an attempt to recursively call itself.

Hope this helps

Dan Rogers
Microsoft Corporation


--------------------
From: "Savas Ates" <[email protected]>
Subject: class problem (class)
Date: Fri, 24 Dec 2004 11:29:29 +0200
Lines: 59
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Message-ID: <O0Pxi#[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices,microsoft.public.script
ing.vbscript,microsoft.public.vstudio.development,microsoft.public.webservic
es
NNTP-Posting-Host: dsl81-215-38852.adsl.ttnet.net.tr 81.215.151.196
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.scripting.vbscript:163447
microsoft.public.vstudio.development:6200 microsoft.public.webservices:2611
microsoft.public.dotnet.framework.aspnet.webservices:27380
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,828
Latest member
LauraCastr

Latest Threads

Top