Hide WSDL in JAX-RPC 1.1 WS - java

I have a lot of old web services.
Now the wsdl is public, so i need to hide the wsdl.
My configuration is jax-rpc 1.1 + Weblogic 12.1.3.0.0
I have searched a lot, but none of the solutions found have worked for me:
I don't have the option in Weblogic to hide the wsdl (in the documentation appears this option but in my weblogic not):
#WSDL(exposed = false) (¿not possible in jax-rpc?)
Implementing a class with Filter is not working
Does anyone have any idea how to hide the wsdl with this configuration?
Thanks & Regards.

Finally i solved this blocking the GET operations in the webservice (since all SOAP methods use POST )

Related

WebLogic ClientInstanceInvocationHandler to cxf ClientProxy

Hello I have a WebService Client on my java project the which is on weblogic. Now I need add the header for security reasons to my petition. I have tried everything and finally a friend help me with a code for Jboss the which works fine on Jboss, but on weblogic it gives me a problem with of castClassException.
Like the title said the original class is "ClientInstanceInvocationHandler" and I need that on "ClientProxy" of APACHE CXF
Here is the problem:
org.apache.cxf.endpoint.Client client = ClientProxy.getClient( port );
Does anyone have a solution?
According to this site https://community.oracle.com/thread/2467175?tstart=0 the problem is that the Apache classes are not properly on the classpath of the server.
They said they "set the APACHE CXF jars as a User Defined Library and set it to the 'Deployed by Default' option".
In this blog with the same problem, they use the following fragment in their weblogic-application.xml:
<prefer-application-resources>
<resource-name>META-INF/services/javax.xml.ws.spi.Provider</resource-name>
</prefer-application-resources>
From what I can understand weblogic returns it's own implementations for these methods unless you tell it to prefer the standard interface and put an implementation of the standard interface on the classpath. I guess the custom class gives some extra performance or features beyond the standard interface.
The Apache CXF site itself addresses this in a similar way, but suggests a different package name (javax.jws.*)
In addition to all this, some people had problems getting weblogic to find and recognise the jars because it was loading weblogic classes in preference and had to do the following:
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
But I have seen variations on this, depending on where your Apache jars are located.

Restlet Client using JAX-RS annotated resources

I am writing a restlet client that will invoke some Resteasy coded rest services (cannot change the server code, hence cannot use the Restlet way of annotating resources).
Resource Interface is using JAX-RS annotations and have more than one #POST method (one of the biggest problems of Restlet when dealing with this).
I was trying to do my implementaion this way:
IAppLoginResource resource = JaxRsClientResource.createJaxRsClient("http://localhost:9090/rest", IAppLoginResource.class);
final GetLoginAppInfoResponse response = resource.getLoginAppInfo( getLoginAppInfoRequest );
The problem is that the request by default is GET, I didn't find a way to specify the request method like when using ClientResource (which I can't use because I need to deal with JaxbRepresentation and Jaxb problems).
Any sample/snippet of code that implement a Restlet client using JAX-RS annotated resources?
Any ideas?
Thanks,
I've entered an issue for this topic:
https://github.com/restlet/restlet-framework-java/issues/1081
I've tested a sample application based on your code, and it works properly using the current 2.3 branch (future 2.3.3). I wonder if the fix for this issue https://github.com/restlet/restlet-framework-java/issues/1072 helps.
Regarding the documentation, I 'll complete the current page (http://restlet.com/technical-resources/restlet-framework/guide/2.3/extensions/jaxrs), cf this issue: https://github.com/restlet/restlet-framework-java/issues/1084.
You can also have a look at the org.restlet.test project, especially in this package https://github.com/restlet/restlet-framework-java/tree/2.3/modules/org.restlet.test/src/org/restlet/test/ext/jaxrs.

Apache CXF WSDL Resolution

Using Apache CXF 2.7.7 if I publish a simple "HelloWorld" JAX-WS service and attempt to resolve the WSDL URL in a web browser using: "localhost:8080/service/HelloWorld?wsdl" the WSDL loads in the browser and everything looks great.
If I then add the below annotation which changes the SOAP Binding to 1.2 the WSDL resolution still works but the WSDL doesn't load in the browser, instead a download dialog is shown and the name of the WSDL is missing the file name extension in the download dialog (which is probably why it isn't loading in the browser).
javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING
The same behavior appears with the SOAP12HTTP_MTOM_BINDING
#javax.xml.ws.BindingType (value=javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_MTOM_BINDING)
Functionally everything works fine even with the BindingType annotation defined so this is just a minor annoyance but I'm wondering how I can get the correct WSDL resolution behavior when the default SOAP 1.1 binding is in use.
I posted this issue on the Apache CXF JIRA and it was acknowledged as a defect. It has been fixed and will be included with the Apache CXF 2.7.8 release.
https://issues.apache.org/jira/browse/CXF-5334

Generating Spring WS Client from RPC/encoded WSDL with ease?

Greetings everyone,
Prior to my specific question, I'd like to mention that I am not looking for a step by step solution but for a possible YES or NO whether or not I will be able to achieve my goal with what I'm planning.
What I've got:
A wsdl that was autogenerated by Axis 1.3 an that is RPC/encoded. - I dont have any influence on the Webservice per se.
What I try to achieve:
Generating a Spring WS Client from that wsdl.
What I "know":
RPC/encoded WSDLs are deprecated and not "supported" by Spring WS
Spring WS can deliver any valid XML
I have to get the schema from the WSDL - > .xsd
I'm doomed.
What I'm not sure of:
is the .xsd enough or do I need to generate/write an .xjb to generate the Classes?
The Question:
Is it possible for me to get the .xsd from the RPC/encoded WSDL and generate my Java Classes for the Spring WS Client without too much "hacking around"? Or should I just go along with developing cruel Axis 1.3 generated Classes with all their miseries?
Thank you in advance.
If you don't like Axis 1.3, JAX-RPC is a slightly easier to use alternative.

Developing Web services applications from existing WSDL files

I have done this on Websphere (re: title of this topic) using wsdl2java for generating wsdl to java mapping xml file.
My endpoint is a generic stateless EJB. The code in EJB is generated by traversing the each wsdl and getting the wsdl operation and stuck it in the generated remote EJB interface.
Each EJB method impl is generic and handles all the services the same.
Used instructions on this doc to do this on WAS: http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/twbs_devwbsjaxrpcwsdl.html
Now, I am asking you all for help if anyone has done something similar in Sun AS 9.1.
Starting from existing WSDL (and xsd) files. Knowing the sole EJB service endpoint implementation for each services are the same, and generating an EAR file (webservices.xml, ejb-jar.xml, etc).
Have struggled with wscompile and alike, but not getting anyware in the same fashion I did for WebSphere.
Thanks for help.
You want to create a WS client which runs under Sun AS? I don't know Sun AS in detail and I don't know the WS libraries it supplies. But you may want to use a public WS library:
Apache Axis 2
Apache CXF
For every library there is documentation which describes how to create a project from WSDL.
You could even use Eclipse to create a project from WSDL for you: File -> New -> Other... -> Web Services -> WSDL. Make sure you have the "WST Web Services" Plugins installed.
I've never used it myself, but I just recently read about the wsdlLocation() attribute of the WebService annotation, which is supposed to map the service to a preexisting WSDL document (not sure if you're even using EJB3, though).

Categories

Resources