# @common:target-namespace Annotation

The @common:target-namespace annotation specifies the XML namespace used for outgoing XML messages and generated WSDL files.

Note: In WebLogic Workshop 7.0, the namespace in a web service was specified with the @jws:target-namespace annotation. This annotation is still supported in JWS files for backward compatibility.

## Syntax

@common:target-namespace

namespace="defaultXMLNamespace"

## Attributes

namespace

Required. Specifies the default namespace used for outgoing XML messages and generated WSDL files.

## Remarks

The following rules apply to this annotation's use:

- Optionally may appear on the main class in a JWS file.
- Optionally may appear on the main interface in a control file.

If no target namespace is specified (this annotation is not present), the namespace used is http://www.openuri.org/.

Note: Before deploying web services, you should define a unique default namespace for your organization. If multiple organizations were to leave the default namespace as http://www.openuri.org/, it could result in namespace conflicts.

The @common:target-namespace annotation affects the behavior of the following XML generation actions:

- If there is no XML mapping specified for an incoming or outgoing message, a default map is used (the natural mapping). The elements of the resulting XML message must be specified in some namespace. The value of @common:target-namespace is used.
- If a custom XML mapping is present for an incoming or outgoing message but no namespace is specified, the value of @common:target-namespace is used.
- WSDL files generated from JWS files specify a namespace for the elements in the WSDL file. The value of @common:target-namespace is used.

Note that if @common:target-namespace is not defined, the default value is http://www.openuri.org/.

For more information on WSDL files, see WSDL Files.

Related Topics

Introduction to XML