0

CXF を使用して Java と Tomcat をアプリケーション コンテナーとして WSDL を生成しています。wsdl インポートの場所に ssl リンク バージョンが含まれていないという問題があります。次に例を示します。

<wsdl:import location="http://api.test.com/soap_admin?wsdl=AdminApi.wsdl" namespace="http://admin.test.com"></wsdl:import>

あるべきです(場所の値ではなく、名前空間の値を変更する方法を知っています):

<wsdl:import location="https://api.test.com/soap_admin?wsdl=AdminApi.wsdl" namespace="https://admin.test.com"></wsdl:import>

また、SSL認証を実行しているロードバランサーが前面にあり、その背後にある2つの異なるサーバーの1つにリダイレクトされます。WSDL は問題なく取得できますが、一貫性を保つために、場所フィールドに https を含める必要があります。

また、スタック オーバーフローに関する他の多くの問題も見てきましたが、それらはほぼ同じですが、正確なものは何もありません。たとえば、このリンク:

wsdl:import で場所を指定する

しかし、これは WCF スタックで行われ、私が使用しているものではありません。また、私の腸は、単純な CXF または Tomcat 構成の変更を教えてくれます。また、SSL を使用しない開発サーバーの 1 つに展開して https を含めない場合は、その点まで動的であるとよいでしょう。

お知らせ下さい!

4

2 に答える 2

1

Tomcat 7 の server.xml 構成に別のコネクタ ポートを追加することで、これを修正しました。

<Connector port="8081" maxHttpHeaderSize="8192"
maxThreads="300" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" scheme="https" proxyPort="443" proxyName="your.frontend.address" disableUploadTimeout="true" />

また@Donal、私は基本的に、このTomcatに接続する方法の2つのバージョンを定義しています。先ほどリストしたコードは、ロード バランサーを指しています。内部ユーザーには、まだ 8080 コネクタ ポートが定義されています。明らかに、その構成をニーズに合ったものに調整できます。あなたのソリューションは確かに機能しますが、まだかなり未熟な製品があり、常にそれを行う必要はありません。

私は当初、これは CXF の問題だと思っていましたが、Tomcat の設定変更であることが判明しました。

于 2012-05-29T17:50:55.130 に答える
0

I always try to keep local copies of the WSDL documents that I generate source code from, so that my build doesn't fail if a service happens to be transiently down. Yes, this has the down-side of meaning that the service location isn't correct, but that's pretty easy to fix by setting properties on the Server object, just like you'd do for setting a username and password. (Of course, if there were service API changes I'd likely need to change rather a lot of code anyway.) Once you're keeping a local copy, just set <wsdl:import location=… /> to the local path (using a text editor!); the location there won't be used after code generation is done.

Trying to generate source off of a live service is a neat idea, except that it really sucks for most deployments. Make a copy, boost your build reliability, worry less (or at least about other things).

于 2012-05-29T13:03:23.277 に答える