は、私は、リバースプロキシの背後にあるWebサービスを持っています。現在、WebサービスをテストするWeb参照を追加しようとすると、wsdlファイルをダウンロードできないというメッセージが表示されます。これは、リクエストが送信されたときにhttps://uat.mywebservice.com/Service/Service.asmxですが、リバースプロキシに当たってwsdlとdiscoファイルをダウンロードすると、http://myservice.comp.com/Service/Service.asmx?wsdlにリンクが変更され、myservice.comp.comが正しいリンクではないためです。リバースプロキシ上の名前空間。何が起こっているのは、soapファイルのヘッダーがuat.mywebservice.comという実際のホスト名ではなく、この名前空間に更新されていることです。これは、フィドラーディスコファイルに不正なアドレスがあることがわかりました。私はwsdl.exeツールを使用してプロキシクラスを作成し、正しいホスト名にそのクラスのすべての不正なリンクを更新して解決しました。
リバースプロキシを使用しているときにアドレスが正しいことを確認できる方法はありますか。
誤った:私は同様の問題を解決するためにやった
<?xml version="1.0" encoding="utf-8" ?>
- <discovery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/disco/">
<contractRef ref="http://mvwebservice.comp.com/Service/Service.asmx?wsdl" docRef="http://mvwebservice.comp.com/Service/Service.asmx" xmlns="http://schemas.xmlsoap.org/disco/scl/" />
<soap address="http://mywebservice.comp.com/Service/Service.asmx" xmlns:q1="http://tempuri.org/" binding="q1:ServiceSoap" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
<soap address="http://mywebservice.comp.com/Service/Service.asmx" xmlns:q2="http://tempuri.org/" binding="q2:ServiceSoap12" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
</discovery>
正しい
<?xml version="1.0" encoding="utf-8" ?>
- <discovery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/disco/">
<contractRef ref="https://uat.mvwebservice.com/Service/Service.asmx?wsdl" docRef="https://uat.mvwebservice.com/Service/Service.asmx" xmlns="http://schemas.xmlsoap.org/disco/scl/" />
<soap address="https://uat.mywebservice.com/Service/Service.asmx" xmlns:q1="http://tempuri.org/" binding="q1:ServiceSoap" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
<soap address="https://uat.mywebservice.com/Service/Service.asmx" xmlns:q2="http://tempuri.org/" binding="q2:ServiceSoap12" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
</discovery>
をweb.configのためにこれを追加します問題はhttp://blog.graffen.dk/post/Accessing-a-NET-Web-Service-located-behind-a-proxy.aspxです。私は既にここで提案されているソリューションを試しています。 .Net環境でうまく動作します。私は異なるプラットフォーム上のクライアントがどのように動作するのかは分かりません – Pinu