I am required to add WS-Addressing, WS-Security, and WS-Reliablity to a legacy java web service that runs on Apache Axis2.
I found out that Axis2 comes with WS-Addressing support. Then I installed Apache Rampart (v1.6.2, for WS-Security) and Apache Sandesha2 (v1.6.2, for WS-Reliable Messaging) on top of Axis2 (v1.6.2; running on Apache Tomcat (v1.7.0_30)).
After doing some research, I added my policies to my services META-INF/services.xml file. (The policy requires https and the header to be signed.) I can deploy the service to Tomcat without any exceptions. I can see the service using the axis2 url (http://localhost:8080/axis2).
Now I am attempting to write a java client for this service. I used the axis2 'wsdl2java' code generator to create the stubs. My test client service is able to call the service. However, on the server side, I get an exception "AxisFault : Message is not signed" (required by policy). The server logs also show the 'CreateSequence' message (part of WS-Reliable Messaging) is not signed.
Does anyone have insight on how to sign the 'CreateSequence' message? Also, it would be helpful to have a link to a sample client/service that uses Axis2, Rampart, and Sandesha2. Thanks in advance.
Related
I am developing a java client to connect to a web service which uses SOAP. In Intellij
TOOLS>GENERATE JAVA CODE FROM WSDL
has generated the stubs and I have connected to the insecure endpoint.
I now need to sign and encrypt the message body with a public certificate. I have read about Axis, CXF, WSS4J and Glassfish but I am still unclear which of these packages I would use?
We have jboss 4.2.3 GA and SOAP web service hosted on it. The stubs are generated by .Net developer team and they are calling our web service. This part is working fine. Which is running with Java 1.6
Now recently we have upgraded to Wildfly10.0 from Jboss 4.2.3 GA, now old stubs which are generated by the .Net Team are not working. We have not changed any of the SOAP web service. Which is running with Java 1.8
We suggested them to re-generate the stubs and use it, after re-generating the stubs they are able to use our web service.
Our analysis are:
With old stubs they are able call our web service, our java product is replying with proper SOAP message, once the .Net receives the SOAP message, SOAP is failing to convert back it to object with old stubs.
Even we compared old and new stubs classes, looks both are same only except the tool used to generate the stubs.
The SOAP message is also same for when they use old and new stubs.
We are clueless what is causing the failure at .Net end, they are forcing us to make our Wildfly10.0 server compatible to support the older stubs and they are not ready to give patch to client as there is no change in their product.
Please find the GitHub link for the old and new stubs and SOAP messages.
Click Here for the stubs and SOAP Messages
I need to consume a web service in java/jsp code. Only the WSDL is available for me to start.
I understand I need to convert the WSDL into java client JAR file using AXIS2 / CXF but I cannot build the whole application on this.
Can someone provide a simple example or basic steps for me to start on this?
I am not able to join the dots here. WSDL, java client JAR, AXIS2.... All online tutorials point on 'creating' a web service.
There are a number of tools capable of doing this included in various frameworks and app servers (CXF, JBoss/Wildfly, etc.), but the JDK itself includes a tool called wsimport which can consume a WSDL file and produce the JAX-WS stubs you need to remotely-invoke the service endpoints via a Java client.
Here's one quick description: http://www.mkyong.com/webservices/jax-ws/jax-ws-wsimport-tool-example/; here is the Oracle documentation for the tool in JDK 7: http://docs.oracle.com/javase/7/docs/technotes/tools/share/wsimport.html.
WSDL is just the conract for the web service. You need to generate client code using it, later you can implement your code to call the web service. Like #maerics pointed out, you should use wsdl2java to generate your client code for AXIS2 and use your client to consume the web service.
You can check this link for an example of client stub generation for AXIS2.
There is an SAP server that has some webservices I need to use, so I am trying to use wsimport to generate the client stubs.
I don't want to find all the wsdls and schemas that are referenced and modify them to do it locally, as that isn't sustainable, if they service should change.
So, how can I use wsimport to fetch a wsdl and generate the client stubs when the server is using Windows Integrated Authentication, where even the wsdl requires credentials.
The best solution I have found is to just copy the wsdl, and add in the changes to get it to work with wsimport, and save it on the jboss server, since it is unlikely someone will figure out the name of the directory, and only port 8009 is open to the world, even the jboss port is closed.
It isn't the best solution, but it works.
I need to prototype a very simple system which sends a request to a remote web service, which will then callback on my own web service once it's finished processing. Unfortunately, I have to implement their WSDL for the callback.
Is there a nice simple way of generating a JBoss application which will correctly implement the WSDL, and run some trivial java code?
I tried wsdl2java from Apache CXF, but that only gave me a standalone server, not a deployable one.
Does this tutorial help?
Have a look at Axis2.