我在项目中收到有关app.config文件的警告,因为我将服务引用升级为具有不同方法和配置的较新版本。有没有办法,我可以生成一个新的app.config文件,而不必更改其所有绑定和端点,因为这将非常耗费精力。必须有一种我猜的方式。
这是我的app.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Uncomment the below section to write to the Application Event Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<add name="FileLog"
type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="Apsis Newsletter Pro v3 APISoap" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
<customBinding>
<binding name="Apsis Newsletter Pro v3 APISoap12">
<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
messageVersion="Soap12" writeEncoding="utf-8">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</textMessageEncoding>
<httpTransport manualAddressing="false" maxBufferPoolSize="524288"
maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous"
realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
useDefaultWebProxy="true" />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://api.anpdm.com/ExternalAPIService.asmx"
binding="basicHttpBinding" bindingConfiguration="Apsis Newsletter Pro v3 APISoap"
contract="Apsis5.ApsisNewsletterProv3APISoap" name="Apsis Newsletter Pro v3 APISoap" />
<endpoint address="http://api.anpdm.com/ExternalAPIService.asmx"
binding="customBinding" bindingConfiguration="Apsis Newsletter Pro v3 APISoap12"
contract="Apsis5.ApsisNewsletterProv3APISoap" name="Apsis Newsletter Pro v3 APISoap12" />
</client>
</system.serviceModel>
</configuration>
这些是警告:
警告1 :自定义工具警告:无法导入wsdl:portType 详细信息:运行WSDL导入扩展时抛出异常:System.ServiceModel.Description.XmlSerializerMessageContractImporter 错误:引用类型“http://schemas.xmlsoap.org/soap/encoding/:Array”仅对编码的SOAP有效。 XPath到错误源://wsdl:definitions[@targetNamespace='http://api.anpdm.com/']/wsdl:portType[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_APIHttpGet'] C:\ Users \ Pedram \ Desktop \ Apsis5( Avanza)\ Apsis5 \服务参考\ Apsis5 \ Reference.svcmap 1 1 Apsis5
警告2 自定义工具警告:无法导入wsdl:binding 详细信息:导入wsdl:binding依赖的wsdl:portType时出错。 XPath to wsdl:portType://wsdl:definitionf [:targetNamespace ='http://api.anpdm.com/']/wsdl:portType [@ name ='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_APIHttpGet'] XPath到错误源://wsdl:definitions[@targetNamespace='http://api.anpdm.com/']/wsdl:binding[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_APIHttpGet'] C:\ Users \ Pedram \ Desktop \ Apsis5( Avanza)\ Apsis5 \服务参考\ Apsis5 \ Reference.svcmap 1 1 Apsis5
警告3 自定义工具警告:无法导入wsdl:port 详细信息:导入wsdl:port依赖的wsdl:binding时出错。 XPath to wsdl:binding://wsdl:definitionf [@targetNamespace ='http://api.anpdm.com/']/wsdl:binding[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_APIHttpGet'] XPath到错误源://wsdl:definitions[@targetNamespace='http://api.anpdm.com/']/wsdl:service[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_API']/wsdl:port[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_APIHttpGet' ] C:\ Users \ Pedram \ Desktop \ Apsis5(Avanza)\ Apsis5 \ Service References \ Apsis5 \ Reference.svcmap 1 1 Apsis5
警告4 自定义工具警告:无法导入wsdl:portType 详细信息:运行WSDL导入扩展时抛出异常:System.ServiceModel.Description.XmlSerializerMessageContractImporter 错误:引用类型“http://schemas.xmlsoap.org/soap/encoding/:Array”仅对编码的SOAP有效。 XPath到错误源://wsdl:definitions[@targetNamespace='http://api.anpdm.com/']/wsdl:portType[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_APIHttpPost'] C:\ Users \ Pedram \ Desktop \ Apsis5( Avanza)\ Apsis5 \服务参考\ Apsis5 \ Reference.svcmap 1 1 Apsis5
警告5 自定义工具警告:无法导入wsdl:binding 详细信息:导入wsdl:binding依赖的wsdl:portType时出错。 XPath到wsdl:portType://wsdl:definition [@targetNamespace ='http://api.anpdm.com/']/wsdl:portType [@ name ='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_APIHttpPost'] XPath到错误源://wsdl:definitions[@targetNamespace='http://api.anpdm.com/']/wsdl:binding[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_APIHttpPost'] C:\ Users \ Pedram \ Desktop \ Apsis5( Avanza)\ Apsis5 \服务参考\ Apsis5 \ Reference.svcmap 1 1 Apsis5
警告6 自定义工具警告:无法导入wsdl:port 详细信息:导入wsdl:port依赖的wsdl:binding时出错。 XPath to wsdl:binding://wsdl:definitionf [@targetNamespace ='http://api.anpdm.com/']/wsdl:binding[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_APIHttpPost'] XPath到错误源://wsdl:definitions[@targetNamespace='http://api.anpdm.com/']/wsdl:service[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_API']/wsdl:port[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_APIHttpPost' ] C:\ Users \ Pedram \ Desktop \ Apsis5(Avanza)\ Apsis5 \ Service References \ Apsis5 \ Reference.svcmap 1 1 Apsis5
答案 0 :(得分:0)
我没有找到根本问题,但我尝试将我的服务添加为网络参考,一切都开始有效。