wood burning stoves 2.0*
The moose likes Web Services and the fly likes JAX-WS versus Axis2, WSDL Implementation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "JAX-WS versus Axis2, WSDL Implementation" Watch "JAX-WS versus Axis2, WSDL Implementation" New topic
Author

JAX-WS versus Axis2, WSDL Implementation

Shiv Vishwakarma
Greenhorn

Joined: May 29, 2007
Posts: 21

Hi,

I recently started working on webservices and i am facing few problems,

but firstly i want to understand what is the difference between implementation of web service client using jax-ws and axis2.

The problem that I am facing is, I have to implement an integration with a third party with our application, and third party have shared their WSDL file with us.
I initially tried to generate the stubs using axis2 and after setting the required parameters and on calling the service the service it is giving 401 error: unauthorized.
after contacting third party team, i was told that I have to use NTLM and they shared us the credentials as well....

code from implementation is below:
WSStub stub = new WSStub();
SoapOp soapOp0 = new SoapOp();

soapOp0.setPPacketsIn("param");

// NTLM
HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
auth.setUsername("username");
auth.setPassword("password");

auth.setHost("abc.xyz.com");
auth.setDomain("DOMAIN");

auth.setPreemptiveAuthentication(true);
List authSchemes = new ArrayList();
authSchemes.add(AuthPolicy.NTLM);
auth.setAuthSchemes(authSchemes);

final ServiceClient client = stub._getServiceClient();
Options options = client.getOptions();
options.setProperty(HTTPConstants.AUTHENTICATE, auth);
options.setProperty(HTTPConstants.CHUNKED, "false");


stub._getServiceClient().setOptions(options);
response = payWSStub.soapOp(soapOp0);

above code is still giving the same error: 401 unauthorized, and as per third party I have not used NTLM to pass the credentials, which i assume I have done it correctly
When I looked at their implementation of WSDL, they have used JAX-WS for generating stubs.


Please help and tell me does it makes a difference if I use to generate stubs using AXIS2 instead of JAX-WS.

any help would be greatly appreciated.

many thanks,
shiv


Vishwakarma, Shiv
SCJP 1.4, SCWCD 5
H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 412
    
    3
Just a JDBC provider concept, you have many provider or implementation from DB2, ORACLE, MYSQL.
JAX-WS is a specification, you many provider or implementation from JAX-WS RI called Metro, Apache CXF, AXIS2 etc..
The question now is which implementation has all the features mentioned in the JAX-WS spec.

For better explanation , a must read link http://www.coderanch.com/how-to/java/WebServicesFaq

If you choose AXIS2, then GOOGLE or see AXIS2 doc how to a code sample how to pass NTLM authentication to your web service provider.
or if you choose any other implementation Metro, Apache CXF, then do the same.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAX-WS versus Axis2, WSDL Implementation