Maven download or fetch the wsdl from the url to project directory - maven-2

We developed a web service client application using the wsdls from the url location.
I don't want the webservice client to go and validate the actual wsdls everytime , so wanted to download the wsdls in to local project .
is there any way can i download the wsdls using maven similar to copy resources?
Thanks
Vijay

You can use the wagon plugin to download the files to your project. See its usage page.

Two cases. If you own the service code, and it's something like Apache cxf, there's a command line like java2wsdl or java2ws. In the case of CXF, there's even a maven plugin for the job already.
If the service is 'out there' somewhere, you could use the linux wget or curl commands to fetch the wsdl from the ?wsdl URL.

Related

WSO2 ESB HTTP Endpoint does not get added to the Synapse configuration

I have built an ESB Project with an HTTP endpoint. But for some reasons. The Endpoint that I have defined and added to the ESB Solution does not seem to be reflected in the project and seem to be not reflecting when I deploy to the server. The endpoint is basically not being used. I have also tried to check the under the Defined Endpoints tab in the server Enterprise Integrator console, #
Home > Manage > Service Bus > Endpoints
but it isn't there. Numerous restarts have not helped neither has undeploying and redeploying the car file. Can someone point out where I might have gone wrong? As usual, thanks in advance.
Could be different things, to check:
Extract the .car file (it's just a .zip, so rename or use 7zip to
extract) and see if your endpoint is there.
Check if the serverrole in the pom file is correct (should be EnterpriseIntegrator it think)
Sometimes renaming artifacts causes problems as the file does not get renamed correctly or a reference is not updated in one of the
project files. Try removing the endpoint and use 'search in files' to
remove any lingering references in pom files.

Do I have to build the WCF Client for each machine its used on?

I've built and compiled my WCF client to run successfully. I've found that as long as these two files are together, my client will run anywhere on my computer:
Client.exe
Client.exe.config
When I move these files to another computer, there's an error:
System.InvalidOperationException: Could not find default endpoint element that
references contract 'Service.IService' in the ServiceModel client configuration
section. This might be because no configuration file was found for your
application, or because no endpoint element matching this contract could be
found in the client element.
I've already made sure that the service URL is accessible from the intended host of the computer.
After looking up the issue, seems like a solution is to copy the config retrieved from executing:
svcutil http://host/Service.svc
to the application configuration file. However, the config info is already in the App.config file when I built the project.
Do I need to recompile/build on every client machine that intends to use the WCF web service?
I seem to have resolved this by copying over the entire compiled folder:
Client.exe
Client.config.exe
Client.pdb
Client.vshost.exe
Client.vshost.exe.config
I don't have the time to go back and forth to see which subset of files are core or whether all these files are necessary, but hopefully someone can follow up with an answer to that.

How to access Apache Archiva rest services using curl

I installed Archiva 1.4-M4, and tried to access its REST API, beginning with the simple ping service, using curl;
$ curl http://localhost:8080/restServices/pingService/ping
<html><body>No service was found.</body></html>
Perhaps some configuration needs to be set to enable the services, but I can't find anything in the documentation that indicates such. It does say there should be a .wadl file in the distribution, but I can't find one in the install directories.
How do I get started with this?
Try
http://localhost:8080/restServices/archivaServices/pingService/pingenter
See wadl files: http://localhost:8080/restServices/
If installed as root context! If not http://localhost:8080/${yourContext}/...

How to reference apache cxf library from apache web server

When I deploy my apache cxf web service using eclipse I have to include the apache cxf library in the Web Deployment Assembly in order for it to work when I deploy it on my production apache web server. This is a problem because it makes the war file very large because the cxf library is included. If I exclude the library the war file is much smaller but the web service does not work when it is deployed on the live server even though the apache cxf library is on the live server.
My assumption is I need some kind of classpath reference so the live server can see the apache cxf installation but I am not familiar with how to do this as I am new to apache.
Thanks, Jesse
Put the cxf jars on folder tomcat/lib.
Ok, this workaround worked for me:
We can set the CXF lib path on the common.loader variable which is in $CATALINA_HOME/conf/catalina.properties file. You can add (after the comma) something like this:
common.loader=....,/path/to/cxf/home/lib/*.jar
I couldn't find a way to set an enviroment variable on tomcat in order to have something like: ${cxf.home}/lib/*.jar. I tried to put -Dcxf.home=$CXF_HOME in several places in catalina.sh but it never picked it up :( - hope someone can help on this later.
Restart tomcat and it will take cxf jars

not able to deploy war file in jelastic cloud

I developed a web application using java and mongodb. I used glassfish server.
I tried to deploy it on jelastic cloud service
I uploaded my war file. But when I run it after deploying the war file it shows a 404 error. Why? The project works fine on my machine.
There are at least few potential causes:
your app needs some resources which are not started by default (such as DerbyDB). In this case you can check GlassFish log file - server_instance.log for more details.
you are trying to get resources from wrong context, make sure you are trying to get it via correct context name