IBM Support

Cannot use two WSDLs with the same namespace

Troubleshooting


Problem

If there are two or more WSDL files which have the same namespace, they cannot both be used within the same BPEL process. This will result in an error ("Duplicate key value").

Cause

The usage of two or more WSDL files which have the same namespace results in two or more imports in the Artifacts WSDL for the same namespace such as the following:

<import location="MyInterface1.wsdl" namespace="http://MyModule/MyInterface"/>
<import location="MyInterface2.wsdl" namespace="http://MyModule/MyInterface"/>

The WSDL 1.1 specification does not allow multiple imports with the same value for the namespace attribute.

Resolving The Problem

There are two workarounds available to solve this problem.


The following steps provide the first workaround for this problem:

  1. Find the Artifacts WSDL by selecting the process in the Business Integration view and selecting Show Files. The Physical Resources view opens.

  2. From here, it shows that the error is connected with the MyProcessArtifacts.wsdl. Create a copy of that WSDL (for example, call it MyProcessArtifacts2.wsdl). The resulting errors can be ignored, they will disappear later.

  3. Open both WSDLs with the text editor. The content is similar to this one:


  4. Modify the original WSDL so that it only contains the partnerLinkType(s) for the process (here it is marked in blue) and the partnerLinkType for the first portType (here it is marked in green). Ensure that the needed import stays with the partnerLinkType. The resulting MyProcessArtifacts.wsdl should look like the following:


  5. Modify the copy so that it only contains the second partnerLinkType. If needed, remove the namespace marked in red. It is the one for the process portType which have been removed from the copy:


  6. Open the BPEL with the text editor. Search for the filename of the original Artifacts WSDL. This should be referenced in the import by the location attribute:

  7. <bpws:import importType="http://schemas.xmlsoap.org/wsdl/" location="MyProcessArtifacts.wsdl" namespace="http://MyModule/MyProcessArtifacts"/>

  8. Duplicate this import and adapt the filename to the one of the copied WSDL:

  9. <bpws:import importType="http://schemas.xmlsoap.org/wsdl/" location="MyProcessArtifacts2.wsdl" namespace="http://MyModule/MyProcessArtifacts"/>

    Note: In contrast to WSDL 1.1, BPEL does allow multiple imports with the same value for the namespace attribute. Therefore, changing the targetnamespace of the copied WSDL and the namespace attribute in this step duplicated import in the BPEL is NOT required.

  10. Save these change and rebuild the workspace.


The following steps provide the second workaround for this problem:

Note: This workaround should only be used when you are allowed to change one of the WSDLs, in this case MyInterface1.wsdl. The Artifacts WSDL is generated by WebSphere Integration Developer and can be changed to fix this problem. The other two (or multiple) WSDLs can be imported from existing Web services/applications and you might not be able to change them.
  1. Find the Artifacts WSDL by selecting the process in the Business Integration view and selecting Show Files. The Physical Resources view opens.

  2. From here, it shows that the error is connected with the MyProcessArtifacts.wsdl. Open this WSDL with the text editor. The content is similar to this one:


  3. Find one of the imported WSDLs referenced in one of the problematic imports, in this case either MyInterface1.wsdl (marked in green) or MyInterface2.wsdl (marked in pink).

  4. Open this WSDL with the text editor, for example, MyInterface1.wsdl.

  5. From the MyProcessArtifacts.wsdl, copy and remove, or just cut, the import for the unopened WSDL (in this case, the import for MyInterface2.wsdl) and paste it at the end of MyInterface1.wsdl, before the </wsdl:definitions> end tag. If needed, add the wsdl: prefix to the import. The resulting MyInterface1.wsdl should look like the following:


  6. This solution is referred to as the chaining of WSDLs. In case you have multiple WSDLs, ensure that they import each other in a chain, where the Artifacts WSDL only imports the WSDL which is at the end of the chain, meaning that all other WSDLs can be found following the chain.

  7. Save these changes and rebuild the workspace.
[{"Product":{"code":"SSQQFK","label":"WebSphere Integration Developer"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Business Process Editor","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"6.1.2;6.1.0.1;6.1;6.0.2.2;6.0.2;6.0.1.2;6.0.1.1;6.0.1;6.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

More support for:
WebSphere Integration Developer

Software version:
6.1.2, 6.1.0.1, 6.1, 6.0.2.2, 6.0.2, 6.0.1.2, 6.0.1.1, 6.0.1, 6.0

Operating system(s):
Linux, Windows

Document number:
346991

Modified date:
15 June 2018

UID

swg21231969

Manage My Notification Subscriptions