C#WebService设置服务参考问题

我让C#编写Windows窗体程序(Program_1)和一个Web服务(ASMX)项目(项目1)。

计算机B的项目1由Visual Studio直接执行。

当我使用计算机A中的Program_1引用计算机B上的项目1时,计算机B上的Visual Studio将显示以下错误消息:

  

system.web.dll中发生了'System.ArgumentOutOfRangeException类型的异常,但是用户代码未对其进行处理

     

其他信息:在多字节目标代码页中,没有这个Unicode字符可以对应的字符。 (异常发生在HRESULT:0x80070459)

但是奇怪的是:

  1. 我使用Program_1在计算机B上设置服务。计算机B上的项目1正常。

  2. 我使用Program_1在计算机B上设置服务引用。计算机A上的项目1是正常的。

  3. 我在A计算机上使用Program_1来设置服务引用。 A计算机上的项目1正常。

  4. 即,仅来自计算机A的设置服务引用计算机B上的项目1。发生上述错误。

有人知道如何解决这种情况吗?

我的项目1在web.config中的设置如下:

 <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="MyProjectsoap" />
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://127.0.0.1/WebService/MyProject.asmx" binding="basicHttpBinding" bindingConfiguration="MyProjectsoap" contract="WS_MyProject.CIMSoap" name="MyProjectsoap" />
    </client>
  </system.serviceModel>

我的program_1的app.config中的Web服务设置如下:

<system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="MyProjectsoap" maxReceivedMessageSize="2147483647" />
  </basicHttpBinding>
</bindings>
    <client>
          <endpoint address="http://127.0.0.1/WebService/MyProject.asmx" binding="basicHttpBinding"
                bindingConfiguration="MyProjectsoap" contract="WS.MyProject" name="MyProjectsoap" />
    </client>
</system.serviceModel>
jiaozhongling 回答:C#WebService设置服务参考问题

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2930107.html

大家都在问