TomEE is not generating webservice for #WebService EJB - java

I am trying to run examples provided at TomEE example website : https://tomee.apache.org/examples-trunk/simple-webservice/README.html. But when I start the application with TomEE, I am not able to hit the wsdl URL. It doesn't find the resource. In console also, I can't see the webservice entry.
Can anyone please help with what could be wrong with my approach?

This is a jar? Set packaging to war and deploy the war. Wsdl will be accessible adding ?_wsdl to the logged url during startup.

Related

How to deploy services of different version but same EJB name and context-root on Jboss 7.1?

So i am trying to deploy new version of SOAP service with different version.
In jboss-webservices.xml I have configured url to service as:
<context-root>/services/MyService</context/root>
<port-component>
<ejb-name>MyServiceEJB</ejb-name>
<port-component-uri>v1</port-component-uri>
...
</port-component>
When I try to deploy service v2 with <port-component-uri>v2</port-component-uri> it ends up with duplicate deployment error because of same context root.
So I tried it with <context-root>/services/MyService/v2</context-root> and <port-component-uri>/</port-conponent-uri>. This solution actually works. But the wsdl is at location : https://MyServer.com:8443/services/MyService/v2/?wsdl.
Is there any solution to be the wsdl at https://MyServer.com:8443/services/MyService/v2?wsdl ? Without the "/" before the "?wsdl".
Basically I want to have deployed both versions of application, where both has url https://MyServer.com:8443/services/MyService/v1 and second https://MyServer.com:8443/services/MyService/v2, but without touching the context-root element.
Thanks for any tips.

How to build web.xml for Dropwizard application

I have created application in Dropwizard, which is serving REST API to my clients. I used to run this from .jar file on server, everything worked fine.
Now I have requirement to move my application to WildFly, so now I assume that I need to have a WAR instead of JAR, and here comes my problem:
How to write web.xml to my application? What to include in there? Could anyone give me any template or tutorial or some example how it is done in Dropwizard?
I found what I was looking for. It's wizard-in-a-box project that do all the necessary things to build a WAR file.

An address of a website deployed using Tomcat and Eclipse

I'm trying to run a website using Tomcat and Eclipse. I created a Dynamic Web Project, I configured web.xml file and I also used Maven. In a directory src/main/webapp I put an index.html file. I also made a simple REST service in the same project. So this REST service is working for me (for example, when I put "http://localhost:8080/RESTfulService/rest/item" in an address bar. But what is the address that I should write to get an access to a website I put in a webapp folder? I thought "http://localhost:8080/RESTfulService/" should be working, but it's not.
From what i understand of your setup, try "http://localhost:8080/index.html". Do you have a context path called 'RESTfulService' setup?
Do you have a context element listed in your server.xml? If so, what does it say?

Deploy Axis2 .aar without Axis2 web application

I would like to know if there's a way to deploy an Axis2 .aar file without having to include it as part of the Axis 2 web application.
I know that my question is short, but there isn't much information that I could provide to direct my question.
Yes, there is.
The axis2 web archive (axis2.war) can be extracted once and never has to be extracted again after that.
Following changes within the axis2 webapp directory are common:
You add modules in 'axis2/WEB-INF/modules/'.
You add libraries in 'axis2/WEB-INF/lib/'.
You change the configuration in 'axis2/WEB-INF/conf/axis2.xml' file.
You deploy your services in 'axis2/WEB-INF/services/'.
Also, there's an option for hot deploys in the services directory. In the axis2.xml file, the folowing line enables this:
<parameter name="hotdeployment">true</parameter>
You can also override the default location of services with the following configuration parameter:
<parameter name="ServicesDirectory">service</parameter>
You can, of course, also make symlinks (unix/linux) instead, but I would not recommend polluting your installation with those.
So, to wrap it up, after your initial deploy of the axis2.war file, you do not need to redeploy it, it can stay, and you can deploy your .aar-files in the services directory. If hot deploy is not enabled (default), you need to restart your tomcat server/reload context manually.
I believe you want to deploy an axis2 web service in an existing application, if so, look at this

GWT urls change when deployed to tomcat

Simple question, maybe someone knows:
In GWT devmode, my urls look like this: http://myserver/myapp/myservice
When I run 'ant war' and deploy that war on tomcat, they mysteriously change to: http://myserver/myapp/myapp/myservice
Everything still works, but obviously the URLs are uglier. I'd like to just keep the URLs used in devmode. Any info is appreciated, thanks.
-tjw
Deploy the web service as ROOT.war, not as myapp.war, because the first 'myapp' is the web application context path, and 'myapp/myservice' is the path inside the web application.
Change your mappings in your web.xml to all start with / instead of /myapp/ and deploy your application as myapp.war or deploy the war as Root.war
Ok, I've got a solution for this. So many people are having this problem all over the net, I decided to answer my own question. The key is to use #RemoteServiceRelativePath in your RemoteService interface file. For example, to solve my original problem, I would annotate my RemoteService interface like this:
#RemoteServiceRelativePath("../myservice")
This way, whatever path is in front of the service's URL is irrelevant. Now in the web.xml, instead of using /myapp/myservice as the url-pattern, I just use /myservice. Now it works in both GWT's devmode and in Tomcat with no further modification needed.

Categories

Resources