Initially WSDL location was given using which I generated the server classes in the client side. Now the server side is deployed as a war file at a different port. We must be able to load wsdl from the new location without modifying the client side code.
It was actually pretty simple. Since I was new to web service I felt it to be an herculean task.
What I did was stored the new WSDL access URL inside a property file and then loaded the value into the project.
Related
I have the following issue with my JAX-WS Ri webservice:
Let's say an external user wants to connect to the webservice with an url. During the request (which passes through a load-balancer and has SSL-offloading), the service is accessed on a OC4J container, which generates a WSDL that returns to the client. However, the returning WSDL contains URLs that contain the name of the internal machine instead of the external url. This results in a scenario where other programs cannot link to our WSDL, as they cannot fully download it (see drawing for clarification).
How can I make the WSDL accessible for external users? (i.e. trick the service into generating url's using the externalurl.com reference, rather than its machine name?)
For what it's worth: In Tomcat you can specify proxyName and proxyPort for a Connector. How can this be achieved in OC4J?
You can provide an oracle-webservices.xml file along with your application to override the default binding settings of the OC4J container.
You can find more information here.
The project this concerns is about uploading structured information from Excel to a java based webserver for further processing. As the least common denominator i have chosen SOAP for the job.
For this i have written a C# add-in that accesses a SOAP service on the target server. It uses a web reference to do so. This works on a test system.
In production the client will have to access three servers and these will change over time (not daily, just normal maintenance intervals). The content of a web reference is tied to a specific server, so i will need three web references and a recompile for each server change.
My goal would be a single copy of the (restructured) web reference content so the variable content can be put in a configuration file and a server change can be effected by maintenance.
The question is the following: Has anyone of you built a solution for this? Hints and tips are welcome.
I need to consume a secure webservice deployed in WSO2 AS from another web service develop in axis2 and deployed in apache tomcat.
I create a java project to test the secure webservice client and I work OK.
But when I move the client code inside the axis2 service I cannot access to some resources like in this cases:
System.setProperty("javax.net.ssl.trustStore", "keys\\store.jks");
in this case I have the keys folder in the root of the wb services
sc.engageModule("rampart");
and in this case I leave the code idem
Any idea about this?
Well getting a resource path from an archieve file whether it is a jar ,war or aar is a tedious problem. There are two options two choose from:
1- Since client application runs on a servers put jks file somewhere on the server path, its path retrieved dynamically via property. (Either system property, servers context etc.)
2- A customSSLFactory handling loading keystore from resources.
This SO thread mentions such solution, which i used it too to connect to server via SSL from a web service without touching system properties.
I want to build a web services client that takes wsdl link as the input and generates java classes. I know we can do this directly using Netbeans IDE where we provide the wsdl location during project setup. But I want the wsdl location to be provided when the client starts running. How do I do this?
Is the location that will be provided just used to specify the SOAP endpoint (for a web service whose WSDL was known at development time), or will it be a completely arbitrary WSDL?
In the first case, the web service client that was created by Netbeans has methods that accept an alternate SOAP endpoint URL. You can call those to use the client with a server whose location is not hard-coded in the client.
If however, the WSDL describes a completely unrelated service, how are you going to write Java code against it? You cannot use any interfaces derived from the WSDL (because they are not known at development time). You could only have a very generic SOAP client, where the user almost directly types in the XML that will be sent.
I have a web service client (JAX-WS) and the stubs have been created using the wsimport tool.
Now once the client is packaged as an application, the location of the service (and only the location )changes.
Do I have to re run the whole ws-import tool once again to create new stubs for the new location.
Is it possible to move the WSDL location to a Config so that the application do not have to be built again! I am working with net beans 6.5.
I suppose DII is an option, but is there a solution to make the code independent of the WSDL location.
You may package the WSDL locally in your application (which is also reasonable for performance, since you're saving requests to the external file on runtime), see developing client application with locally packaged WSDL