Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wcf 动态读取wsdl时获取错误数据_Wcf_Wsdl - Fatal编程技术网

Wcf 动态读取wsdl时获取错误数据

Wcf 动态读取wsdl时获取错误数据,wcf,wsdl,Wcf,Wsdl,这是我的WCF WSDL文件 <wsdl:portType name="IMyService"> <wsdl:operation name="add"> <wsdl:input wsaw:Action="http://pcname:9000/WcfService/MyService/IMyService/add" message="tns:IMyService_add_InputMessage"/> <

这是我的WCF WSDL文件

<wsdl:portType name="IMyService">
  <wsdl:operation name="add">
    <wsdl:input wsaw:Action="http://pcname:9000/WcfService/MyService/IMyService/add"
                message="tns:IMyService_add_InputMessage"/>
    <wsdl:output wsaw:Action="http://pcname:9000/WcfService/MyService/IMyService/addResponse" 
                 message="tns:IMyService_add_OutputMessage"/>
  </wsdl:operation>
  <wsdl:operation name="sub">
    <wsdl:input wsaw:Action="http://pcname:9000/WcfService/MyService/IMyService/sub"
                message="tns:IMyService_sub_InputMessage"/>
    <wsdl:output wsaw:Action="http://pcname:9000/WcfService/MyService/IMyService/subResponse" 
                 message="tns:IMyService_sub_OutputMessage"/>
  </wsdl:operation>
</wsdl:portType>
错误:

异常:无法从命名空间http://pcname:9000/WcfService/MyService/导入绑定“BasicHttpBinding_IMyService”

内部例外:{缺少元素“http://pcname:9000/WcfService/MyService/:add”。}


为什么在添加函数之前得到:冒号?

为什么在http://pcname中有空格?在实际代码中是localhost。我是新的堆栈溢出,而张贴的问题,它是给我一些关于该链接的错误,所以我把它改为pcname。
ServiceDescriptionImportWarnings warning = importer.Import(nmspace, unit1);