-1

Tomcat で Spring-WS と JAXB を使用する既存の SOAP Web サービスを修正しようとしています。変更を加えた新しい WAR ファイルを作成し、Tomcat インストールの下の webapps foder にデプロイしました。

サービスの元の (既存の) メソッドを呼び出す場合、サービスの SOAP 要求と応答は問題ありません。しかし、新しいメソッドでサービスを呼び出すと、サービスが利用できず、見つからないというサービス SOAP 応答が返されます [404]

2011-07-25 12:58:23,365 DEBUG [org.springframework.ws.client.core.WebServiceTemplate] - Opening [org.springframework.ws.transport.http.HttpUrlConnection@12b9f14] to [http://<service URL>]
2011-07-25 12:58:23,521 DEBUG [org.springframework.ws.soap.saaj.support.SaajUtils] - SOAPElement [com.sun.xml.internal.messaging.saaj.soap.ver1_1.Envelope1_1Impl] implements SAAJ 1.3
2011-07-25 12:58:23,552 DEBUG [org.springframework.ws.soap.saaj.support.SaajUtils] - SOAPElement [com.sun.xml.internal.messaging.saaj.soap.ver1_1.Body1_1Impl] implements SAAJ 1.3
2011-07-25 12:58:23,896 DEBUG [org.springframework.ws.client.MessageTracing.sent] - Sent request [<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><ns2:DelRequest xmlns:ns2="http://<changed_address>"><ns2:userId>ncc1@%</ns2:userId><ns2:dateFromMillis>1308956400000</ns2:dateFromMillis><ns2:dateToMillis>1311634800000</ns2:dateToMillis></ns2:DelRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>]
2011-07-25 12:58:25,318 DEBUG [org.springframework.ws.client.core.WebServiceTemplate] - Received error for request [SaajSoapMessage {http://<changed_address>}DelRequest]

2011-07-25 12:58:25,318 エラー [net.msgplugin.controller.DeleteController] - 会話サービスを利用できません: http://、見つかりません [404]、null

プロジェクトを Eclipse にインポートし、プロジェクトのプロパティに次の変更を加えました。

1) プロジェクト ファセットで、「動的 Web モジュール」と「Java」ファセットを確認しました。2) Java EE モジュールの依存関係で、Maven の依存関係を確認しました。

ここで注意すべきことは次の 2 点です。

a) 開発者は Web サービスの開発時に JBoss を使用していましたが、最近、プロジェクトが Tomcat に変更されました。b) プロジェクトには MAVEN フォルダー構造があるため、web.xml ファイルは WebContent/WEB-INF ではなく src/main/webapp/WEB-INF フォルダーにあり、「動的 Web モジュール」ファセットを選択したときに作成されました。

どんな提案でも大歓迎ですか?

ありがとう

================================================== ======================

こんにちは

Not Found [404] エラーを修正できましたが、別のエラーが発生しています。WebServiceTemplate および MessageDispatcher クラスをさらに調査してデバッグすると、コンソールに次の出力が表示されることがわかりました。

DEBUG [org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter] - Accepting incoming [org.springframework.ws.transport.http.HttpServletConnection@11f05a1] to [http://<Service_URL>]

TRACE [org.springframework.ws.server.MessageTracing.received] - Received request [<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><ns2:DelRequest xmlns:ns2="http://<changed_address>"><ns2:userId>ncc1@%</ns2:userId><ns2:dateFromMillis>1309042800000</ns2:dateFromMillis><ns2:dateToMillis>1311721200000</ns2:dateToMillis></ns2:DelRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>]

DEBUG [org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping] - Looking up endpoint for [{<changed_address>}DelRequest]

DEBUG [org.springframework.ws.soap.server.SoapMessageDispatcher] - Endpoint mapping [org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping@6ee035] maps request to endpoint [public final net.org.messagehistory.schema.GetDelResponse net.org.messagehistory.service.endpoint.MessageHistoryEndpoint.delHistory(net.org.messagehistory.schema.GetListRequest) throws javax.xml.datatype.DatatypeConfigurationException]

DEBUG [org.springframework.ws.soap.server.SoapMessageDispatcher] - Testing endpoint adapter [org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter@1a23f67]

DEBUG [org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter] - Unmarshalled payload request to [net.org.messagehistory.schema.DelRequest@c76003]

終了エラー メッセージは、WebServiceTemplate.class 内のメソッドの 1 つから生成されたことがわかった「Argument type Mismatch」です。

誰かがここで何が問題になる可能性があるかを提案できますか?

4

1 に答える 1

0

これをソートすることができました。そのため、誰かが役立つと思われる解決策を共有したかっただけです。

Endpoint メソッドに次の @PayloadRoot(localPart = MESSAGES_TO_DELETE, namespace = MESSAGE_NAMESPACE) の注釈が付けられていることを確認してください。ここで、localpart は schema.xsd のペイロード リクエストと同じです。

ありがとう

于 2011-07-29T09:35:01.213 に答える