2015-10-19 20 views
0

我有一个服务部署在IIS和Defaultwebsite节点下的服务 - > Example.SampleService 下面我有SVC文件名为SampleService.svc 所以,当我浏览它在IE中像http://localhost/Example.SampleService/SampleService.svc brwoser显示它很好。 我试图通过添加具有相同地址的WSDL与SOAP UI测试它提到关于该项目得到了在SOAPUI创建,但是当我提交请求我得到这样的错误: HTTP/1.1 404未找到 的Cache-Control:私人 服务器:Microsoft-IIS/7.5 X-ASPNET-版本:4.0.30319 X供电,通过:ASP.NET 日期:星期一,2015年10月19日7时54分36秒GMT 的Content-Length:0WCF - 基于SOAP UI测试的基址问题

web.confg低于:

<bindings> 
    <wsHttpBinding> 
    <binding name="wsUserName" maxReceivedMessageSize="262144" receiveTimeout="00:10:00" sendTimeout="00:10:00" openTimeout="00:10:00" closeTimeout="00:10:00"> 
     <security mode="Transport"> 
     <!--<message clientCredentialType="UserName" negotiateServiceCredential="false" establishSecurityContext="false" />--> 
     <transport clientCredentialType="None" /> 
     </security> 
    </binding> 
    </wsHttpBinding> 
</bindings> 
<services> 
    <service name="Example.SampleService.SampleService"> 
    <host> 
     <baseAddresses> 
     <add baseAddress="http://localhost/Example.SampleService/" /> 
     </baseAddresses> 
    </host> 
    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsUserName" contract="Example.IVaultService" /> 
    <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /> 
    </service> 
</services> 
<behaviors> 
    <serviceBehaviors> 
    <behavior> 
     <!--To avoid disclosing metadata information, set the values below to false before deployment--> 
     <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/> 
     <!--To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information--> 
     <serviceDebug includeExceptionDetailInFaults="false"/> 
     <serviceCredentials useIdentityConfiguration="true"> 


     </serviceCredentials> 

    </behavior> 
    </serviceBehaviors> 
</behaviors> 
+0

你与WCF测试客户端第一测试(https://msdn.microsoft.com/en-us/library/bb552364.aspx)?这是最明显的方法,在尝试SoapUI之前 – Mimas

回答

0

要导入您的服务为你了SoapUI东东d WSDL描述。 为了得到它使用以下URI之一: http://localhost/Example.SampleService/SampleService.svc?singleWsdlhttp://localhost/Example.SampleService/SampleService.svc?wsdl

之前,你必须启用元数据的发布。

<serviceBehaviors> 
    <behavior name="GlobalBehavior"> 
    <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /> 
    </behavior> 
</serviceBehaviors> 

添加到您的服务behaviorConfiguration="GlobalBehavior"

+0

我能够在SOAPUI中添加WSDL,并且它在生成方法的同时调用SOAP UI,如我的文章中提到的那样表示未找到错误。顺便说一句,我已经定义了服务行为。更新了这篇文章 – user3264937