我的应用程序不起作用,因为我更改了Web服务的URL

时间:2016-09-05 07:38:31

标签: vb.net web-services console certificate

自8月1日以来,Web服务的url发生了变化,应用程序运行正常,使用上一个url,但是使用新的应用程序,该应用程序适用于1个用户,另外2个用户遇到此错误消息:

  

无法为SSL / TLS安全通道建立信任关系   与权威'e-factura.sunat.gob.pe'

我的项目是一个控制台,在其中,我使用证书文件来签署xml文件,证书在服务器上,它没有安装在证书存储区中。此外,要使用Web服务,需要使用wsse:security身份验证。 我的app.config文件就是这个(我确实隐藏了wsse:security凭证):

<?xml version="1.0"?>
<configuration>
<configSections>
</configSections>
<system.diagnostics>
<sources>
<source name="DefaultSource" switchName="DefaultSwitch">
    <listeners>
      <add name="FileLog"/>
    </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"/>
</sharedListeners>
 </system.diagnostics>
  <startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="BillServicePortBinding" 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="Transport">
        <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
    </binding>
    <binding name="secured">
      <security mode="TransportWithMessageCredential">
        <message clientCredentialType="UserName" />
      </security>
    </binding>
  </basicHttpBinding>
</bindings>
<client>
  <endpoint address="https://e-factura.sunat.gob.pe:443/ol-ti-itcpfegem/billService"
      binding="basicHttpBinding" bindingConfiguration="BillServicePortBinding"
      contract="Production.billService" name="BillServicePort" >
    <headers>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
        <wsse:UsernameToken >
          <wsse:Username>XXXXXXXX</wsse:Username>
          <wsse:Password Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'>XXXXXX</wsse:Password>
        </wsse:UsernameToken>
      </wsse:Security>
    </headers>
  </endpoint>
</client>
</system.serviceModel>
</configuration>

我不知道如何解决这个问题,而且,我不能在我的机器上使用网络服务(网络服务用于向税务局发送真实的发票)。 感谢

1 个答案:

答案 0 :(得分:1)

我连接到他们的服务器,我在那里运行Internet Explorer,我将Web服务器的地址添加到可信站点列表中。 然后我问他们每次使用在他们的PC上做同样的事情,到目前为止,我得到了其中一个确认应用程序正在运行的反馈。