Web Services doubts

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Web Services doubts

Diana Francisca Adamatti
Hi,
I am trying to implement a web service between SmallTalk (server) and
Java(client).
I already did the communication between these two languages, the answers
to SmallTalk are wrong! In fact, when the client (Java) asks to the
server a specific service, the answer is:

SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Message
not understood: #do:</faultstring><detail><string>a
MessageNotUnderstood</string></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>



I am working with VisualWorks 7.3 and my web services class
(JogoManWebServices) is a subclass of my main class (JogoMan).Please,
see the  picture in annex error.gif.
In the subclass, I use some instance variables defined in superclass.
However, when I putted a "self halt" in a method of this subclass, the
values of  variables created in superclass are "nil". What am I doing
wrong? Is necessary to create a specific type of variables to use in the
subclass?

For example, in picture error2.gif in annex, the method
"infraEstruturas" uses the superclass variable "theInfrastructures", but
in superclass this variable has a set of  values and in subclass, it is
nil.


Thank you in advance for helping.

Best regards,
Diana Adamatti

error.GIF (47K) Download Attachment
error2.GIF (13K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Web Services doubts

Rob Vens
Diana,
Just a question. You are referring to " variables defined in
superclass". This is ok, but are you sure these variables are filled
in ***your*** class? A subclass is a subtype, but does not " contain"
the superclass. Any variables defined in it need to be initialised or
filled in your instance (of the subclass).
If you do not understand my question we can drill further into this.

2006/4/17, diana adamatti <[hidden email]>:

> Hi,
> I am trying to implement a web service between SmallTalk (server) and
> Java(client).
> I already did the communication between these two languages, the answers
> to SmallTalk are wrong! In fact, when the client (Java) asks to the
> server a specific service, the answer is:
>
> SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Message
> not understood: #do:</faultstring><detail><string>a
> MessageNotUnderstood</string></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
>
>
>
> I am working with VisualWorks 7.3 and my web services class
> (JogoManWebServices) is a subclass of my main class (JogoMan).Please,
> see the  picture in annex error.gif.
> In the subclass, I use some instance variables defined in superclass.
> However, when I putted a "self halt" in a method of this subclass, the
> values of  variables created in superclass are "nil". What am I doing
> wrong? Is necessary to create a specific type of variables to use in the
> subclass?
>
> For example, in picture error2.gif in annex, the method
> "infraEstruturas" uses the superclass variable "theInfrastructures", but
> in superclass this variable has a set of  values and in subclass, it is
> nil.
>
>
> Thank you in advance for helping.
>
> Best regards,
> Diana Adamatti
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Web Services doubts

Diana Francisca Adamatti
Hi Rob,
I understood your question.  In fact, I need the values of superclass
variables. I tried to use "super variableXX", but it does not work!
Do you have some suggestions?

Thanks,
Diana



Rob Vens escreveu:

> Diana,
> Just a question. You are referring to " variables defined in
> superclass". This is ok, but are you sure these variables are filled
> in ***your*** class? A subclass is a subtype, but does not " contain"
> the superclass. Any variables defined in it need to be initialised or
> filled in your instance (of the subclass).
> If you do not understand my question we can drill further into this.
>
> 2006/4/17, diana adamatti <[hidden email]>:
>  
>> Hi,
>> I am trying to implement a web service between SmallTalk (server) and
>> Java(client).
>> I already did the communication between these two languages, the answers
>> to SmallTalk are wrong! In fact, when the client (Java) asks to the
>> server a specific service, the answer is:
>>
>> SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Message
>> not understood: #do:</faultstring><detail><string>a
>> MessageNotUnderstood</string></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
>>
>>
>>
>> I am working with VisualWorks 7.3 and my web services class
>> (JogoManWebServices) is a subclass of my main class (JogoMan).Please,
>> see the  picture in annex error.gif.
>> In the subclass, I use some instance variables defined in superclass.
>> However, when I putted a "self halt" in a method of this subclass, the
>> values of  variables created in superclass are "nil". What am I doing
>> wrong? Is necessary to create a specific type of variables to use in the
>> subclass?
>>
>> For example, in picture error2.gif in annex, the method
>> "infraEstruturas" uses the superclass variable "theInfrastructures", but
>> in superclass this variable has a set of  values and in subclass, it is
>> nil.
>>
>>
>> Thank you in advance for helping.
>>
>> Best regards,
>> Diana Adamatti
>>
>>
>>
>>    


Reply | Threaded
Open this post in threaded view
|

Re: Web Services doubts

Rob Vens
Scenario:
you have superclass DoIt, and subclass DoItBetter.
DoIt defines instance variable rememberThis. DoItBetter defines
instance variable rememberThisAlso.
In class DoIt you can get access to these variables with methods you
define in that class.
In protocol "accessing" you need to write two methods:

rememberThis
  " This is the getter method, to retrieve the value,"
  ^rememberThis

rememberThis: newValue
   "This is the setter method, to set the value to the argument, newValue,"
   rememberThis := newValue

In the subclass you define two methods to get and set the value of the
second instance variable (rememberThisAlso), similar to the above but
of course naming the variable correctly,
Now the important part, of which I am unsure whether you are aware of
it. You create an instance of DoItBetter, for example with the code:

myInstance := DoItBetter new.

You set values for it's instance variables:

myInstance rememberThis: 'My superclass variable value'.
myInstance rememberThisAlso: 'My own class variable value'.

I hope I understood your problem correctly. Because the first line
sets the value of the subclass instance, and the value it sets it that
defined in the superclass.
Now if you want to get the value, you send the subclass instance the
method defined in the superclass (and inherited by the subclass), in
this way:

myInstance rememberThis

this will return (as expected) the value: 'My superclass variable value'.

If this is still not clear Diana, take the discussion offline, and I
will explain. (gone now for bed and am offline myself for the day).

2006/4/17, diana adamatti <[hidden email]>:

> Hi Rob,
> I understood your question.  In fact, I need the values of superclass
> variables. I tried to use "super variableXX", but it does not work!
> Do you have some suggestions?
>
> Thanks,
> Diana
>
>
>
> Rob Vens escreveu:
> > Diana,
> > Just a question. You are referring to " variables defined in
> > superclass". This is ok, but are you sure these variables are filled
> > in ***your*** class? A subclass is a subtype, but does not " contain"
> > the superclass. Any variables defined in it need to be initialised or
> > filled in your instance (of the subclass).
> > If you do not understand my question we can drill further into this.
> >
> > 2006/4/17, diana adamatti <[hidden email]>:
> >
> >> Hi,
> >> I am trying to implement a web service between SmallTalk (server) and
> >> Java(client).
> >> I already did the communication between these two languages, the answers
> >> to SmallTalk are wrong! In fact, when the client (Java) asks to the
> >> server a specific service, the answer is:
> >>
> >> SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Message
> >> not understood: #do:</faultstring><detail><string>a
> >> MessageNotUnderstood</string></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
> >>
> >>
> >>
> >> I am working with VisualWorks 7.3 and my web services class
> >> (JogoManWebServices) is a subclass of my main class (JogoMan).Please,
> >> see the  picture in annex error.gif.
> >> In the subclass, I use some instance variables defined in superclass.
> >> However, when I putted a "self halt" in a method of this subclass, the
> >> values of  variables created in superclass are "nil". What am I doing
> >> wrong? Is necessary to create a specific type of variables to use in the
> >> subclass?
> >>
> >> For example, in picture error2.gif in annex, the method
> >> "infraEstruturas" uses the superclass variable "theInfrastructures", but
> >> in superclass this variable has a set of  values and in subclass, it is
> >> nil.
> >>
> >>
> >> Thank you in advance for helping.
> >>
> >> Best regards,
> >> Diana Adamatti
> >>
> >>
> >>
> >>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Web Services doubts

Diana Francisca Adamatti
Hi Rob!

I think that the real problem is the new instance of webService, that it
is a subclass of Object, because, when I run my application (JogoMan)
the instance variables have values, but, when I call the method to
create the web server, I lose my instance variables. My problem is with
instance of variables and the use of web services.... :o((((

The method of server and client creation is:

*protocoloSOAP
   | opentalkServer client arg1 value |
   opentalkServer := TesteSOAP new.
   opentalkServer startServers.
   client := TesteSOAPClient new.
   client start.
   value := client numRodada.


*numRodada is a method of my web service.  I defined my web service in
Web Service Wizard.

Please, look the picture error3.gif, where you can see when the client
tries to pick up the value of "rodada" variable and it is "nil". But,
look that I am in an instance of "TesteSOAPClient" and my application
"JogoMan" and its variables and values does not appear.

May be, I need to define the server and the client in another way,
without the Wizard......

Thanks,
Diana

Rob Vens escreveu:

> Scenario:
> you have superclass DoIt, and subclass DoItBetter.
> DoIt defines instance variable rememberThis. DoItBetter defines
> instance variable rememberThisAlso.
> In class DoIt you can get access to these variables with methods you
> define in that class.
> In protocol "accessing" you need to write two methods:
>
> rememberThis
>   " This is the getter method, to retrieve the value,"
>   ^rememberThis
>
> rememberThis: newValue
>    "This is the setter method, to set the value to the argument, newValue,"
>    rememberThis := newValue
>
> In the subclass you define two methods to get and set the value of the
> second instance variable (rememberThisAlso), similar to the above but
> of course naming the variable correctly,
> Now the important part, of which I am unsure whether you are aware of
> it. You create an instance of DoItBetter, for example with the code:
>
> myInstance := DoItBetter new.
>
> You set values for it's instance variables:
>
> myInstance rememberThis: 'My superclass variable value'.
> myInstance rememberThisAlso: 'My own class variable value'.
>
> I hope I understood your problem correctly. Because the first line
> sets the value of the subclass instance, and the value it sets it that
> defined in the superclass.
> Now if you want to get the value, you send the subclass instance the
> method defined in the superclass (and inherited by the subclass), in
> this way:
>
> myInstance rememberThis
>
> this will return (as expected) the value: 'My superclass variable value'.
>
> If this is still not clear Diana, take the discussion offline, and I
> will explain. (gone now for bed and am offline myself for the day).
>
> 2006/4/17, diana adamatti <[hidden email]>:
>  
>> Hi Rob,
>> I understood your question.  In fact, I need the values of superclass
>> variables. I tried to use "super variableXX", but it does not work!
>> Do you have some suggestions?
>>
>> Thanks,
>> Diana
>>
>>
>>
>> Rob Vens escreveu:
>>    
>>> Diana,
>>> Just a question. You are referring to " variables defined in
>>> superclass". This is ok, but are you sure these variables are filled
>>> in ***your*** class? A subclass is a subtype, but does not " contain"
>>> the superclass. Any variables defined in it need to be initialised or
>>> filled in your instance (of the subclass).
>>> If you do not understand my question we can drill further into this.
>>>
>>> 2006/4/17, diana adamatti <[hidden email]>:
>>>
>>>      
>>>> Hi,
>>>> I am trying to implement a web service between SmallTalk (server) and
>>>> Java(client).
>>>> I already did the communication between these two languages, the answers
>>>> to SmallTalk are wrong! In fact, when the client (Java) asks to the
>>>> server a specific service, the answer is:
>>>>
>>>> SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Message
>>>> not understood: #do:</faultstring><detail><string>a
>>>> MessageNotUnderstood</string></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
>>>>
>>>>
>>>>
>>>> I am working with VisualWorks 7.3 and my web services class
>>>> (JogoManWebServices) is a subclass of my main class (JogoMan).Please,
>>>> see the  picture in annex error.gif.
>>>> In the subclass, I use some instance variables defined in superclass.
>>>> However, when I putted a "self halt" in a method of this subclass, the
>>>> values of  variables created in superclass are "nil". What am I doing
>>>> wrong? Is necessary to create a specific type of variables to use in the
>>>> subclass?
>>>>
>>>> For example, in picture error2.gif in annex, the method
>>>> "infraEstruturas" uses the superclass variable "theInfrastructures", but
>>>> in superclass this variable has a set of  values and in subclass, it is
>>>> nil.
>>>>
>>>>
>>>> Thank you in advance for helping.
>>>>
>>>> Best regards,
>>>> Diana Adamatti
>>>>
>>>>
>>>>
>>>>
>>>>        
>>
>>    


error3.GIF (35K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Web Services doubts

Kogan, Tamara
In reply to this post by Diana Francisca Adamatti
Diana,

when I run my application (JogoMan)
> the instance variables have values, but, when I call the method to
> create the web server, I lose my instance variables. My problem is
with
> instance of variables and the use of web services.... :o((((

The Opentalk server creates an instance of the service class as
service := MyServiceClass new.
If instance variables in the "service" instance are not initialized the
server can not initialize them.
You have to check how you create an instance of the JogoMan class in
your application and how the application initializes inst. vars.

 >
> May be, I need to define the server and the client in another way,
> without the Wizard......
>
The Wizard is fine. It created Opentalk server and client and as far as
I see from the attached picture the client and server can communicate
but the service class failed to initialize the data.

Why don't you add #initialize method to your service class to set inst.
vars?

Tamara Kogan
Smalltalk Development
Cincom Systems

> -----Original Message-----
> From: diana adamatti [mailto:[hidden email]]
> Sent: Tuesday, April 18, 2006 6:15 PM
> To: [hidden email]
> Cc: [hidden email]
> Subject: Re: Web Services doubts
>
> Hi Rob!
>
> I think that the real problem is the new instance of webService, that
it
> is a subclass of Object, because, when I run my application (JogoMan)
> the instance variables have values, but, when I call the method to
> create the web server, I lose my instance variables. My problem is
with

> instance of variables and the use of web services.... :o((((
>
> The method of server and client creation is:
>
> *protocoloSOAP
>    | opentalkServer client arg1 value |
>    opentalkServer := TesteSOAP new.
>    opentalkServer startServers.
>    client := TesteSOAPClient new.
>    client start.
>    value := client numRodada.
>
>
> *numRodada is a method of my web service.  I defined my web service in
> Web Service Wizard.
>
> Please, look the picture error3.gif, where you can see when the client
> tries to pick up the value of "rodada" variable and it is "nil". But,
> look that I am in an instance of "TesteSOAPClient" and my application
> "JogoMan" and its variables and values does not appear.
>
> May be, I need to define the server and the client in another way,
> without the Wizard......
>
> Thanks,
> Diana
>
> Rob Vens escreveu:
> > Scenario:
> > you have superclass DoIt, and subclass DoItBetter.
> > DoIt defines instance variable rememberThis. DoItBetter defines
> > instance variable rememberThisAlso.
> > In class DoIt you can get access to these variables with methods you
> > define in that class.
> > In protocol "accessing" you need to write two methods:
> >
> > rememberThis
> >   " This is the getter method, to retrieve the value,"
> >   ^rememberThis
> >
> > rememberThis: newValue
> >    "This is the setter method, to set the value to the argument,
> newValue,"
> >    rememberThis := newValue
> >
> > In the subclass you define two methods to get and set the value of
the
> > second instance variable (rememberThisAlso), similar to the above
but
> > of course naming the variable correctly,
> > Now the important part, of which I am unsure whether you are aware
of

> > it. You create an instance of DoItBetter, for example with the code:
> >
> > myInstance := DoItBetter new.
> >
> > You set values for it's instance variables:
> >
> > myInstance rememberThis: 'My superclass variable value'.
> > myInstance rememberThisAlso: 'My own class variable value'.
> >
> > I hope I understood your problem correctly. Because the first line
> > sets the value of the subclass instance, and the value it sets it
that

> > defined in the superclass.
> > Now if you want to get the value, you send the subclass instance the
> > method defined in the superclass (and inherited by the subclass), in
> > this way:
> >
> > myInstance rememberThis
> >
> > this will return (as expected) the value: 'My superclass variable
> value'.
> >
> > If this is still not clear Diana, take the discussion offline, and I
> > will explain. (gone now for bed and am offline myself for the day).
> >
> > 2006/4/17, diana adamatti <[hidden email]>:
> >
> >> Hi Rob,
> >> I understood your question.  In fact, I need the values of
superclass

> >> variables. I tried to use "super variableXX", but it does not work!
> >> Do you have some suggestions?
> >>
> >> Thanks,
> >> Diana
> >>
> >>
> >>
> >> Rob Vens escreveu:
> >>
> >>> Diana,
> >>> Just a question. You are referring to " variables defined in
> >>> superclass". This is ok, but are you sure these variables are
filled
> >>> in ***your*** class? A subclass is a subtype, but does not "
contain"
> >>> the superclass. Any variables defined in it need to be initialised
or
> >>> filled in your instance (of the subclass).
> >>> If you do not understand my question we can drill further into
this.
> >>>
> >>> 2006/4/17, diana adamatti <[hidden email]>:
> >>>
> >>>
> >>>> Hi,
> >>>> I am trying to implement a web service between SmallTalk (server)
and
> >>>> Java(client).
> >>>> I already did the communication between these two languages, the
> answers
> >>>> to SmallTalk are wrong! In fact, when the client (Java) asks to
the

> >>>> server a specific service, the answer is:
> >>>>
> >>>> SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-
> ENV:Client</faultcode><faultstring>Message
> >>>> not understood: #do:</faultstring><detail><string>a
> >>>> MessageNotUnderstood</string></detail></SOAP-ENV:Fault></SOAP-
> ENV:Body></SOAP-ENV:Envelope>
> >>>>
> >>>>
> >>>>
> >>>> I am working with VisualWorks 7.3 and my web services class
> >>>> (JogoManWebServices) is a subclass of my main class
(JogoMan).Please,
> >>>> see the  picture in annex error.gif.
> >>>> In the subclass, I use some instance variables defined in
superclass.
> >>>> However, when I putted a "self halt" in a method of this
subclass,
> the
> >>>> values of  variables created in superclass are "nil". What am I
doing
> >>>> wrong? Is necessary to create a specific type of variables to use
in
> the
> >>>> subclass?
> >>>>
> >>>> For example, in picture error2.gif in annex, the method
> >>>> "infraEstruturas" uses the superclass variable
"theInfrastructures",
> but
> >>>> in superclass this variable has a set of  values and in subclass,
it

> is
> >>>> nil.
> >>>>
> >>>>
> >>>> Thank you in advance for helping.
> >>>>
> >>>> Best regards,
> >>>> Diana Adamatti
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>
> >>

Reply | Threaded
Open this post in threaded view
|

Re: Web Services doubts

Diana Francisca Adamatti
In reply to this post by Rob Vens
I tried something different: I putted my web services into my super
classe, in a new protocol "web services". Then, there are not more
problems with super and subclasses.

However, when the web service call the service, and it use the class
variables, these variables are nil. (look the picture in annex)

I think the problem is the creation of the web service by WSWizard. I
looked for in WEB about how to create server and client using OpenTalk,
but I only found to WSDL files. Do you have some examples about it? I
will try to create the server inside of my application, without using
the wizard.

Diana





Rob Vens escreveu:

> Diana,
> the method:
>
> rodada
>   ^ rodada
>
> does exactly that: it returns the instance variable. Not it's value.
> Smalltalk almost always works by reference, not by value.
> So any instance variables defined in superclass are, effectively,
> instance variables in your subclass. The object (instance) contains
> these slots because they are inherited from the superclass.
> To set values of instance variable, well in Smalltalk this is
> ***impossible*** to do without politely asking the instance to do so,
> i.e. by sending it a message, like:
>    myInstance rodada: newObject
> And I was referring to methods like this to put a trace into.
>
> 2006/4/19, diana adamatti <[hidden email]>:
>  
>> Hi Rob,
>> my application in WS is a RPG to natural resources. I am using Cormas
>> Simulator to implement it.
>>
>> I would like that my web service pick up the variables values in
>> "execution time". In fact, I want to transform my local RPG to "web
>> RPG", then I created a new interface in Java and I want in each step of
>> my RPG to send and to receive the values of variables to this new interface.
>>
>> I never run my application directly in VW, only in Cormas. Then, I do
>> not know  if is possible to test without Cormas. Do you want my code
>> even so?
>>
>> In my oppinion, when the web server is called, I cannot see the instance
>> variables of JogoMan (super class), and I need these values. The
>> services go to the methods (get values, as:
>> *rodada
>>     ^rodada
>> *  to return the values, not to the instance variables..... Is there a
>> way to pick up the instance variables? Or it is impossible....... :o(((
>>
>> Thanks again.
>>
>> Diana
>>
>>
>>
>>
>> Rob Vens escreveu:
>>    
>>> Diana,
>>> Using self halt can also be replaced with something like this:
>>> Transcript cr; show: rodada printString
>>> This way you can trace the execution of your code. Now, what I would
>>> like to try is to put such a tracing statement in the areas of your
>>> code where instance variable rodada is changed (for example, the set
>>> method rodada: aString).
>>> This way you could try to find out who is nilling out the values.
>>> Another thing that comes to mind is that somehow you are dealing with
>>> another instance of JogoManWebServices, one in which the variables are
>>> not yet initialized. In that case you could try to initialize new
>>> instances with a default value other than nil.
>>> Hope this helps, I am really guessing what may be happening, and maybe
>>> if you are willing, sharing your code will be easier.
>>>
>>> Regards,
>>> Rob Vens
>>>
>>> 2006/4/18, diana adamatti <[hidden email]>:
>>>
>>>      
>>>> Hi Rob!
>>>>
>>>> I think that the real problem is the new instance of webService, that it
>>>> is a subclass of Object, because, when I run my application (JogoMan)
>>>> the instance variables have values, but, when I call the method to
>>>> create the web server, I lose my instance variables. My problem is with
>>>> instance of variables and the use of web services.... :o((((
>>>>
>>>> The method of server and client creation is:
>>>>
>>>> *protocoloSOAP
>>>>     | opentalkServer client arg1 value |
>>>>     opentalkServer := TesteSOAP new.
>>>>     opentalkServer startServers.
>>>>     client := TesteSOAPClient new.
>>>>     client start.
>>>>     value := client numRodada.
>>>>
>>>>
>>>> *numRodada is a method of my web service.  I defined my web service in
>>>> Web Service Wizard.
>>>>
>>>> Please, look the picture error3.gif, where you can see when the client
>>>> tries to pick up the value of "rodada" variable and it is "nil". But,
>>>> look that I am in an instance of "TesteSOAPClient" and my application
>>>> "JogoMan" and its variables and values does not appear.
>>>>
>>>> May be, I need to define the server and the client in another way,
>>>> without the Wizard......
>>>>
>>>> Thanks,
>>>> Diana
>>>>
>>>>
>>>>
>>>> Rob Vens escreveu:
>>>>
>>>>        
>>>>> Scenario:
>>>>> you have superclass DoIt, and subclass DoItBetter.
>>>>> DoIt defines instance variable rememberThis. DoItBetter defines
>>>>> instance variable rememberThisAlso.
>>>>> In class DoIt you can get access to these variables with methods you
>>>>> define in that class.
>>>>> In protocol "accessing" you need to write two methods:
>>>>>
>>>>> rememberThis
>>>>>   " This is the getter method, to retrieve the value,"
>>>>>   ^rememberThis
>>>>>
>>>>> rememberThis: newValue
>>>>>    "This is the setter method, to set the value to the argument, newValue,"
>>>>>    rememberThis := newValue
>>>>>
>>>>> In the subclass you define two methods to get and set the value of the
>>>>> second instance variable (rememberThisAlso), similar to the above but
>>>>> of course naming the variable correctly,
>>>>> Now the important part, of which I am unsure whether you are aware of
>>>>> it. You create an instance of DoItBetter, for example with the code:
>>>>>
>>>>> myInstance := DoItBetter new.
>>>>>
>>>>> You set values for it's instance variables:
>>>>>
>>>>> myInstance rememberThis: 'My superclass variable value'.
>>>>> myInstance rememberThisAlso: 'My own class variable value'.
>>>>>
>>>>> I hope I understood your problem correctly. Because the first line
>>>>> sets the value of the subclass instance, and the value it sets it that
>>>>> defined in the superclass.
>>>>> Now if you want to get the value, you send the subclass instance the
>>>>> method defined in the superclass (and inherited by the subclass), in
>>>>> this way:
>>>>>
>>>>> myInstance rememberThis
>>>>>
>>>>> this will return (as expected) the value: 'My superclass variable value'.
>>>>>
>>>>> If this is still not clear Diana, take the discussion offline, and I
>>>>> will explain. (gone now for bed and am offline myself for the day).
>>>>>
>>>>> 2006/4/17, diana adamatti <[hidden email]>:
>>>>>
>>>>>
>>>>>          
>>>>>> Hi Rob,
>>>>>> I understood your question.  In fact, I need the values of superclass
>>>>>> variables. I tried to use "super variableXX", but it does not work!
>>>>>> Do you have some suggestions?
>>>>>>
>>>>>> Thanks,
>>>>>> Diana
>>>>>>
>>>>>>
>>>>>>
>>>>>> Rob Vens escreveu:
>>>>>>
>>>>>>
>>>>>>            
>>>>>>> Diana,
>>>>>>> Just a question. You are referring to " variables defined in
>>>>>>> superclass". This is ok, but are you sure these variables are filled
>>>>>>> in ***your*** class? A subclass is a subtype, but does not " contain"
>>>>>>> the superclass. Any variables defined in it need to be initialised or
>>>>>>> filled in your instance (of the subclass).
>>>>>>> If you do not understand my question we can drill further into this.
>>>>>>>
>>>>>>> 2006/4/17, diana adamatti <[hidden email]>:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>              
>>>>>>>> Hi,
>>>>>>>> I am trying to implement a web service between SmallTalk (server) and
>>>>>>>> Java(client).
>>>>>>>> I already did the communication between these two languages, the answers
>>>>>>>> to SmallTalk are wrong! In fact, when the client (Java) asks to the
>>>>>>>> server a specific service, the answer is:
>>>>>>>>
>>>>>>>> SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Message
>>>>>>>> not understood: #do:</faultstring><detail><string>a
>>>>>>>> MessageNotUnderstood</string></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> I am working with VisualWorks 7.3 and my web services class
>>>>>>>> (JogoManWebServices) is a subclass of my main class (JogoMan).Please,
>>>>>>>> see the  picture in annex error.gif.
>>>>>>>> In the subclass, I use some instance variables defined in superclass.
>>>>>>>> However, when I putted a "self halt" in a method of this subclass, the
>>>>>>>> values of  variables created in superclass are "nil". What am I doing
>>>>>>>> wrong? Is necessary to create a specific type of variables to use in the
>>>>>>>> subclass?
>>>>>>>>
>>>>>>>> For example, in picture error2.gif in annex, the method
>>>>>>>> "infraEstruturas" uses the superclass variable "theInfrastructures", but
>>>>>>>> in superclass this variable has a set of  values and in subclass, it is
>>>>>>>> nil.
>>>>>>>>
>>>>>>>>
>>>>>>>> Thank you in advance for helping.
>>>>>>>>
>>>>>>>> Best regards,
>>>>>>>> Diana Adamatti
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>                
>>>>
>>>>        
>>
>>    


error4.GIF (34K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Web Services doubts

James Robertson-3
I did a screencast on using the VW WS* client tools awhile back - the demo
uses the Google API.  You can watch it by going here:

http://www.cincomsmalltalk.com/blog/blogView?showComments=true&entry=3304946125



At 10:25 AM 4/19/2006, you wrote:

>I tried something different: I putted my web services into my super
>classe, in a new protocol "web services". Then, there are not more
>problems with super and subclasses.
>
>However, when the web service call the service, and it use the class
>variables, these variables are nil. (look the picture in annex)
>
>I think the problem is the creation of the web service by WSWizard. I
>looked for in WEB about how to create server and client using OpenTalk,
>but I only found to WSDL files. Do you have some examples about it? I will
>try to create the server inside of my application, without using the wizard.
>
>Diana
>
>
>
>
>
>Rob Vens escreveu:
>>Diana,
>>the method:
>>
>>rodada
>>   ^ rodada
>>
>>does exactly that: it returns the instance variable. Not it's value.
>>Smalltalk almost always works by reference, not by value.
>>So any instance variables defined in superclass are, effectively,
>>instance variables in your subclass. The object (instance) contains
>>these slots because they are inherited from the superclass.
>>To set values of instance variable, well in Smalltalk this is
>>***impossible*** to do without politely asking the instance to do so,
>>i.e. by sending it a message, like:
>>    myInstance rodada: newObject
>>And I was referring to methods like this to put a trace into.
>>
>>2006/4/19, diana adamatti <[hidden email]>:
>>
>>>Hi Rob,
>>>my application in WS is a RPG to natural resources. I am using Cormas
>>>Simulator to implement it.
>>>
>>>I would like that my web service pick up the variables values in
>>>"execution time". In fact, I want to transform my local RPG to "web
>>>RPG", then I created a new interface in Java and I want in each step of
>>>my RPG to send and to receive the values of variables to this new interface.
>>>
>>>I never run my application directly in VW, only in Cormas. Then, I do
>>>not know  if is possible to test without Cormas. Do you want my code
>>>even so?
>>>
>>>In my oppinion, when the web server is called, I cannot see the instance
>>>variables of JogoMan (super class), and I need these values. The
>>>services go to the methods (get values, as:
>>>*rodada
>>>     ^rodada
>>>*  to return the values, not to the instance variables..... Is there a
>>>way to pick up the instance variables? Or it is impossible....... :o(((
>>>
>>>Thanks again.
>>>
>>>Diana
>>>
>>>
>>>
>>>
>>>Rob Vens escreveu:
>>>
>>>>Diana,
>>>>Using self halt can also be replaced with something like this:
>>>>Transcript cr; show: rodada printString
>>>>This way you can trace the execution of your code. Now, what I would
>>>>like to try is to put such a tracing statement in the areas of your
>>>>code where instance variable rodada is changed (for example, the set
>>>>method rodada: aString).
>>>>This way you could try to find out who is nilling out the values.
>>>>Another thing that comes to mind is that somehow you are dealing with
>>>>another instance of JogoManWebServices, one in which the variables are
>>>>not yet initialized. In that case you could try to initialize new
>>>>instances with a default value other than nil.
>>>>Hope this helps, I am really guessing what may be happening, and maybe
>>>>if you are willing, sharing your code will be easier.
>>>>
>>>>Regards,
>>>>Rob Vens
>>>>
>>>>2006/4/18, diana adamatti <[hidden email]>:
>>>>
>>>>
>>>>>Hi Rob!
>>>>>
>>>>>I think that the real problem is the new instance of webService, that it
>>>>>is a subclass of Object, because, when I run my application (JogoMan)
>>>>>the instance variables have values, but, when I call the method to
>>>>>create the web server, I lose my instance variables. My problem is with
>>>>>instance of variables and the use of web services.... :o((((
>>>>>
>>>>>The method of server and client creation is:
>>>>>
>>>>>*protocoloSOAP
>>>>>     | opentalkServer client arg1 value |
>>>>>     opentalkServer := TesteSOAP new.
>>>>>     opentalkServer startServers.
>>>>>     client := TesteSOAPClient new.
>>>>>     client start.
>>>>>     value := client numRodada.
>>>>>
>>>>>
>>>>>*numRodada is a method of my web service.  I defined my web service in
>>>>>Web Service Wizard.
>>>>>
>>>>>Please, look the picture error3.gif, where you can see when the client
>>>>>tries to pick up the value of "rodada" variable and it is "nil". But,
>>>>>look that I am in an instance of "TesteSOAPClient" and my application
>>>>>"JogoMan" and its variables and values does not appear.
>>>>>
>>>>>May be, I need to define the server and the client in another way,
>>>>>without the Wizard......
>>>>>
>>>>>Thanks,
>>>>>Diana
>>>>>
>>>>>
>>>>>
>>>>>Rob Vens escreveu:
>>>>>
>>>>>
>>>>>>Scenario:
>>>>>>you have superclass DoIt, and subclass DoItBetter.
>>>>>>DoIt defines instance variable rememberThis. DoItBetter defines
>>>>>>instance variable rememberThisAlso.
>>>>>>In class DoIt you can get access to these variables with methods you
>>>>>>define in that class.
>>>>>>In protocol "accessing" you need to write two methods:
>>>>>>
>>>>>>rememberThis
>>>>>>   " This is the getter method, to retrieve the value,"
>>>>>>   ^rememberThis
>>>>>>
>>>>>>rememberThis: newValue
>>>>>>    "This is the setter method, to set the value to the argument,
>>>>>> newValue,"
>>>>>>    rememberThis := newValue
>>>>>>
>>>>>>In the subclass you define two methods to get and set the value of the
>>>>>>second instance variable (rememberThisAlso), similar to the above but
>>>>>>of course naming the variable correctly,
>>>>>>Now the important part, of which I am unsure whether you are aware of
>>>>>>it. You create an instance of DoItBetter, for example with the code:
>>>>>>
>>>>>>myInstance := DoItBetter new.
>>>>>>
>>>>>>You set values for it's instance variables:
>>>>>>
>>>>>>myInstance rememberThis: 'My superclass variable value'.
>>>>>>myInstance rememberThisAlso: 'My own class variable value'.
>>>>>>
>>>>>>I hope I understood your problem correctly. Because the first line
>>>>>>sets the value of the subclass instance, and the value it sets it that
>>>>>>defined in the superclass.
>>>>>>Now if you want to get the value, you send the subclass instance the
>>>>>>method defined in the superclass (and inherited by the subclass), in
>>>>>>this way:
>>>>>>
>>>>>>myInstance rememberThis
>>>>>>
>>>>>>this will return (as expected) the value: 'My superclass variable value'.
>>>>>>
>>>>>>If this is still not clear Diana, take the discussion offline, and I
>>>>>>will explain. (gone now for bed and am offline myself for the day).
>>>>>>
>>>>>>2006/4/17, diana adamatti <[hidden email]>:
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Hi Rob,
>>>>>>>I understood your question.  In fact, I need the values of superclass
>>>>>>>variables. I tried to use "super variableXX", but it does not work!
>>>>>>>Do you have some suggestions?
>>>>>>>
>>>>>>>Thanks,
>>>>>>>Diana
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>Rob Vens escreveu:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>Diana,
>>>>>>>>Just a question. You are referring to " variables defined in
>>>>>>>>superclass". This is ok, but are you sure these variables are filled
>>>>>>>>in ***your*** class? A subclass is a subtype, but does not " contain"
>>>>>>>>the superclass. Any variables defined in it need to be initialised or
>>>>>>>>filled in your instance (of the subclass).
>>>>>>>>If you do not understand my question we can drill further into this.
>>>>>>>>
>>>>>>>>2006/4/17, diana adamatti <[hidden email]>:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>Hi,
>>>>>>>>>I am trying to implement a web service between SmallTalk (server) and
>>>>>>>>>Java(client).
>>>>>>>>>I already did the communication between these two languages, the
>>>>>>>>>answers
>>>>>>>>>to SmallTalk are wrong! In fact, when the client (Java) asks to the
>>>>>>>>>server a specific service, the answer is:
>>>>>>>>>
>>>>>>>>>SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Message
>>>>>>>>>not understood: #do:</faultstring><detail><string>a
>>>>>>>>>MessageNotUnderstood</string></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>I am working with VisualWorks 7.3 and my web services class
>>>>>>>>>(JogoManWebServices) is a subclass of my main class (JogoMan).Please,
>>>>>>>>>see the  picture in annex error.gif.
>>>>>>>>>In the subclass, I use some instance variables defined in superclass.
>>>>>>>>>However, when I putted a "self halt" in a method of this subclass, the
>>>>>>>>>values of  variables created in superclass are "nil". What am I doing
>>>>>>>>>wrong? Is necessary to create a specific type of variables to use
>>>>>>>>>in the
>>>>>>>>>subclass?
>>>>>>>>>
>>>>>>>>>For example, in picture error2.gif in annex, the method
>>>>>>>>>"infraEstruturas" uses the superclass variable
>>>>>>>>>"theInfrastructures", but
>>>>>>>>>in superclass this variable has a set of  values and in subclass,
>>>>>>>>>it is
>>>>>>>>>nil.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>Thank you in advance for helping.
>>>>>>>>>
>>>>>>>>>Best regards,
>>>>>>>>>Diana Adamatti
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>
>

<Talk Small and Carry a Big Class Library>
James Robertson, Product Manager, Cincom Smalltalk
http://www.cincomsmalltalk.com/blog/blogView