Axis sets the default namespace to null because your schema defines the child elements as unqualified. If it didn't set the default namespace to null, then the message would not match the schema.

If you add elementFormDefault="qualified" to your schema element, then the child elements will be defined as qualified.

Anne

On 11/3/05, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:
I'm hoping that Anne Manes or someone more knowledgable will step forward
on this one, but I've seen similar questions come up on this list over the
past few months and I wonder if the behavior you're seeing is because of
the default "unqualified" setting that you have in your schema.  See this
post from Anne, where she gives an example of how this might work:

http://marc.theaimsgroup.com/?l=axis-user&m=112241677227703&w=2

Here's another response from Anne, to a question that's the opposite of
yours--how to suppress the namespaces being added to every element!
http://marc.theaimsgroup.com/?l=axis-user&m=111823412914728&w=2

Hope this helps--

Meghan

_________________________________
Meghan Pietila
Java Middleware Architect
Sales & Service Management Program
US Bank
Gold 4
(651) 205-0904
(651) 271-2815 cell
[EMAIL PROTECTED]




                      "Ron Reynolds"
                      <[EMAIL PROTECTED]        To:       [email protected]
                      com>                     cc:
                                               Subject:  only top-level element has namespace
                      11/02/2005 06:18
                      PM
                      Please respond to
                      axis-user






i hate to ask a duplicate question but 5 minuets digging in the list
archives was leading nowhere.
my question is, what's causing this 'xmlns=""' to be added and how do i
prevent it?  (my service is document-literal)

<soapenv:Body>
  <findVialsByAttributesResponse xmlns="urn:amgen.com/freezer/data">
   <locations xmlns="">
    <location id="1">
...

same thing's happening on the request side as well -

<soapenv:Body xmlns:wsu="..." wsu:Id="id-21465667">
<findVialsByAttributesRequest xmlns="urn: amgen.com/freezer/data">
  <materialTypeName xmlns="">FooTest</materialTypeName>
  <attributeName xmlns="">Volume</attributeName>
  <attributeValues xmlns="">
    <value>1</value>
    <value>2</value>
...

is it a WSDL issue?  i import the type XSD thus:
<wsdl:definitions targetNamespace  = "urn: amgen.com/freezer"
                  xmlns:tns        = "urn:amgen.com/freezer"
                  xmlns:data       = "urn:amgen.com/freezer/data"
                  xmlns:soap       = "http://schemas.xmlsoap.org/wsdl/soap/
"
                  xmlns:xsd        = "http://www.w3.org/2001/XMLSchema"
                  xmlns:wsdl       = "http://schemas.xmlsoap.org/wsdl/">
  <wsdl:types xmlns="urn:amgen.com/freezer/data">
    <xsd:schema targetNamespace="urn: amgen.com/freezer/data">
      <xsd:import namespace="urn:amgen.com/freezer/data"
schemaLocation="freezer-data.xsd "/>
...
      <xsd:element name="findVialsByAttributesRequest"
                   type="data:TFindVialsByAttributesRequest"/>
      <xsd:element name="findVialsByAttributesResponse"
                   type="data:TFindVialsByAttributesResponse"/>
    </xsd:schema>
  </wsdl:types>
...
  <wsdl:message name="FindVialsByAttributesRequest">
    <wsdl:part name="request"
element="data:findVialsByAttributesRequest"/>
  </wsdl:message>
  <wsdl:message name="FindVialsByAttributesResponse">
    <wsdl:part name="response"
element="data:findVialsByAttributesResponse"/>
  </wsdl:message>
...

i noticed the XSD doesn't explicitly call out qualified elements:
<xsd:schema
    targetNamespace="urn:amgen.com/freezer/data "
    xmlns:data     ="urn:amgen.com/freezer/data"
    xmlns:xsd      = "http://www.w3.org/2001/XMLSchema ">
  <xsd:complexType name="TLocation">
    <xsd:sequence>
...

could that be a problem?  it still doesn't make sense why the SOAP message
would EXPLICITLY strip the namespace from
everything except the root element, or does it? :-/

never giving up, ;-)
.................ron.






------------------------------------------------------------------------------
Electronic Privacy Notice. This e-mail, and any attachments, contains information that is, or may be, covered by electronic communications privacy laws, and is also confidential and proprietary in nature. If you are not the intended recipient, please be advised that you are legally prohibited from retaining, using, copying, distributing, or otherwise disclosing this information in any manner. Instead, please reply to the sender that you have received this communication in error, and then immediately delete it. Thank you in advance for your cooperation.
==============================================================================


Reply via email to