Re: WCF client using S#

30 views
Skip to first unread message

piter....@gmail.com

unread,
Aug 2, 2012, 3:39:14 PM8/2/12
to ssh...@googlegroups.com
Hello,

 When you use "out" in S#, that means value will be assigned back to S# variable.
 Reference you have provided in Context.SetItem will not be updated.

 You should retrieve values back from Context after execution. Use Context.GetItem("ResList").

 However I would discourage you from using "out" and "ref" parameters in scripts to avoid confusion. Instead let function return an object composited of all output values.

Regards,

On Wednesday, August 1, 2012 4:18:38 PM UTC+2, ssharpsupporter wrote:
Hi all,
 
It' 'possible to call a WCF service using S #?
 
I did a test, a very small application console, I've created the proxy and made ​​a classical call (http).
Then I tried to invoke the same method  via S # but:
 
  •  the call is executed on the server BUT return parameters are NULL ...
 
not just complex datatype (needs to be serialized) but even the basic ones, ...such as strings, etc. .....
 
What do you think....it's possible??? I forgot or I did something wrong?
 
Thanks in advance
Flavio
 
<div class="code">
Script&nbsp;s1&nbsp;=&nbsp;Script.Compile(@<span class="String">"<br />
& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ver&nbsp;=&nbsp;PX.GetVersion(out&nbsp;err);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;ver;<br />
& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"</span>);<br />
& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s1.Context.SetItem(<span class="String">"PX"</span>,&nbsp;myProxy);<br />
& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s1.Context.SetItem(<span class="String">"err"</span>,&nbsp;err);<br />
& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s1.Context.SetItem(<span class="String">"ver"</span>,&nbsp;stringVersion);<br />
& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s1.Execute();<br />
< br />
< br />
< br />
[ServiceContract(Namespace&nbsp;=&nbsp;@<span class="String">"http://www.mynamespace.it"</span>)]<br />
& nbsp;&nbsp;<span class="Modifier">public</span>&nbsp;<span class="ReferenceType">interface</span>&nbsp;IContract&nbsp;<br />
& nbsp;&nbsp;{<br />
& nbsp;&nbsp;&nbsp;&nbsp;[OperationContract]<br />
& nbsp;&nbsp;&nbsp;&nbsp;<span class="ReferenceType">string</span>&nbsp;GetVersion(<span class="MethodParameter">out</span>&nbsp;<span class="ReferenceType">string</span>&nbsp;err);<br />
....
< /div>
 
Reply all
Reply to author
Forward
0 new messages