Я создал веб-сервиса с Apache Camel, используя компонент CXF, как показано ниже:Camel CXF - Безопасность (Authentication)
blueprint.xml:
<bean class="ngtrend.ws.Testws"/>
<!-- Defined the server endpoint to create the cxf-rs consumer -->
<cxf:rsServer id="rsServer" address="http://localhost:9050/route"
serviceClass="ngtrend.ws.Testws" />
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route id="timerToLog">
<from uri="cxfrs://bean://rsServer"/>
<to uri="bean:ngtrend.ws.HelloBean?method=test(Exchange)"/>
<log message="${body}"/>
</route>
</camelContext>
Testws.java:
public class Testws {
@GET
@Path("/test/{id}")
@Produces("application/xml")
//@Consumes("text/xml")
public Integer getAssets(@PathParam("id") int id){
return null;
}
}
и Я бы хотел, чтобы он заставлял клиента отправлять (или вводить в диалоговом окне при использовании браузера) логин и пароль (BASIC Http authentication). Как я могу сделать эту конфигурацию?
не могли бы вы предоставить какой-нибудь белок или ссылку на код. –