简体   繁体   English

如何使用 cxf 和 dosgi 创建一个简单的 rest 服务?

[英]How to create a simple rest service with cxf and dosgi?

I try to create a rest-service from cxf-dosgi-project into my own maven-project.我尝试从 cxf-dosgi-project 创建一个休息服务到我自己的 maven-project 中。 I don't understood the complex maven-pom-structure of the dosgi-rest-example at https://github.com/apache/cxf-dosgi/tree/master/samples/rest and are not able to transfer it.不了解 https://github.com/apache/cxf-dosgi/tree/master/samples/rest的 dosgi-rest-example 的复杂 maven-pom-结构,并且无法传输它。 I tried many different dependencies and bundle-options.我尝试了许多不同的依赖项和捆绑选项。

I tried for hours to "copy" the example of https://github.com/apache/cxf-dosgi/tree/master/samples/rest in my own maven project with my own parent-pom.我尝试了几个小时在我自己的 maven 项目中用我自己的 parent-pom “复制” https://github.com/apache/cxf-dosgi/tree/master/samples/rest的示例。 Always trying to copy the needed parts from dependencies, bundle-otions, ... But everytime i get a compiled bundle i get never a running rsa-endpoint.总是试图从依赖项,捆绑包中复制所需的部分,......但是每次我得到一个编译的包时,我永远不会得到一个正在运行的 rsa 端点。

The last test i tried i put at https://www.file-upload.net/download-13781406/circlead-rest-test.zip.html我尝试的最后一个测试是在https://www.file-upload.net/download-13781406/circlead-rest-test.zip.ZFC35FDC70D5FC69D26EZ883A822C7A53

When i run the example at https://github.com/apache/cxf-dosgi/tree/master/samples/rest in karaf it works like charm.当我在 karaf 的https://github.com/apache/cxf-dosgi/tree/master/samples/rest运行示例时,它就像魅力一样。 So my skill is the problem to create my own karaf-rest-example on basis of the cxf-dosgi-rest-example.所以我的技能是在 cxf-dosgi-rest-example 的基础上创建我自己的 karaf-rest-example。 Have you a working example or can you explain to my how to use this example as base of a new rest-service as karaf-bundle?你有一个工作示例,或者你能向我解释如何使用这个示例作为新的休息服务的基础,如 karaf-bundle?

Since a few days there is a new rest-example available with SCR.几天后,SCR 提供了一个新的休息示例。 This works fine.这工作正常。 See https://github.com/apache/karaf/tree/master/examples/karaf-rest-example/karaf-rest-example-scrhttps://github.com/apache/karaf/tree/master/examples/karaf-rest-example/karaf-rest-example-scr

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM