Getting a Axis 1.1 client talk to an Axis2 service - java

Is it possible to have an Axis 1.1 client talk to an Axis2 web service endpoint? From my understanding, web services work by passing XML SOAP messages back and forth using the schema specified by the service's WSDL, but I'm unsure as to whether or not these versions of Axis utilize different versions of the web service specification that would stop them from talking. Any thoughts?

Alright, using Axis 1.1 to communicate with an Axis2 web service works just fine. I generated the stubs using Axis 1.1, created a Client class, and tested. Axis 1.1's API doesn't offer some of the same functionality that my previous Axis 1.4 allows, specifically in the ParameterDesc class, where you can specify if web service method parameters are nillable or their minOccurs, but my calls seemed to work just fine.
All in all, it can be done with (what appear to be) basic WSDL definitions, however, I'm unsure as to whether or not Axis2 utilizes new functionality that Axis 1.1 cannot accommodate due to Axis 1.1's aged API...
Oh, and one last note, I needed to use SOAP 1.1 stubs for my request. I'm not 100% sure why since my responses were coming back as SOAP 1.2, but there you have it.

In general your understanding is correct,i.e. that if a client adheres to the WSDL description it should be able to contact the web service.
But Axis1 and Axis2 use by default different encodings which are not compatible.
Axis1 uses RPC (which is obsolete) and Axis2 uses doc/lit.
So the oposite of what you ask i.e. an Axis2 client communicating with an Axis1 server will not work.
For the reverse (and what you ask in the post) I am not really sure.
Did you try to generate the stubs using the WSDL?
Did you get any errors? If you got no errors in stub creation, I believe you could give it a try.

Related

How to expose EJB JAX-WS web method to receive object of commonj.SDO DataObject type

I'm almost new to web services in Java.
Our company has previously used IBM Process Server to handle the interactions between SCA objects. Due to some reasons we've decided to give up IBM Process Server and therefore we started to migrate our current integrations to EJB.
Just to make myself more clear I've attached a simple schema describing my current task. This is a process deployed at IBM Process Server:
I need to develop an EJB, which also acts as a JAX-WS web service and receives an SDO DataObject from the JAX-WS client service, then makes some additional logic and sends the SOAP-request to another web service.
I'm totally don't know how to make my EJB receive a DataObject via SOAP. I have a WSDL-file, describing SOAP request and response formats.
I also found an article, describing the way to solve this using IBM RAD JAX-RPC webservice from a WSDL with an SDO facade, but the article seems to be outdated.
Is there any way to create the service without using JAXB-bounded POJOs, but with SDO? In case of no, how to handle it using JAXB in a proper way? Thanks in advance.
Solved!
During my searchings I figured out, that it's neccessary to generate a bean skeleton, change all the web methods signatures to receive and return JAXB-binded POJOs, generated from WSDL and then transforming it to Data Objects if needed.
JAXB takes care of the all marshalling/unmarshalling staff. I just needed to RTFM a little bit.

Is it possible to access a JAX-WS from a web browser?

I was just wondering, whether is it possible to deploy a JAX-WS and access it from a browser without the need to install any software or proxy classes ..
Of course, JAX-WS is just a library built on top of SOAP, which is built on top of XML, which is built on top of HTTP (duh!)
If you have SOAP web services (the fact that it was developed using JAX-WS is irrelevant), any application capable of sending and receiving XML over HTTP can call it. We are successfully accessing our back-end web services using AJAX POST (the web services must be deployed on the same domain as your front-end due to same-origin-policy).
As far as I've seen it's not possible, since you need to have proxy classes in order to call the JAX-WS functions ... but maybe I'm wrong !

How to know if a WCF is compatible with java (without having the code)

I have a WCF webservice that i should use from a java client.
I never worked with WCF or webservices, so how do i know first if it is written in a way compatible with java client(if i can know from the wsdl for example).
When generating the client from Eclipse. i get MyWcfServiceLocator and MyWcf. MyWcf has no methods
Thank you
You should be just working with the provided wsdl and the the endpoint associated for the same. You really need not bother about the server side implementation, it will definitely cater to the wsdl provided.
To enable non WCF clients the WCF service should expose the endpoint over basicHttpBinding which is the binding provided by microsoft for maximum interoperability. If the endpoint is exposed over wsHttpBinding (which is kind of a default IIRC) this could cause you some problems.

Spring WS Client - How to create mapping POJO for WSDLs without using Axis

I'm creating a Spring WS client. I have a huge WSDL from a third-party company. They provide a set of classes that maps to their WSDL via the Axis' WSDL2Java. I don't want to use Axis or any dependencies from them.
Since this is a web service client, I'm free to choose any framework. My problem is how do I generate a mapping class for the WSDL without using Axis's WSDL2Java. Am I stuck with manipulating pure XML? Take note I'm using Spring WS.
Edit:
Is it true if the service provider has built their service with Axis 1, you're basically stuck with making a client that's also based on Axis 1? I read it from this answer JAX-WS client with Axis service. I thought web services are supposed to be decoupled or at least independent from the platform that it was created, allowing you to have a .Net based web service to be accessed from a Java based client and vice versa?
If you want to use Spring-WS, then your best bet is to use the wsimport tool that ships with Java 6 (or use the JAX-WS RI, if you're on Java5). This will generate JAX-WS stubs for the web service. Included in these stubs will be standard JAXB bindings for the WSDL's schema, and those can be used with Spring-WS (wsimport will generate other service stubs that you won't need for Spring-WS).
If you are only interested in generating the POJOs from the WSDL, I think you could just get the XSD from the WSDL and use XJC tool to generate only the JAXB beans. This would avoid generating useless JAX-WS stubs.

JAX-WS client: JAXB required?

I need to "dive into JAX-WS programming".
So, I played around with Netbeans, after 20 or so erroneous attempts,
finally managed to let a web service client execute a web service.
I noticed, that a lot of code is generated, especially JAXB classes
for the web service response.
My current task is, to write a web service and web client completely
by hand.
Is JAXB required at all? Is is part of the standard anyway? What would happen without it?
EDIT:
Seems that the answer is given here
You can see Developing Web Services with Java 2 Platform, Enterprise Edition (J2EE) 1.4 Platform
I took a wsdl and used eclipse to generate the service, serviceLocator, ws interface, ws binding stub, ws proxy, and then the client code. I added a main method and was able to hit the webservice successfully.
I used this tutorial as a guide with the url below and no, there are no jaxb objects as I'm not pulling any objects back in the simple example I used. I was just hitting some methods that pulled back a boolean value.
http://px.pats.no/px/Eclipse_tutorial.html

Categories

Resources