Hi,
I have a small c# WCF web service client code and the counter part the server which works very nice through pipe.
namespace LegacyClient
{
[ServiceContract]
public interface ISpezplaServer
{
[OperationContract]
TPAYLOAD map(TPAYLOAD payin);
}
later on we use that interface declaration and create in two simple steps our pipeProxy to call map(payin) at the server.
String pipeUri = "net.pipe://localhost/"+usersession;
ChannelFactory<ISpezplaServer> pipeFactory =
new ChannelFactory<ISpezplaServer>(
new NetNamedPipeBinding(),
new EndpointAddress( pipeUri + "/map" ));
ISpezplaServer pipeProxy = pipeFactory.CreateChannel();
TPAYLOAD payout = pipeProxy.map(payin);
The equivalent in Oxygene is
type
[ServiceContract]
ISpezplaServer = public interface
// [OperationContract]
method map : TPAYLOAD;
end;
and then in code we use
// build a channel factory and then a pipeProxyServer and call it
var pipeFactory : ChannelFactory<ISpezplaServer> :=
new ChannelFactory<ISpezplaServer>(
new NetNamedPipeBinding(),
new EndpointAddress(
pipeUri + "/map"));
var pipeProxy : ISpezplaServer := pipeFactory.CreateChannel();
var payout : TPAYLOAD := pipeProxy.map();
The code shown compiles error free, but as you can see it is by far not what I want.
- the [OperationContract] attribute can not be added to a method in the interface declaration
- the method declaration in a interface does not allow to also add the signature of parameters.
- the technology behind the scene comes from WCF System.ServiceModel, and System.ServiceModel.Channels, and it allows to create at run-time all the classes to make the pipeProxy go. That is to say: With this technology I do not implement the pipeProxy class / method map myself but let WCF do it! Hence I am unable to add the required input parameters payin as no overload is declared somewhere. That finally leads to the situation that I can not pass any parameters, and yes, our parameter is a complex object structure which needs to be serialized and deserialised on its way to the server, and which works at c#;
Conclusion: I don’t know how to do that with Oxygene what works so well in C#
maybe one of you can help me.
Thanks and regards
Josef
runing what has compiled so far ends in