CA Gen EJB Web Service WSDL XML targetNamespace is fixed as "tempuri.org"

book

Article ID: 208146

calendar_today

Updated On:

Products

CA Gen - Workstation Toolset

Issue/Introduction

In Model Generation Proprieties the Java Package Name is set for Java generated code. However the generated EJB Web Service WSDL always shows that the XML targetNamespace uses "tempuri.org". How can the targetNamespace be changed to use the required domain name?

Related WSDL 2.0 specification regarding the use of temporary URIs: https://www.w3.org/TR/wsdl20-primer/#adv-notes-on-uris
+++
5.6.3 Generating Temporary URIs
In general, when a WSDL 2.0 document is published for use by others, it should only contain URIs that are globally unique. This is usually done by allocating them under a domain name that is controlled by the issuer. For example, the W3C allocates namespace URIs under its base domain name, w3.org.

However, it is sometimes desirable to make up a temporary URI for an entity, for use during development, but not make the URI globally unique for all time and have it "mean" that version of the entity (schema, WSDL 2.0 document, etc.). Reserved Top Level DNS Names [IETF RFC 2606] specifies some URI base names that are reserved for use for this type of behavior. For example, the base URI "http://example.org/" can be used to construct a temporary URI without any unique association to an entity. This means that two people or programs could choose to simultaneously use the temporary URI " http://example.org/userSchema" for two completely different schemas. As long as the scope of use of these URIs does not intersect, then they would be unique enough. However, it is not recommended that " http://example.org/" be used as a base for stable, fixed entities.
+++

Also "tempuri.org" (Temporary Uniform Resource Identifier) was historically used in WSDL 1.x: https://www.w3.org/TR/wsdl.html#_Toc492291092

Environment

Release : 8.5, 8.62
Component : CA Gen Enterprise Java Beans

Resolution

Gen Engineering has advised that a change to the use of "tempuri.org" needs to be an enhancement request. Gen EJB Web Services has been using tempuri.org for the namespace ever since they were first developed and therefore it is currently working as designed. 
There is no quick model-based solution that can be implemented to give the required result and any change is probably going to need a new option for the user to specify the required WSDL XML namespace which will be separate to the current Java Package Name field.

In the meantime the following workaround has been tested successfully:
1. Go to the model.ief\java\package_name directory containing the generated source code.
2. Edit the file PStep_Bean.java and replace the 2 occurrences of tempuri.org for the @WebService and @WebMethod annotations with the required domain name.
3. Use the Build Tool to rebuild and Assemble the generated code.

To ensure full integrity of Gen model with Gen generated code, it would not normally be recommended to change the generated code, but the changes required for this workaround are relatively low risk. If changing the generated code breaks a fully automated generation/build process, then perhaps a "post-processor" can be used to make the required changes after the code has been generated but before the build is executed. 

Additional Information

The enhancement request was created as a new idea on the Broadcom Ideation Community: Default Gen WSDL replace “tempuri.org” with Java “PackageName” in Model