Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SOAP binding mismatch Glassfish 2.1/JAX-WS

 
Deyno Cegielski
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Are you able to attach the WSDL?
Best wishes!
 
Naren Chivukula
Ranch Hand
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Going to bump this to see if anyone has anymore ideas...still no luck in solving this conundrum.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic