WCF SOAP 404 错误
WCF SOAP 404 error
我开发了一个 WCF SOAP Web 服务,出于测试目的我使用 SOAP UI 但我遇到以下问题:
1) 我使用这样的 ip 地址测试 Web 服务:
http://XXX.XXX.XXX.XXX:81/SIDIGE.Web.Service.CanDoc.svc?wsdl
一切正常,我可以毫无问题地使用网络服务
2) 现在,如果我像这样测试 Web 服务(使用主机名):
http://hp_webserver:81/SIDIGE.Web.Service.CanDoc.svc?wsdl
当我向服务器发送 POST 信息时出现 404 错误(如果我使用浏览器并输入有效的地址,则不会出现 404 错误)
我已经阅读了所有关于此的问题,但似乎没有任何效果......有什么想法吗?
我的web.config是:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<add name="servidorRemoto" connectionString="Data Source=XXX\XXX; Initial Catalog=XXX" providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" />
</system.web>
<!-- When deploying the service library project, the content of the config file must be added to the host's
app.config file. System.Configuration does not support config files for libraries. -->
<system.serviceModel>
<services>
<service name="SIDIGE.Web.Service.CanDoc" behaviorConfiguration="ServiceBehavior">
<endpoint address="CanDoc" binding="basicHttpBinding" contract="SIDIGE.Web.IService.ICanDoc" bindingNamespace="http://sidige.com/candoc" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://XXX.XXX.XXX.XXX:81" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="True" />
<useRequestHeadersForMetadataAddress>
<defaultPorts>
<!-- Use your own port numbers -->
<add scheme="http" port="81" />
</defaultPorts>
</useRequestHeadersForMetadataAddress>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.webServer>
<directoryBrowse enabled="false" />
</system.webServer>
</configuration>
问题不在我或配置上。它是测试客户端 (SOAP UI)。代理网络似乎有一些问题。
我开发了一个 WCF SOAP Web 服务,出于测试目的我使用 SOAP UI 但我遇到以下问题:
1) 我使用这样的 ip 地址测试 Web 服务:
http://XXX.XXX.XXX.XXX:81/SIDIGE.Web.Service.CanDoc.svc?wsdl
一切正常,我可以毫无问题地使用网络服务
2) 现在,如果我像这样测试 Web 服务(使用主机名):
http://hp_webserver:81/SIDIGE.Web.Service.CanDoc.svc?wsdl
当我向服务器发送 POST 信息时出现 404 错误(如果我使用浏览器并输入有效的地址,则不会出现 404 错误)
我已经阅读了所有关于此的问题,但似乎没有任何效果......有什么想法吗?
我的web.config是:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<add name="servidorRemoto" connectionString="Data Source=XXX\XXX; Initial Catalog=XXX" providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" />
</system.web>
<!-- When deploying the service library project, the content of the config file must be added to the host's
app.config file. System.Configuration does not support config files for libraries. -->
<system.serviceModel>
<services>
<service name="SIDIGE.Web.Service.CanDoc" behaviorConfiguration="ServiceBehavior">
<endpoint address="CanDoc" binding="basicHttpBinding" contract="SIDIGE.Web.IService.ICanDoc" bindingNamespace="http://sidige.com/candoc" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://XXX.XXX.XXX.XXX:81" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="True" />
<useRequestHeadersForMetadataAddress>
<defaultPorts>
<!-- Use your own port numbers -->
<add scheme="http" port="81" />
</defaultPorts>
</useRequestHeadersForMetadataAddress>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.webServer>
<directoryBrowse enabled="false" />
</system.webServer>
</configuration>
问题不在我或配置上。它是测试客户端 (SOAP UI)。代理网络似乎有一些问题。