2017-07-20 13 views
1

WS02 APIマネージャを使用してAPIを作成し、独自のJava Restful Serviceをエンドポイントとして追加しました。サービスエンドポイントをテストするとうまくいきました。 enter image description here 私はきちんとAPIに加入したが、それは以下の本文の内容を返します闊歩してAPIを呼び出すとき:wso2 APIマネージャ、swaggerを使用してAPIを呼び出すときにRestfullエンドポイントが見つかりません

<!DOCTYPE html> 
<html> 
<head> 
<title>Apache Tomcat/8.0.45 - Error report</title> 
<style type="text/css"> 
H1 { 
font-family:Tahoma,Arial,sans-serif; 
color:white; 
background-color:#525D76; 
font-size:22px; 
} 
H2 { 
font-family:Tahoma,Arial,sans-serif; 
color:white; 
background-color:#525D76; 
font-size:16px; 
} 
H3 { 
font-family:Tahoma,Arial,sans-serif; 
color:white; 
background-color:#525D76; 
font-size:14px; 
} 
BODY { 
font-family:Tahoma,Arial,sans-serif; 
color:black; 
background-color:white; 
} 
B { 
font-family:Tahoma,Arial,sans-serif; 
color:white; 
background-color:#525D76; 
} 
P { 
font-family:Tahoma,Arial,sans-serif; 
background:white; 
color:black; 
font-size:12px; 
} 
A { 
color : black; 
} 
A.name { 
color : black; 
} 
.line { 
height: 1px; 
background-color: #525D76; 
border: none; 
} 
</style> 
</head> 
<body> 
<h1>HTTP Status 406 - Not Acceptable</h1> 
<div class="line"></div> 
<p><b>type</b> Status report</p> 
<p><b>message</b> <u>Not Acceptable</u></p> 
<p><b>description</b> <u>The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers.</u></p> 
<hr class="line"> 
<h3>Apache Tomcat/8.0.45</h3> 
</body> 
</html> 

アプリケーション/ xmlのメディアタイプが返されることになっています!ここで

は私の闊歩のスクリーンショットはここ

enter image description here

APIを呼び出した後で、私も変更されているブラウザーから直接

enter image description here

をサービスを呼び出すときの応答でありますapplication/jsonへの応答メディアのタイプですが、それでもまだ動作しませんでした。

誰かがこの問題を解決するのに手伝ってください。

答えて

0

問題は、endpointと実際のrequestの両方の末尾にmessage部分があることです。これにより、電話が無効になる

http://localhost:8080/messanger/webapi/messages/messages/ 

無効なURLです。

解決策は簡単です。エンドポイントURLからmessages部分を削除します。

、つまりエンドポイントURLはhttp://localhost:8080/messanger/webapi/

+0

です。ご提案いただきありがとうございます。私はエンドポイントをhttp:// localhost:8080/messenger/webapi /に変更しましたが、私はまだ同じエラーコードを取得しています。 – edwing

+1

ワイヤーログを有効にして、質問をログで更新してください。 http://lakshanigamage.blogspot.com/2015/03/how-to-enable-wire-logs-in-wso2-esbapim.html – Bee

関連する問題