Gen EJB Web Service WSDL XML targetNamespace is fixed as ""
search cancel

Gen EJB Web Service WSDL XML targetNamespace is fixed as ""


Article ID: 208146


Updated On:




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 "". How can the targetNamespace be changed to use the required domain name?

Related WSDL 2.0 specification regarding the use of temporary 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,

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 "" 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 "" 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 "" be used as a base for stable, fixed entities.

Also "" (Temporary Uniform Resource Identifier) was historically used in WSDL 1.x:


Gen Enterprise Java Beans


Gen Engineering has advised that a change to the use of "" needs to be an enhancement request. Gen EJB Web Services has been using 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 and replace the 2 occurrences of 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 “” with Java “PackageName” in Model