为什么引用webservice后配置文件中生成的两个endpoint

诗和远方C 2019-08-12 05:52:46
为什么会生成2个,要把第二个删除掉才行
...全文
591 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
紫魂一号 2021-04-27
  • 打赏
  • 举报
回复
其实webservice引用有几种方式,除了你这种直接的web引用,还可以通过vs的wsdl.exe生成代理cs文件。然后直接使用它。这种方式更简单。。就跟使用一般的class一样。。。
lzhdim 2020-03-09
  • 打赏
  • 举报
回复
先删除原来的WS配置信息,然后再添加新的WS信息。。。
诗和远方C 2019-08-13
  • 打赏
  • 举报
回复
为啥有2个endpoint,我每次要把第二个endpoint 删除就OK了
诗和远方C 2019-08-13
  • 打赏
  • 举报
回复
添加完了 webservice之后

<?xml version="1.0"?>
<!--
有关如何配置 ASP.NET 应用程序的详细信息,请访问
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<appSettings>
<add key="webpages:Version" value="2.0.0.0"/>
<add key="webpages:Enabled" value="false"/>
<add key="PreserveLoginUrl" value="true"/>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>

</appSettings>
<connectionStrings>

<add name="ConnectionString" connectionString="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.116)(PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=APPDB)));User ID=test01;Password=123456;" providerName="Oracle.DataAccess.Client"/>


<!--Oracle.DataAccess.Client-->
</connectionStrings>


<system.web>
<httpRuntime/>
<compilation debug="true" targetFramework="4.0"/>
<pages controlRenderingCompatibilityVersion="4.0">
<namespaces>
<add namespace="System.Web.Helpers"/>
<add namespace="System.Web.Mvc"/>
<add namespace="System.Web.Mvc.Ajax"/>
<add namespace="System.Web.Mvc.Html"/>
<add namespace="System.Web.Routing"/>
<add namespace="System.Web.WebPages"/>
</namespaces>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit"/>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit"/>
<remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0"/>
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0"/>
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
</handlers>
</system.webServer>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="WebService1Soap" />
</basicHttpBinding>
<customBinding>
<binding name="WebService1Soap12">
<textMessageEncoding messageVersion="Soap12" />
<httpTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://192.168.1.116:8056/WebService1.asmx"
binding="basicHttpBinding" bindingConfiguration="WebService1Soap"
contract="ServiceReference1.WebService1Soap" name="WebService1Soap" />
<endpoint address="http://192.168.1.116:8056/WebService1.asmx"
binding="customBinding" bindingConfiguration="WebService1Soap12"
contract="ServiceReference1.WebService1Soap" name="WebService1Soap12" />
</client>
</system.serviceModel>


</configuration>
诗和远方C 2019-08-13
  • 打赏
  • 举报
回复
没有引用的时候config是这样的

<?xml version="1.0"?>
<!--
有关如何配置 ASP.NET 应用程序的详细信息,请访问
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<appSettings>
<add key="webpages:Version" value="2.0.0.0"/>
<add key="webpages:Enabled" value="false"/>
<add key="PreserveLoginUrl" value="true"/>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>

</appSettings>
<connectionStrings>

<add name="ConnectionString" connectionString="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.116)(PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=APPDB)));User ID=test01;Password=123456;" providerName="Oracle.DataAccess.Client"/>


<!--Oracle.DataAccess.Client-->
</connectionStrings>


<system.web>
<httpRuntime/>
<compilation debug="true" targetFramework="4.0"/>
<pages controlRenderingCompatibilityVersion="4.0">
<namespaces>
<add namespace="System.Web.Helpers"/>
<add namespace="System.Web.Mvc"/>
<add namespace="System.Web.Mvc.Ajax"/>
<add namespace="System.Web.Mvc.Html"/>
<add namespace="System.Web.Routing"/>
<add namespace="System.Web.WebPages"/>
</namespaces>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit"/>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit"/>
<remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0"/>
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0"/>
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
</handlers>
</system.webServer>
<system.serviceModel>
<bindings />
<client />
</system.serviceModel>


</configuration>
XBodhi. 2019-08-13
  • 打赏
  • 举报
回复
你吧 配置文件贴出来,看下 。


endpoint 有 2个可能是正常的有的时候 net.tcp 模式的就有2个。
大鱼> 2019-08-12
  • 打赏
  • 举报
回复
贴个图出来嘛?另外你有没有引用了两次呢?或者说你之前引用过没有删除干净又重新新增了一个引用呢?

12,166

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧