File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes SOAP binding mismatch Glassfish 2.1/JAX-WS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "SOAP binding mismatch Glassfish 2.1/JAX-WS" Watch "SOAP binding mismatch Glassfish 2.1/JAX-WS" New topic
Author

SOAP binding mismatch Glassfish 2.1/JAX-WS

Deyno Cegielski
Greenhorn

Joined: Dec 01, 2010
Posts: 7
Hi,

I have a WSDL generated from a SEI specifying SOAP 1.1 binding (via annotations). This WSDL has been used to generate the client that invokes the WS and the client is deployed as part of a web application to Glassfish 2.1. Both the client and the service are deployed to the same container (don't ask why: I don't know!)

For some reason, it is sending SOAP 1.2 messages when it should be sending SOAP 1.1 and I can't for the life of me figure out why. If I import the WSDL to soapUI it uses SOAP 1.1 and works fine and I've also generated my own JSE client which works fine.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Are you able to attach the WSDL?
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 576

Hi Deyno,
the WS and the client is deployed as part of a web application to Glassfish 2.1

Glassfish 2.1 is an open source JEE5 application server. So, obviously it supports JAX-WS based web services, in which SOAP1.2 message protocol is by default. If you'd like, you could set message protocol to SOAP1.1 by using the following annotation in your client program.


Cheers,
Naren
(OCEEJBD6, SCWCD5, SCDJWS, SCJP1.4 and Oracle SQL 1Z0-051)
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Looking at the @BindingType annotation API documentation, the default value seems to be SOAP 1.1:
A binding identifier (a URI). If not specified, the default is the SOAP 1.1 / HTTP binding.

I have worked extensively with GlassFish 2.1 and when I wanted SOAP 1.2, I had to specify it explicitly.
Best wishes!
Deyno Cegielski
Greenhorn

Joined: Dec 01, 2010
Posts: 7
Ivan Krizsan wrote:Hi!
Are you able to attach the WSDL?
Best wishes!


Hi,

I can't really provide, but you can have a few extracts of the important bits with specifics masked:





As you can see the WSDL clearly uses SOAP 1.1, and the client is generated from that WSDL so should use SOAP 1.1 as well.

Default SOAP binding with Metro is SOAP 1.1 if not specified.
Deyno Cegielski
Greenhorn

Joined: Dec 01, 2010
Posts: 7
Naren Chivukula wrote:Hi Deyno,
the WS and the client is deployed as part of a web application to Glassfish 2.1

Glassfish 2.1 is an open source JEE5 application server. So, obviously it supports JAX-WS based web services, in which SOAP1.2 message protocol is by default. If you'd like, you could set message protocol to SOAP1.1 by using the following annotation in your client program.


I've already done this. Alternatively it can be specified in sun-jaxws.xml

I've rebuilt using SOAP 1.2 and will be testing that this morning, but still very curious as to whats happening by default.
Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 576

So, obviously it supports JAX-WS based web services, in which SOAP1.2 message protocol is by default.

Apologies for incorrect part of the information.
I've rebuilt using SOAP 1.2 and will be testing that this morning, but still very curious as to whats happening by default.

If you built your client with SOAP1.2, you'd get SOAP1.2, wouldn't you?
Deyno Cegielski
Greenhorn

Joined: Dec 01, 2010
Posts: 7
Naren Chivukula wrote:
So, obviously it supports JAX-WS based web services, in which SOAP1.2 message protocol is by default.

Apologies for incorrect part of the information.
I've rebuilt using SOAP 1.2 and will be testing that this morning, but still very curious as to whats happening by default.

If you built your client with SOAP1.2, you'd get SOAP1.2, wouldn't you?


The original service and client use the SOAP 1.1 binding (via the annotation) - but the application that uses the client sends SOAP 1.2 messages

I have rebuilt the service/client/app specifying SOAP 1.2 to see if this solves the problem, but even if it does I'm at loss at why the client was sending SOAP 1.2 messages instead of SOAP 1.1
Deyno Cegielski
Greenhorn

Joined: Dec 01, 2010
Posts: 7
Gets even better, now my problem is reversed and I'm sending SOAP 1.1 messages to SOAP 1.2 endpoint! All I've changes is the @BindingType.
Deyno Cegielski
Greenhorn

Joined: Dec 01, 2010
Posts: 7
Going to bump this to see if anyone has anymore ideas...still no luck in solving this conundrum.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
I'd gladly take a look but only if you can provide a complete (small) example that reproduces the problem. Preferably a NetBeans or Eclipse project.
I can use soapUI as client, so only the web service is needed.
Best wishes!
Deyno Cegielski
Greenhorn

Joined: Dec 01, 2010
Posts: 7
I've fixed it, although I'd like to understand why...

Basically we are not using SSL (again, don't ask why!), but SSL was enabled on the Glassfish server. Invoking the webservice from HTTP caused the exception, but invoking it from HTTPS didn't. I disabled SSL and HTTP worked fine (and HTTPS wasn't available).

I think this boils down to running web service client and services in the same container (its an architectural faux pas!), but I'm going to try and find out what is going behind the scenes with Grizzly.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SOAP binding mismatch Glassfish 2.1/JAX-WS
 
Similar Threads
JAX-WS generated client request missing SOAP body
New to Web services- Problem
which Java Specification (JSR ) to study for the SCDJWS 5 exam (CX-310-230) ?
Axis2 1.4 Client Transport error: 501 Error: Not Implemented
Cannot create Java Web Service Client with .NET Service