//–
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.36315
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//–
namespace PrintClient.PrintSrvRef {
[System.CodeDom.Compiler.GeneratedCodeAttribute(“System.ServiceModel”, “4.0.0.0”)]
[System.ServiceModel.ServiceContractAttribute(ConfigurationName=”PrintSrvRef.IPrintTask”)]
public interface IPrintTask {
[System.ServiceModel.OperationContractAttribute(Action=”http://tempuri.org/IPrintTask/GetTemplates”, ReplyAction=”http://tempuri.org/IPrintTask/GetTemplatesResponse”)]
PrintControl.Model.tb_FoldedHandTemplate[] GetTemplates();
[System.ServiceModel.OperationContractAttribute(Action=”http://tempuri.org/IPrintTask/GetPrints”, ReplyAction=”http://tempuri.org/IPrintTask/GetPrintsResponse”)]
PrintControl.Model.PrintTemplate[] GetPrints();
[System.ServiceModel.OperationContractAttribute(Action=”http://tempuri.org/IPrintTask/SubmitFile”, ReplyAction=”http://tempuri.org/IPrintTask/SubmitFileResponse”)]
int SubmitFile(string filename, PrintControl.Model.PrintTemplate ptTpl, PrintControl.Model.tb_FoldedHandTemplate fhTpl, int cpy);
}
[System.CodeDom.Compiler.GeneratedCodeAttribute(“System.ServiceModel”, “4.0.0.0”)]
public interface IPrintTaskChannel : PrintClient.PrintSrvRef.IPrintTask, System.ServiceModel.IClientChannel {
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute(“System.ServiceModel”, “4.0.0.0”)]
public partial class PrintTaskClient : System.ServiceModel.ClientBase<PrintClient.PrintSrvRef.IPrintTask>, PrintClient.PrintSrvRef.IPrintTask {
public PrintTaskClient() {
}
public PrintTaskClient(string endpointConfigurationName) :
base(endpointConfigurationName) {
}
public PrintTaskClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress) {
}
public PrintTaskClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress) {
}
public PrintTaskClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress) {
}
public PrintControl.Model.tb_FoldedHandTemplate[] GetTemplates() {
return base.Channel.GetTemplates();
}
public PrintControl.Model.PrintTemplate[] GetPrints() {
return base.Channel.GetPrints();
}
public int SubmitFile(string filename, PrintControl.Model.PrintTemplate ptTpl, PrintControl.Model.tb_FoldedHandTemplate fhTpl, int cpy) {
return base.Channel.SubmitFile(filename, ptTpl, fhTpl, cpy);
}
}
}
本人定义了实现类
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PrintClient.PrintSrvRef;
namespace PrintClient
{
class ImplementationClass : IPrintTask
{
public ImplementationClass()
{ }
}
}
本人没接触过这个 啥也不懂 求高手指点实现类里应该怎么写
20
PrintTaskClient : System.ServiceModel.ClientBase
你这个是个WCF的代理类,所以你只要配置正确,那直接new了用就可以了,确认你的服务是WCF服务,假如是WebService服务,最好还是用wsdl的方式生成代理类,原因是ws的soap协议和wcf的httpbinding协议有些差异,有些WS服务通过WCF方式添加引用后,实际使用会有问题
10
20
wsdl.exe /l:cs /out:D:/Service1.cs 你的asmx路径
10
10
30
把生成的代理类,添加到项目中直接用