axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wimmer, Matthias" <matthias.wim...@scr.siemens.com>
Subject RE: SOAPHeaderElement.addTextNode() ???
Date Fri, 07 Jun 2002 17:46:50 GMT
Anna:

I analyzed your code and figured this out:
You sent:
   <ns1:Authentication xmlns:ns1="Data">
       <UserName>username</UserName>
       <Password>password</Password>
   </ns1:Authentication>

The SOAPEnvelope expected:
    <Authentication xmlns="Data"> 
         <UserName>string</UserName> 
         <Password>string</Password> 
    </Authentication> 

In the first case "Authentication" belongs to the namespace "ns1" (="Data")
and in the second case "Authentication" belongs to the local unnamed
namespace (="Data"). That is no problem because that is the same. 

But the subordinate tags ("Username" and "Password") don't belong to the
same namespaces in both cases. In the first case they belong to any global
namespace (because they have no prefix) and in the second case they belong
to the local namespace.

To say it in other words: In the first case the local namespace has a prefix
and in the second case the local namespace has no prefix. You can use each
one of them. But once you have chosen one of them you have to stick to it.

So you have two choices:
1. Remove the name of the first namespace: 
    <Authentication xmlns="Data">
2. Stick to your namespace in all subsequent tags
       <ns1:UserName>username</ns1:UserName>
       <ns1:Password>password</ns1:Password>  

I would prefer the second choice.

I am not quite sure. I didn't try it out.
good luck
Matthias Wimmer


-----Original Message-----
From: Anna Chen [mailto:ychen@jgsullivan.com]
Sent: Friday, June 07, 2002 12:39 PM
To: axis-user@xml.apache.org
Subject: RE: SOAPHeaderElement.addTextNode() ???


But the service written in .NET can't recognize my username and password???
The SOAPEnvelope I sent:
<SOAP-ENV:Envelope 
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Header>
   <ns1:Authentication xmlns:ns1="Data">
    <UserName>username</UserName>
    <Password>password</Password>
   </ns1:Authentication>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
   <DataProcessed xmlns="Data"/>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The SOAPEnvelope expected:

<?xml version="1.0" encoding="utf-8"?> <soap:Envelope 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> 
<Authentication xmlns="Data"> <UserName>string</UserName> 
<Password>string</Password> </Authentication> </soap:Header> <soap:Body>

<DataProcessed xmlns="Data" /> </soap:Body> </soap:Envelope>

HELP!!!



At 11:56 AM 6/7/2002 -0400, you wrote:
>Try this method:
>    user.setObjectValue( "Enter any String" );
>
>This creates a tag like the following:
>    <USER>Enter any Sting</USER>
>
>
>best regards
>Matthias Wimmer
>
>

Mime
View raw message