0

If my camel-context.xml contains this cxf Endpoint, what is the default url when I run CamelMain locally in my development environment?

<cxf:cxfEndpoint id="myService"
                 address="/MyService"
                 serviceClass="com.mycompany.MyServicePort"
                 wsdlURL="schema/MyService.wsdl">
</cxf:cxfEndpoint>

Is it http://localhost:8181/MyService ?

I don't want to specify the server specifically address="http://localhost:8181/MyService, since the application is being deployed to openshift, and it seems to function best with a "relative" endpoint: address=/MyService.

The above configuration works when deployed to openshift, with this sort of endpoint:

http://openshift-test.mycompany.com/openshift-myservice/MyService

So, I would like the same configuration to run locally, but what is the default endpoint? http://localhost:..../.../MyService

vikingsteve
  • 38,481
  • 23
  • 112
  • 156

1 Answers1

0

When running Camel in a webapp, you can use relative address (/MyService) if you use it in together with the CXF servlet

<servlet>
    <servlet-name>CXFServlet</servlet-name>
    <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>CXFServlet</servlet-name>
    <url-pattern>/webservices/*</url-pattern>
</servlet-mapping>

In such case, the resulting endpoint url will be: http://host:port/mywebapp/webservices/MyService

TacheDeChoco
  • 3,683
  • 1
  • 14
  • 17
  • It is not defined. Their values are implicit/dynamic and depend on the host and config of your target web server. If you deploy to a local tomcat listening on port 8080, then it will be http:://localhost:8080; if you deploy on a remote tomcat running on port 8081, http:://remotehostname:8081 – TacheDeChoco Jun 22 '18 at 07:20
  • And if you run via `CamelMain` which refers to the `camel-context.xml` and `RouteDefinition` for the web service, do you know what it will be? – vikingsteve Jun 22 '18 at 07:27
  • Of course not. In such case, it is a standalone application, not running in a web/servlet container. (Look at what I said: "When running Camel in a webapp") – TacheDeChoco Jun 22 '18 at 07:33
  • Thats my question really. Where will the address be when its a standalone application? – vikingsteve Jun 22 '18 at 08:10