tisdag, februari 26, 2008

'Version Mismatch' Problem when Invoking a BPEL Partner Link that has Both SOAP 1.1 and SOAP 1.2 Endpoints

During a recent project we encountered a strange problem. When invoking a Partner Link that is defined towards a Web Service that has both SOAP 1.1 and SOAP 1.2 endpoints defined we got a Version Mismatch fault back. This was quite unexpected, and I assumed that doing some searches on the famous search engine using terms like 'VersionMismatch Oracle BPEL' would yield some relevant hits, but it didn't.

Suppose that you have created a Web Service that have multiple ports and bindings, for example, you have both a SOAP 1.1 and a SOAP 1.2 endpoint defined for the Web service. You have also tested the Web Service using a plain Java Client and that works fine. However, when you try to invoke the Web Service as a Partner Link from BPEL you get the following exception instead of the (expected) result:

<remoteFault xmlns="http://schemas.oracle.com/bpel/extension">
<part name="code">
<part name="summary">
<summary>Version Mismatch</summary>
<part name="detail">

It doesn't matter which endpoint (the SOAP 1.1 or the SOAP 1.2) you define the Partner Link to use. You end up with the exception in both cases. At a first glance it looks like BPEL is either sending a SOAP 1.1 message to the SOAP 1.2 port or sending a SOAP 1.1 message to the SOAP 1.2 port. If this occurs then the SOAP spec requires that a "Version Mismatching" fault is raised for such usage; but if this was the case - why does the error occurs regardless of which endpoint that is chosen???

Also, if you remove either of the ports & bindings from the Web Service WSDL (it doesn't matter which one) and then configures the Partner Link to use the other one, all works fine.

I do not have an explanation for this error, and have only tested it on Oracle SOA Suite

However, there is an easy workaround to the problem:

  1. Download 2 local copies to your project of the WSDL for the Web Service.
  2. Remove one port & binding (not the same...) from each of the local WSDL copies.
  3. Define 2 Partner Links in your BPEL project, one based on each of the local WSDL copies.
  4. Implement a Switch to invoke the appropriate Partner Link in your BPEL process.

If you just have the need to invoke either of the endpoints, you of course just need to create one local copy, remove one of the ports & bindings and use this local copy of the WSDL for the Partner Link.

Inga kommentarer:

Skicka en kommentar