[jdom-interest] Namespace.hashcode patch

philip.nelson at omniresources.com philip.nelson at omniresources.com
Thu May 31 07:36:51 PDT 2001


> >This will not work.  In SOAP and other xml applications the 
> prefix is quite
> >significant.  A prefix used in one element is part of an 
> attribute value
> >later and the processor ties them together that way.
> 
> Are you absolutely sure of this? If so, it's a major flaw in SOAP. If 
> so it's a major flaw in SOAP. Processors should tie things together 
> based on namespace URIs, not prefixes. Can you provide an example of 
> what you mean?
>

Sure though this is actually from WSDL, not SOAP.  The schema will be tied
to the message parts through the tns prefix.

First the declaration, the prefix tns is significant
<definitions name="A_Service"
  targetNamespace="urn:A_Service.com"
  xmlns="http://schemas.xmlsoap.org/wsdl/"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:tns="http://tempuri.org/AService" ******************
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">

Define types tied by URI as you would expect

    <schema targetNamespace="http://tempuri.org/AService"  ***********
      xmlns="http://www.w3.org/2000/10/XMLSchema" >

define a message

<message
      name="InechoRequest">
  <part name="echoText"
    type="xsd:string"/>
</message>

Setup a port based on the  message and type

<portType name="A_Service">
  <operation name="echo">
    <input message="tns:InechoRequest"/> **************
  </operation>
</portType>

Now bind a service to the port 
<binding name="A_ServiceBinding" type="tns:A_Service">  ***********

Depending on the processor, you may be able to substitute the prefix with
the full uri
but the current examples out there for both the IBM Web Services Toolkit and
MSSoap work like this.  Apache SOAP does not use WSDL at this time.  I don't
see this sort of thing in the SOAP message itself.
 
> >Namespaces without
> >prefixes cannot just have a new one added because the 
> default namespace has
> >special meaning in xml.
> 
> Actually they can. You can change the default namespace on every 
> element if you care to.

I give you that one :-)



More information about the jdom-interest mailing list