Why would an XML document have a targetnamespace attribute set?

Hello,

I have an xml document, namely a WSDL file and I am trying to understand why the "definitions" element have "targetNamespace" attribute set?

I thought this attribute was only for schemas. Is this not confusing? Is this legal? Why wsdl files don't have a schema to validate themselves from?

Here is my document:

<?xml version="1.0" encoding="UTF-8"?>

<definitions name="EJBWebServiceOne" targetNamespace="urn:EJBWebServiceOne/wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:EJBWebServiceOne/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<types>

</types>

<message name="EJBWebServiceOneSEI_myOperationResponse">

<part name="result" type="xsd:string"/>

</message>

<message name="EJBWebServiceOneSEI_myOperation">

<part name="String_1" type="xsd:string"/>

</message>

<portType name="EJBWebServiceOneSEI">

<operation name="myOperation" parameterOrder="String_1">

<input message="tns:EJBWebServiceOneSEI_myOperation"/>

<output message="tns:EJBWebServiceOneSEI_myOperationResponse"/>

</operation>

</portType>

<binding name="EJBWebServiceOneSEIBinding" type="tns:EJBWebServiceOneSEI">

<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>

<operation name="myOperation">

<soap:operation soapAction=""/>

<input>

<soap:body namespace="urn:EJBWebServiceOne/wsdl" use="literal"/>

</input>

<output>

<soap:body namespace="urn:EJBWebServiceOne/wsdl" use="literal"/>

</output>

</operation>

</binding>

<service name="EJBWebServiceOne">

<port binding="tns:EJBWebServiceOneSEIBinding" name="EJBWebServiceOneSEIPort">

<soap:address location="http://ordinateur:8080/EJBModuleWS/EJBWebServiceOne"/>

</port>

</service>

</definitions>

[2982 byte] By [balteoa] at [2007-10-2 20:14:56]
# 1

HI

WSDL need not have a schema mandatory. It means that the input and output parameters can be defined inline. Hence, a tns for a WSDL.

Regarding ur last question, the schema for the WSDL is present here:http://schemas.xmlsoap.org/wsdl/

Just copy, paste the URL in your browser and u see the Schema for the WSDL itself.

senthilkumar_ksa at 2007-7-13 22:57:10 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...