私は古いIIS 6サーバーでホストする必要があるWCFサービスを持っています。サーバーにはServer1という名前が付いていますが、Webサイトには別名も使用されています。どうやら、サーバーとウェブサイトは異なるIPアドレスを解決します。WSDLでのschemaLocationの変更
だから、WCFサービスパスが
あるしかし、私はXMLが生成さを見たとき、schemaLocation
はとして表示:
<wsdl:types>
<xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="https://server1.subdomain.domain.com/ProjectName/MyService.svc?xsd=xsd0" namespace="http://tempuri.org/" />
<xsd:import schemaLocation="https://server1.subdomain.domain.com/ProjectName/MyService.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/ProjectName" />
<xsd:import schemaLocation="https://server1.subdomain.domain.com/ProjectName/MyService.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
</xsd:schema>
</wsdl:types>
私はXMLで指定されたスキーマにアクセスしようとした場合
https://server1.subdomain.domain.com/ProjectName/MyService.svc?xsd=xsd0
「ページを表示できません」というエラーが表示され、Chromeのデバッグツールで[ネットワーク]タブを使用するとs、それはコールが中止されたことを示します。私は
https://alias.sys.domain.com/ProjectName/MyService.svc?xsd=xsd0
でスキーマにアクセスしようとした場合でも、その後、私は問題なくそれを得ることができますが、残念ながらこれはサービスで使用されるものではありません。
<serviceMetadata httpGetEnabled="true" httpsGetUrl="https://alias.sys.domain.com/ProjectName/MyService.svc" />
エラーの原因となった:私は.svc
後/mex
を追加することで取り除くことができました
A registration already exists for URI
を、私は私の設定ファイルにhttpsGetURLを追加したことを変更するには
。奇妙なことは、無効な匿名認証のために使用できないので、mex
エンドポイントがないことです。
しかし、追加/mex
は
<endpoint address="web1" binding="webHttpBinding" bindingConfiguration="webBinding" contract="Projectname.IMyService"/>
に
<endpoint address="" binding="webHttpBinding" bindingConfiguration="webBinding" contract="Projectname.IMyService"/>
からそれを変える、
The message with To ' https://alias.sys.domain.com/ProjectName/MyService.svc/mex?wsdl ' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree.
だから、私は自分のエンドポイントにアドレスを追加した別のエラーの原因となったと
を使用してみましたThe message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None) [/code]
に私のエラーを変え
は誰でも助けることはできますか?
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicHTTP">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows">
</transport>
</security>
</binding>
</basicHttpBinding>
<webHttpBinding>
<binding name="webBinding">
<security mode="Transport">
<transport clientCredentialType="Windows">
</transport>
</security>
</binding>
</webHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="basicBehavior" name="ProjectName.MyService">
<endpoint address="" binding="webHttpBinding" bindingConfiguration="webBinding" contract="Projectname.IMyService"/>
<!--<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />-->
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="basicBehavior">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceCredentials>
<windowsAuthentication includeWindowsGroups="true" allowAnonymousLogons="false">
</windowsAuthentication>
</serviceCredentials>-->
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="false"/>
</system.serviceModel>
、ここインターフェースです:
public interface IMyService
{
[OperationContract]
[WebInvoke(UriTemplate = "GetStatus/{groupID}/{groupName}", Method = "GET",
ResponseFormat = WebMessageFormat.Json,
RequestFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.WrappedRequest)]
string GetStatus(string groupID, string groupName);
}
に
を変更することで問題を解決しましたか –
web.configセクションとインターフェイスを追加しました。本当に助けていただきありがとうございます! – ElenaDBA