public interface ApasInfoService
{
[OperationContract(Action = "", ReplyAction = "*")]
[XmlSerializerFormat(Style = OperationFormatStyle.Rpc, SupportFaults = true, Use = OperationFormatUse.Encoded)]
getInfoCountNewResponse getInfoCountNew(getInfoCountNewRequest request);
[OperationContract(Action = "", ReplyAction = "*")]
[XmlSerializerFormat(Style = OperationFormatStyle.Rpc, SupportFaults = true, Use = OperationFormatUse.Encoded)]
getInfoListNewResponse getInfoListNew(getInfoListNewRequest request);
[OperationContract(Action = "", ReplyAction = "*")]
[XmlSerializerFormat(Style = OperationFormatStyle.Rpc, SupportFaults = true, Use = OperationFormatUse.Encoded)]
getServiceListNewResponse getServiceListNew(getServiceListNewRequest request);
}
<wsdl:portType name="ApasInfoService">
<wsdl:operation name="getInfoListNew" parameterOrder="deptcode password starttime endtime handlestatesing count times">
<wsdl:input name="getInfoListNewRequest" message="impl:getInfoListNewRequest" />
<wsdl:output name="getInfoListNewResponse" message="impl:getInfoListNewResponse" />
</wsdl:operation>
<wsdl:operation name="getInfoCountNew" parameterOrder="deptcode password">
<wsdl:input name="getInfoCountNewRequest" message="impl:getInfoCountNewRequest" />
<wsdl:output name="getInfoCountNewResponse" message="impl:getInfoCountNewResponse" />
</wsdl:operation>
<wsdl:operation name="getServiceListNew" parameterOrder="deptcode password starttime endtime count times">
<wsdl:input name="getServiceListNewRequest" message="impl:getServiceListNewRequest" />
<wsdl:output name="getServiceListNewResponse" message="impl:getServiceListNewResponse" />
</wsdl:operation>
</wsdl:portType>
ServiceReference1.ApasInfoService aa = new ServiceReference1.ApasInfoService();
提示错误:无法创建抽象类或接口“ServiceReference1.ApasInfoService”的实例
以前调用webservices都是直接实例化后调用方法的,这次那个java开发的说就是这样。
------解决思路----------------------
http://www.cnblogs.com/macroxu-1982/archive/2009/12/23/1630415.html
------解决思路----------------------
不要通过添加引用的方式来调用,你wsdl报文都有了,直接就post报文过去,当然相应的地方得做替换,得到结果是xml反序列化也好,直接操作xml也好随你了
------解决思路----------------------
人家说在c#中可以new一个 interface,你就上csdn来问啊?你对 interface 概念是毫无自信吧。
------解决思路----------------------
这种情况很简单,你请对方来写代码,然后等着“看好戏”。
这种情况其实在一个团队中就真的要追查原因,找到谁的责任造成别人无法工作的,要罚钱。
------解决思路----------------------
这个东西的出发点其实很简单,就是对方用他自己的习惯的、不靠谱的方式和在你的c#是完全错误的interface代码来指导你在c#中该如何编程。遇到这种情况,你可以说明对方从来没有一个在c#中可行的、可操作成功的范例或者操作步骤说明。
你以前是如何产生webservice的客户端代理类的,现在还要使用这种方式。然后遇到了问题,可以迅速把问题归结给对方。
如果你冒然地乱去用一种不靠谱的、自己另写一套xml解析和生成代码、无法在编译时就发现bug的反射方式去操作,那么万一以后再运行时出了错误,你还怎样能在一分钟之内就迅速地把问题归结给对方呢?
先抓住对方给你的错误的代码来说事,先不要想当然地把编程搞得很复杂。先指出地方给你的代码有问题。