0

IIS にサービスを展開し、そのサービスを defaultwebsite ->Example.SampleService のノードの下に配置しました。その下に、SampleService.svc という SVC ファイルがあります。 SampleService.svc ブラウザは正常に表示されます。プロジェクトがSOAPUIで作成されたことについて述べたのと同じアドレスのwsdlを追加して、SOAP UIでテストしようとしましたが、リクエストを送信すると、次のようなエラーが表示されます: HTTP/1.1 404 Not Found Cache-Control: private Server: Microsoft -IIS/7.5 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Date: Mon, 19 Oct 2015 07:54:36 GMT Content-Length: 0

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>
4

1 に答える 1

0

サービスを SoapUI にインポートするには、WSDL 記述が必要です。取得するには、次のいずれかの URI を使用します: http://localhost/Example.SampleService/SampleService.svc?singleWsdl またはhttp://localhost/Example.SampleService/SampleService.svc?wsdl

メタデータの公開を有効にする前に。

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

あなたのサービスに追加するbehaviorConfiguration="GlobalBehavior"

于 2015-10-19T08:49:58.193 に答える