Discussion:
passing parameters by reference
mbertazz
2007-09-18 15:59:28 UTC
Permalink
Hi all,
i've a question about passing parameters by reference and not by
value.
I'm using WS binding to talk with a remote service. I can't change or
ask to change that remote service and it use a "by reference"
approach.
Is there some way to use SCA impl. in this particular case?
I think it's not a useful way to force access to private attribute of
returned object...

I read this sentence in SCA documentation:

"How parameters are always passed by value (and not by reference)
between components, even when the calls are local. This ensures that
the semantics of a call do not change depending on the location of a
component."

I can agree, but can you explain me deeply WHY "passing by reference"
is not supported so i can be more "strong" defending it?

Thank you in advence
M


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "phpsoa" group.
To post to this group, send email to phpsoa-/***@public.gmane.org
To unsubscribe from this group, send email to phpsoa-unsubscribe-/***@public.gmane.org
For more options, visit this group at http://groups.google.co.uk/group/phpsoa?hl=en
-~----------~----~----~----~------~----~------~--~---
Graham Charters
2007-09-19 09:20:29 UTC
Permalink
Hi M,

Passing by-value is what the SCA specifications (see
http://osoa.org/display/Main/Service+Component+Architecture+Specifications)
say should be the calling semantics for remote services. SCA in PHP
treats all services as remote and assumes local by-reference calls
will just be done using the normal features of PHP.

Passing by-value is a good practice for remote service calls because
it helps with decoupling the two environments by not relying on
sharing instance data.

I'm afraid I don't fully understand the scenario you're describing.
Would it be possible for you to post an example WSDL and a description
of what you think needs to be supported?

Regards, Graham.
Post by mbertazz
Hi all,
i've a question about passing parameters by reference and not by
value.
I'm using WS binding to talk with a remote service. I can't change or
ask to change that remote service and it use a "by reference"
approach.
Is there some way to use SCA impl. in this particular case?
I think it's not a useful way to force access to private attribute of
returned object...
"How parameters are always passed by value (and not by reference)
between components, even when the calls are local. This ensures that
the semantics of a call do not change depending on the location of a
component."
I can agree, but can you explain me deeply WHY "passing by reference"
is not supported so i can be more "strong" defending it?
Thank you in advence
M
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "phpsoa" group.
To post to this group, send email to phpsoa-/***@public.gmane.org
To unsubscribe from this group, send email to phpsoa-unsubscribe-/***@public.gmane.org
For more options, visit this group at http://groups.google.co.uk/group/phpsoa?hl=en
-~----------~----~----~----~------~----~------~--~---
mbertazz
2007-09-21 07:18:29 UTC
Permalink
Dear Graham,
thank yuo for your answer.
I'm attaching the wsdl file.

As you can see there are "in/out" paramenters.
When i make a call i can't access the result because it's private.

Thank you in advance,
Matteo


<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions name="XXXXX_WSA" targetNamespace="http://
YYY.YYY.YYY.YYY:YYYY/XXXXX_WS/XXXXX_WSAImpl"
xmlns:tnsi="http://YYY.YYY.YYY.YYY:YYYY/XXXXX_WS/XXXXX_WSAImpl"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tnsa="http://YYY.YYY.YYY.YYY:YYYY/XXXXX_WS/XXXXX_WSA">
<wsdl:import namespace="http://YYY.YYY.YYY.YYY:YYYY/XXXXX_WS/
XXXXX_WSA"
location="http://YYY.YYY.YYY.YYY:YYYY/XXXXX_WS/
XXXXX_WSA.wsdl"/>
<wsdl:binding name="XXXXX_WS/
n_xxxxx_ws_winsession_adapterServiceBinding" type="tnsa:XXXXX_WS/
n_xxxxx_ws_winsession_adapterServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="rpc"/>
<wsdl:operation name="fn_dologin">
<wsdl:input name="fn_dologinInput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:input>
<wsdl:output name="fn_dologinOutput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:output>
<soap:operation soapAction="XXXXX_WS/
n_xxxxx_ws_winsession_adapter.fn_dologin return,int,return
in,java.lang.String,as_username in,java.lang.String,as_password
inout,org.omg.CORBA.StringHolder,as_sessionid" style="rpc"/>
</wsdl:operation>
<wsdl:operation name="fn_dologout">
<wsdl:input name="fn_dologoutInput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:input>
<wsdl:output name="fn_dologoutOutput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:output>
<soap:operation soapAction="XXXXX_WS/
n_xxxxx_ws_winsession_adapter.fn_dologout return,int,return
in,java.lang.String,as_sessionid" style="rpc"/>
</wsdl:operation>
<wsdl:operation name="fn_retrieve_xml">
<wsdl:input name="fn_retrieve_xmlInput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:input>
<wsdl:output name="fn_retrieve_xmlOutput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:output>
<soap:operation soapAction="XXXXX_WS/
n_xxxxx_ws_winsession_adapter.fn_retrieve_xml return,int,return
in,java.lang.String,as_sessionid in,java.lang.String,as_retrieve
in,java.lang.String,as_params inout,org.omg.CORBA.StringHolder,as_xml"
style="rpc"/>
</wsdl:operation>
<wsdl:operation name="fn_retrieve_xml_l">
<wsdl:input name="fn_retrieve_xml_lInput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:input>
<wsdl:output name="fn_retrieve_xml_lOutput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:output>
<soap:operation soapAction="XXXXX_WS/
n_xxxxx_ws_winsession_adapter.fn_retrieve_xml_l return,int,return
in,java.lang.String,as_username in,java.lang.String,as_password
in,java.lang.String,as_retrieve in,java.lang.String,as_params
inout,org.omg.CORBA.StringHolder,as_xml" style="rpc"/>
</wsdl:operation>
<wsdl:operation name="fn_retrieve_xml_lx">
<wsdl:input name="fn_retrieve_xml_lxInput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:input>
<wsdl:output name="fn_retrieve_xml_lxOutput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:output>
<soap:operation soapAction="XXXXX_WS/
n_xxxxx_ws_winsession_adapter.fn_retrieve_xml_lx return,int,return
in,java.lang.String,as_username in,java.lang.String,as_password
in,java.lang.String,as_xml_in
inout,org.omg.CORBA.StringHolder,as_xml_out" style="rpc"/>
</wsdl:operation>
<wsdl:operation name="fn_retrieve_xml_p">
<wsdl:input name="fn_retrieve_xml_pInput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:input>
<wsdl:output name="fn_retrieve_xml_pOutput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:output>
<soap:operation soapAction="XXXXX_WS/
n_xxxxx_ws_winsession_adapter.fn_retrieve_xml_p return,int,return
in,java.lang.String,as_retrieve in,java.lang.String,as_params
inout,org.omg.CORBA.StringHolder,as_xml" style="rpc"/>
</wsdl:operation>
<wsdl:operation name="fn_retrieve_xml_px">
<wsdl:input name="fn_retrieve_xml_pxInput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:input>
<wsdl:output name="fn_retrieve_xml_pxOutput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:output>
<soap:operation soapAction="XXXXX_WS/
n_xxxxx_ws_winsession_adapter.fn_retrieve_xml_px return,int,return
in,java.lang.String,as_xml_in
inout,org.omg.CORBA.StringHolder,as_xml_out" style="rpc"/>
</wsdl:operation>
<wsdl:operation name="fn_retrieve_xml_x">
<wsdl:input name="fn_retrieve_xml_xInput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:input>
<wsdl:output name="fn_retrieve_xml_xOutput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:output>
<soap:operation soapAction="XXXXX_WS/
n_xxxxx_ws_winsession_adapter.fn_retrieve_xml_x return,int,return
in,java.lang.String,as_sessionid in,java.lang.String,as_xml_in
inout,org.omg.CORBA.StringHolder,as_xml_out" style="rpc"/>
</wsdl:operation>
<wsdl:operation name="fp_log">
<wsdl:input name="fp_logInput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:input>
<wsdl:output name="fp_logOutput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:output>
<soap:operation soapAction="XXXXX_WS/
n_xxxxx_ws_winsession_adapter.fp_log return,void,return
in,java.lang.String,as_nm_calling in,java.lang.String,as_msg"
style="rpc"/>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="XXXXX_WS/
n_xxxxx_ws_winsession_adapterService">
<wsdl:port name="XXXXX_WS/
n_xxxxx_ws_winsession_adapterServicePort8" binding="tnsi:XXXXX_WS/
n_xxxxx_ws_winsession_adapterServiceBinding">
<soap:address location="http://YYY.YYY.YYY.YYY:YYYY/
WEBSERVICES/SOAP"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Hi M,
Passing by-value is what the SCA specifications (seehttp://osoa.org/display/Main/Service+Component+Architecture+Specifica...)
say should be the calling semantics for remote services. SCA in PHP
treats all services as remote and assumes local by-reference calls
will just be done using the normal features of PHP.
Passing by-value is a good practice for remote service calls because
it helps with decoupling the two environments by not relying on
sharing instance data.
I'm afraid I don't fully understand the scenario you're describing.
Would it be possible for you to post an example WSDL and a description
of what you think needs to be supported?
Regards, Graham.
Post by mbertazz
Hi all,
i've a question about passing parameters by reference and not by
value.
I'm using WS binding to talk with a remote service. I can't change or
ask to change that remote service and it use a "by reference"
approach.
Is there some way to use SCA impl. in this particular case?
I think it's not a useful way to force access to private attribute of
returned object...
"How parameters are always passed by value (and not by reference)
between components, even when the calls are local. This ensures that
the semantics of a call do not change depending on the location of a
component."
I can agree, but can you explain me deeply WHY "passing by reference"
is not supported so i can be more "strong" defending it?
Thank you in advence
M
simonslaws-gM/Ye1E23mwN+
2007-09-21 14:54:23 UTC
Permalink
Post by mbertazz
Dear Graham,
thank yuo for your answer.
I'm attaching the wsdl file.
As you can see there are "in/out" paramenters.
When i make a call i can't access the result because it's private.
Thank you in advance,
Matteo
<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions name="XXXXX_WSA" targetNamespace="http://
YYY.YYY.YYY.YYY:YYYY/XXXXX_WS/XXXXX_WSAImpl"
xmlns:tnsi="http://YYY.YYY.YYY.YYY:YYYY/XXXXX_WS/XXXXX_WSAImpl"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tnsa="http://YYY.YYY.YYY.YYY:YYYY/XXXXX_WS/XXXXX_WSA">
<wsdl:import namespace="http://YYY.YYY.YYY.YYY:YYYY/XXXXX_WS/
XXXXX_WSA"
location="http://YYY.YYY.YYY.YYY:YYYY/XXXXX_WS/
XXXXX_WSA.wsdl"/>
<wsdl:binding name="XXXXX_WS/
n_xxxxx_ws_winsession_adapterServiceBinding" type="tnsa:XXXXX_WS/
n_xxxxx_ws_winsession_adapterServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="rpc"/>
<wsdl:operation name="fn_dologin">
<wsdl:input name="fn_dologinInput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:input>
<wsdl:output name="fn_dologinOutput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:output>
<soap:operation soapAction="XXXXX_WS/
n_xxxxx_ws_winsession_adapter.fn_dologin return,int,return
in,java.lang.String,as_username in,java.lang.String,as_password
inout,org.omg.CORBA.StringHolder,as_sessionid" style="rpc"/>
</wsdl:operation>
<wsdl:operation name="fn_dologout">
<wsdl:input name="fn_dologoutInput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:input>
<wsdl:output name="fn_dologoutOutput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:output>
<soap:operation soapAction="XXXXX_WS/
n_xxxxx_ws_winsession_adapter.fn_dologout return,int,return
in,java.lang.String,as_sessionid" style="rpc"/>
</wsdl:operation>
<wsdl:operation name="fn_retrieve_xml">
<wsdl:input name="fn_retrieve_xmlInput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:input>
<wsdl:output name="fn_retrieve_xmlOutput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:output>
<soap:operation soapAction="XXXXX_WS/
n_xxxxx_ws_winsession_adapter.fn_retrieve_xml return,int,return
in,java.lang.String,as_sessionid in,java.lang.String,as_retrieve
in,java.lang.String,as_params inout,org.omg.CORBA.StringHolder,as_xml"
style="rpc"/>
</wsdl:operation>
<wsdl:operation name="fn_retrieve_xml_l">
<wsdl:input name="fn_retrieve_xml_lInput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:input>
<wsdl:output name="fn_retrieve_xml_lOutput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:output>
<soap:operation soapAction="XXXXX_WS/
n_xxxxx_ws_winsession_adapter.fn_retrieve_xml_l return,int,return
in,java.lang.String,as_username in,java.lang.String,as_password
in,java.lang.String,as_retrieve in,java.lang.String,as_params
inout,org.omg.CORBA.StringHolder,as_xml" style="rpc"/>
</wsdl:operation>
<wsdl:operation name="fn_retrieve_xml_lx">
<wsdl:input name="fn_retrieve_xml_lxInput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:input>
<wsdl:output name="fn_retrieve_xml_lxOutput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:output>
<soap:operation soapAction="XXXXX_WS/
n_xxxxx_ws_winsession_adapter.fn_retrieve_xml_lx return,int,return
in,java.lang.String,as_username in,java.lang.String,as_password
in,java.lang.String,as_xml_in
inout,org.omg.CORBA.StringHolder,as_xml_out" style="rpc"/>
</wsdl:operation>
<wsdl:operation name="fn_retrieve_xml_p">
<wsdl:input name="fn_retrieve_xml_pInput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:input>
<wsdl:output name="fn_retrieve_xml_pOutput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:output>
<soap:operation soapAction="XXXXX_WS/
n_xxxxx_ws_winsession_adapter.fn_retrieve_xml_p return,int,return
in,java.lang.String,as_retrieve in,java.lang.String,as_params
inout,org.omg.CORBA.StringHolder,as_xml" style="rpc"/>
</wsdl:operation>
<wsdl:operation name="fn_retrieve_xml_px">
<wsdl:input name="fn_retrieve_xml_pxInput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:input>
<wsdl:output name="fn_retrieve_xml_pxOutput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:output>
<soap:operation soapAction="XXXXX_WS/
n_xxxxx_ws_winsession_adapter.fn_retrieve_xml_px return,int,return
in,java.lang.String,as_xml_in
inout,org.omg.CORBA.StringHolder,as_xml_out" style="rpc"/>
</wsdl:operation>
<wsdl:operation name="fn_retrieve_xml_x">
<wsdl:input name="fn_retrieve_xml_xInput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:input>
<wsdl:output name="fn_retrieve_xml_xOutput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:output>
<soap:operation soapAction="XXXXX_WS/
n_xxxxx_ws_winsession_adapter.fn_retrieve_xml_x return,int,return
in,java.lang.String,as_sessionid in,java.lang.String,as_xml_in
inout,org.omg.CORBA.StringHolder,as_xml_out" style="rpc"/>
</wsdl:operation>
<wsdl:operation name="fp_log">
<wsdl:input name="fp_logInput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:input>
<wsdl:output name="fp_logOutput">
<soap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" use="encoded"/>
</wsdl:output>
<soap:operation soapAction="XXXXX_WS/
n_xxxxx_ws_winsession_adapter.fp_log return,void,return
in,java.lang.String,as_nm_calling in,java.lang.String,as_msg"
style="rpc"/>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="XXXXX_WS/
n_xxxxx_ws_winsession_adapterService">
<wsdl:port name="XXXXX_WS/
n_xxxxx_ws_winsession_adapterServicePort8" binding="tnsi:XXXXX_WS/
n_xxxxx_ws_winsession_adapterServiceBinding">
<soap:address location="http://YYY.YYY.YYY.YYY:YYYY/
WEBSERVICES/SOAP"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Hi M,
Passing by-value is what the SCA specifications (seehttp://osoa.org/display/Main/Service+Component+Architecture+Specifica...)
say should be the calling semantics for remote services. SCA in PHP
treats all services as remote and assumes local by-reference calls
will just be done using the normal features of PHP.
Passing by-value is a good practice for remote service calls because
it helps with decoupling the two environments by not relying on
sharing instance data.
I'm afraid I don't fully understand the scenario you're describing.
Would it be possible for you to post an example WSDL and a description
of what you think needs to be supported?
Regards, Graham.
Post by mbertazz
Hi all,
i've a question about passing parameters by reference and not by
value.
I'm using WS binding to talk with a remote service. I can't change or
ask to change that remote service and it use a "by reference"
approach.
Is there some way to use SCA impl. in this particular case?
I think it's not a useful way to force access to private attribute of
returned object...
"How parameters are always passed by value (and not by reference)
between components, even when the calls are local. This ensures that
the semantics of a call do not change depending on the location of a
component."
I can agree, but can you explain me deeply WHY "passing by reference"
is not supported so i can be more "strong" defending it?
Thank you in advence
M
Hi Matteo

Am just jumping in here as this looks interesting. A couple more
questions I'm afraid....

1/ Does this WSDL work with the PHP SOAP extension? I.e. forgetting
SCA can you send the message/receive the response you need from PHP. I
ask this as SCA uses the PHP SOAP extension under the covers so what
works there should work for us. This lead onto the next question

2/ What are you expecting from the "by reference" approach you talk
about in you first post. I note that there is some CORBA stuff going
on here so are the "refereces" here reference to some remote service?

3/ Following on from 2/ what are the implications of the extra SOAP
Action information. Is there anything in there are you are expecting
the SOAP infrastructure to take account of. For example, I note that
this is where the "inout" phrase that you mention comes up.

Regards

Simon

Loading...