如何将数据发送到wcf服务ChanellFactory

时间:2016-12-01 00:34:08

标签: c# asp.net wcf

我正在尝试将数据(我是客户端)从我的Web应用程序发送到wcf服务,我需要使用Channelfactory;从SoapUI我得到以下信息: SoapUI

对象浏览器是VS2015我得到了这个: objectExplorer

我已经制作了一个控制台应用程序来测试这样的连接:

        static void Main(string[] args)
    {
        BasicHttpBinding myBinding = new BasicHttpBinding();
        EndpointAddress myEndpoint = new EndpointAddress("http://10.10.1xxxxxxxxxx4");
        ChannelFactory<SI_Certificados_OutMsg> myChannelFactory = new ChannelFactory<SI_Certificados_OutMsg>(myBinding, myEndpoint);
        var defaultCredentials = myChannelFactory.Endpoint.Behaviors.Find<ClientCredentials>();
        myChannelFactory.Credentials.UserName.UserName = "user";
        myChannelFactory.Credentials.UserName.Password = "123132";

        SI_Certificados_OutMsg serv = myChannelFactory.CreateChannel();
        DT_Certificados_DTO cert = new DT_Certificados_DTO();
        // HERE SUPPOSED TO SEND THE DATA TO BE CONSUMED

        myChannelFactory.Close();
        Console.Read();

    }

我对将数据发送到Nit_proveedor,ciudad等需要做的事情有点困惑......如SoapUI图片所示。

知道DT_Certificados_DTO是reference.cs中显示的部分类,而接口SI_Certificados_OutMsg没有选择发送serv.Tipo_Impuesto,serv.NIT_Proveedor等...

0 个答案:

没有答案