简体   繁体   English

WCF SOAP 404错误

[英]WCF SOAP 404 error

I've developed a WCF SOAP Web Service and for testing purposes i use SOAP UI but i have the following problem: 我已经开发了WCF SOAP Web服务,出于测试目的,我使用SOAP UI,但存在以下问题:

1) I test the Web service using the ip adress like this: 1)我使用ip地址测试Web服务,如下所示:

http://XXX.XXX.XXX.XXX:81/SIDIGE.Web.Service.CanDoc.svc?wsdl http://XXX.XXX.XXX.XXX:81/SIDIGE.Web.Service.CanDoc.svc?wsdl

and everything works FINE, I can use the web service without issues 一切正常,我可以毫无问题地使用Web服务

2) Now if I test the Web service like this (using the hostname): 2)现在,如果我像这样测试Web服务(使用主机名):

http://hp_webserver:81/SIDIGE.Web.Service.CanDoc.svc?wsdl HTTP:// hp_webserver:81 / SIDIGE.Web.Service.CanDoc.svc WSDL

I get a 404 error when i POST info to the server (if I use the browser and type the address it works, no 404 error) 我将信息发布到服务器时收到404错误(如果使用浏览器并输入有效的地址,则不会出现404错误)

I've read all questions about this and nothing seems to work....any ideas? 我已经阅读了所有与此相关的问题,似乎没有任何效果。

My web.config is: 我的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> 

The problem wasn't on my part or the configuration. 问题不在于我本人还是配置。 It was the testing client (SOAP UI). 它是测试客户端(SOAP UI)。 It seems it has some issues with proxy networks. 代理网络似乎存在一些问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM