You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Al...@storebrand.no on 2006/03/24 12:36:12 UTC

Axis does not supply correct namespace in SOAP message

Hi.
I have a WebService running on axis and are trying to consume it from a 
.NET (C#) client, but all I get back is NULL values.

I have search both this mailing list and others and I can see that I am 
not the only one having this problem, but I can't seem to find a real fix 
to the problem.
Some people says I should manually edit the wsdl file and some mean I 
should manualy edit the .NET proxy, but I don't like either solution sinse 
it fixes the
symptom not the real problem. 

The service takes a complex type and an int as input and returns å complex 
type.
In the .wsdd file I have adden a beanMapping that looks like this:

                <beanMapping 
                        xmlns:bedriftws="http://data.foo.bar.company"
                        qname="companyws:FoobarDO" 
 languageSpecificType="java:company.bar.foo.data.FoobarDO"
                />
which puts the type in the http://data.foo.bar.company namespace. 
The default namespace is http://foo.bar.company namespace.
The wsdl file is automatically generated from axis like this: 
http://hostname/webapp/services/FoobarWS?wsdl

The schema definition of the returned object in the wsdl looks like this: 
(The extension base i found in the "http://framework.company" namespace)

            <schema elementFormDefault="qualified" 
targetNamespace="http://data.foo.bar.company" xmlns="
http://www.w3.org/2001/XMLSchema"> 
               <import namespace="http://framework.company"/> 
               <complexType name="FoobarDO"> 
                  <complexContent> 
                     <extension base="tns1:Data"> 
                        <sequence> 
                           <element name="signatur" nillable="true" 
type="xsd:string"/> 
                           <element name="kommentar" nillable="true" 
type="xsd:string"/> 
                        </sequence> 
                     </extension> 
                  </complexContent> 
               </complexType> 

To me it looks like it's located in the correkt namespace as defines in 
the beanMapping in the wsdd file.

The problem is that axis does not send the response in the correkt 
namespace:
Eg. Soap response from axis:

<?xml version="1.0" encoding="utf-8"?>
   <soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="
http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body>
         <hentFoobarResponse xmlns="http://foo.bar.company">
            <hentFoobarReturn>
               <signatur xsi:nil="true"/>
               <kommentar>Viskom testing testing testing</kommentar>
            </hentFoobarReturn>
         </hentFoobarResponse>
      </soapenv:Body>
   </soapenv:Envelope>

Here the .NET client clearly is trying to find objects and values in the 
wrong namespace. The wsdl says it's in http://data.foo.bar.company and 
axis sends it in http://foo.bar.company

I have deployed the same app on a Websphere server (without axis) and this 
works fine. The return message from Websphere looks like this:

<?xml version="1.0" encoding="utf-8"?>
   <soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="
http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="
http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Header/>
      <soapenv:Body>
         <hentFoobarResponse xmlns="http://foo.bar.company">
            <hentFoobarReturn>
               <signatur xsi:nil="true" xmlns="http://data.foo.bar.company
"/>
               <kommentar xmlns="http://data.foo.bar.company">Viskom 
testing testing testing</kommentar>
            </hentFoobarReturn>
         </hentFoobarResponse >
      </soapenv:Body>
   </soapenv:Envelope>

Here the correkt namespace is supplied and the .NET client can read and 
deserialize it correctly.

So my question is:
        1) Is this a bug in axis?
        2) How to I go about fixing this?


Regards Alex

-- 
The content of this e-mail is intended solely for the use of the 
individual or entity to whom it is addressed. If you have received this 
communication in error, be aware that forwarding it, copying it or in any 
way disclosing its content to  any other person, is strictly prohibited. 
If you have received this communication in error, please notify the author 
by replying to this e-mail immediately.This email has been scanned for the 
presence of viruses!   http://www.storebrand.no

Re: Axis does not supply correct namespace in SOAP message

Posted by Anne Thomas Manes <at...@gmail.com>.
It does indeed appear to be a bug. Please file a bug report.

On 3/27/06, Alexander.Vaagan@storebrand.no <Al...@storebrand.no>
wrote:
>
>
> Hi.
> It's a typo in the mail.
> I wanted to make the code "anonymous" sinse it belongs to a customer I
> work for.
> Just replace bedriftws with companyws so it looks like this:
>
> <beanMapping
> xmlns:companyws="*http://data.foo.bar.company*<http://data.foo.bar.company/>
> "
>
> qname="companyws:FoobarDO"
> languageSpecificType="java:company.bar.foo.data.FoobarDO"/>
>
>
> Sorry about that.
> Any ides of what is going on here ?
>
> /Alex
>
>
>
>
>  *"Anne Thomas Manes" <at...@gmail.com>*
>
> 25.03.2006 17:50  Vennligst send svar til
> axis-user@ws.apache.org
>
>   Til
> axis-user@ws.apache.org  cc
>
>  Emne
> Re: Axis does not supply correct namespace in SOAP message
>
>
>
>
>
>
> Just checking... but perhaps you have a typo in your WSDD? In your email
> you say the beanmapping says this:
>
> <beanMapping                         xmlns:bedriftws="*
> http://data.foo.bar.company* <http://data.foo.bar.company/>"
> qname="companyws:FoobarDO"                languageSpecificType="java:
> company.bar.foo.data.FoobarDO"/>
>
> but I think you want it to say this:
>
> <beanMapping
> xmlns:bedriftws="*http://data.foo.bar.company*<http://data.foo.bar.company/>
> "
> qname="bedriftws:FoobarDO"
> languageSpecificType="java:company.bar.foo.data.FoobarDO"/>
>
> Anne
>
> On 3/24/06, *Alexander.Vaagan@storebrand.no*<Al...@storebrand.no><
> *Alexander.Vaagan@storebrand.no* <Al...@storebrand.no>> wrote:
>
> Hi.
> I have a WebService running on axis and are trying to consume it from a
> .NET (C#) client, but all I get back is NULL values.
>
> I have search both this mailing list and others and I can see that I am
> not the only one having this problem, but I can't seem to find a real fix to
> the problem.
> Some people says I should manually edit the wsdl file and some mean I
> should manualy edit the .NET proxy, but I don't like either solution sinse
> it fixes the
> symptom not the real problem.
>
> The service takes a complex type and an int as input and returns å complex
> type.
> In the .wsdd file I have adden a beanMapping that looks like this:
>
>                <beanMapping
>                        xmlns:bedriftws="*http://data.foo.bar.company*<http://data.foo.bar.company/>
> "
>                        qname="companyws:FoobarDO"
>                        languageSpecificType="java:
> company.bar.foo.data.FoobarDO"
>                />
> which puts the type in the *http://data.foo.bar.company *<http://data.foo.bar.company/>namespace.
>
> The default namespace is *http://foo.bar.company *<http://foo.bar.company/>
> namespace.
> The wsdl file is automatically generated from axis like this: *
> http://hostname/webapp/services/FoobarWS?wsdl*<http://hostname/webapp/services/FoobarWS?wsdl>
>
> The schema definition of the returned object in the wsdl looks like this:
> (The extension base i found in the "*http://framework* <http://framework/>
> .company" namespace)
>
>            <schema elementFormDefault="qualified" targetNamespace="http://
> data.foo.bar.company" xmlns="*http://www.w3.org/2001/XMLSchema*<http://www.w3.org/2001/XMLSchema>">
>
>               <import namespace="*http://framework* <http://framework/>
> .company "/>
>               <complexType name="FoobarDO">
>                  <complexContent>
>                     <extension base="tns1:Data">
>                        <sequence>
>                           <element name="signatur" nillable="true"
> type="xsd:string"/>
>                           <element name="kommentar" nillable="true"
> type="xsd:string"/>
>                        </sequence>
>                     </extension>
>                  </complexContent>
>               </complexType>
>
> To me it looks like it's located in the correkt namespace as defines in
> the beanMapping in the wsdd file.
>
> The problem is that axis does not send the response in the correkt
> namespace:
> Eg. Soap response from axis:
>
> <?xml version="1.0" encoding="utf-8"?>
>   <soapenv:Envelope xmlns:soapenv="*http://schemas.xmlsoap.org/soap/envelope/
> * <http://schemas.xmlsoap.org/soap/envelope/>" xmlns:xsd="*
> http://www.w3.org/2001/XMLSchema* <http://www.w3.org/2001/XMLSchema>"
> xmlns:xsi="* http://www.w3.org/2001/XMLSchema-instance*<http://www.w3.org/2001/XMLSchema-instance>
> ">
>      <soapenv:Body>
>         <hentFoobarResponse xmlns="http://foo.bar.company">
>            <hentFoobarReturn>
>               <signatur xsi:nil="true"/>
>               <kommentar>Viskom testing testing testing</kommentar>
>            </hentFoobarReturn>
>         </hentFoobarResponse>
>      </soapenv:Body>
>   </soapenv:Envelope>
>
> Here the .NET client clearly is trying to find objects and values in the
> wrong namespace. The wsdl says it's in http://data.foo.bar.company and
> axis sends it in http://foo.bar.company
>
> I have deployed the same app on a Websphere server (without axis) and this
> works fine. The return message from Websphere looks like this:
>
> <?xml version="1.0" encoding="utf-8"?>
>   <soapenv:Envelope xmlns:soapenv="*http://schemas.xmlsoap.org/soap/envelope/
> * <http://schemas.xmlsoap.org/soap/envelope/>" xmlns:soapenc="*
> http://schemas.xmlsoap.org/soap/encoding/*<http://schemas.xmlsoap.org/soap/encoding/>"
> xmlns:xsd="* http://www.w3.org/2001/XMLSchema*<http://www.w3.org/2001/XMLSchema>"
> xmlns:xsi="*http://www.w3.org/2001/XMLSchema-instance*<http://www.w3.org/2001/XMLSchema-instance>
> ">
>      <soapenv:Header/>
>      <soapenv:Body>
>         <hentFoobarResponse xmlns="http://foo.bar.company">
>            <hentFoobarReturn>
>               <signatur xsi:nil="true" xmlns="http://data.foo.bar.company
> "/>
>               <kommentar xmlns="http://data.foo.bar.company">Viskom
> testing testing testing</kommentar>
>            </hentFoobarReturn>
>         </hentFoobarResponse >
>      </soapenv:Body>
>   </soapenv:Envelope>
>
> Here the correkt namespace is supplied and the .NET client can read and
> deserialize it correctly.
>
> So my question is:
>        1) Is this a bug in axis?
>        2) How to I go about fixing this?
>
>
> Regards Alex
>
> --
> The content of this e-mail is intended solely for the use of the
> individual or entity to whom it is addressed. If you have received this
> communication in error, be aware that forwarding it, copying it or in any
> way disclosing its content to  any other person, is strictly prohibited. If
> you have received this communication in error, please notify the author by
> replying to this e-mail immediately.This email has been scanned for the
> presence of viruses!   *http://www.storebrand.no*<http://www.storebrand.no/>
>
>
> --
> The content of this e-mail is intended solely for the use of the
> individual or entity to whom it is addressed. If you have received this
> communication in error, be aware that forwarding it, copying it or in any
> way disclosing its content to  any other person, is strictly prohibited. If
> you have received this communication in error, please notify the author by
> replying to this e-mail immediately.This email has been scanned for the
> presence of viruses!   http://www.storebrand.no
>

Re: Axis does not supply correct namespace in SOAP message

Posted by Al...@storebrand.no.
Hi.
It's a typo in the mail. 
I wanted to make the code "anonymous" sinse it belongs to a customer I 
work for.
Just replace bedriftws with companyws so it looks like this:

<beanMapping 
xmlns:companyws="http://data.foo.bar.company" 
qname="companyws:FoobarDO" 
languageSpecificType="java:company.bar.foo.data.FoobarDO"/>


Sorry about that.
Any ides of what is going on here ?

/Alex





"Anne Thomas Manes" <at...@gmail.com> 
25.03.2006 17:50
Vennligst send svar til
axis-user@ws.apache.org


Til
axis-user@ws.apache.org
cc

Emne
Re: Axis does not supply correct namespace in SOAP message






Just checking... but perhaps you have a typo in your WSDD? In your email 
you say the beanmapping says this: 

<beanMapping                         xmlns:bedriftws="
http://data.foo.bar.company" 
qname="companyws:FoobarDO" 
languageSpecificType="java:company.bar.foo.data.FoobarDO"/>

but I think you want it to say this:

<beanMapping 
xmlns:bedriftws="http://data.foo.bar.company" 
qname="bedriftws:FoobarDO" 
languageSpecificType="java:company.bar.foo.data.FoobarDO"/>

Anne

On 3/24/06, Alexander.Vaagan@storebrand.no <Alexander.Vaagan@storebrand.no
> wrote:

Hi. 
I have a WebService running on axis and are trying to consume it from a 
.NET (C#) client, but all I get back is NULL values. 

I have search both this mailing list and others and I can see that I am 
not the only one having this problem, but I can't seem to find a real fix 
to the problem. 
Some people says I should manually edit the wsdl file and some mean I 
should manualy edit the .NET proxy, but I don't like either solution sinse 
it fixes the 
symptom not the real problem. 

The service takes a complex type and an int as input and returns å complex 
type. 
In the .wsdd file I have adden a beanMapping that looks like this: 

                <beanMapping 
                        xmlns:bedriftws="http://data.foo.bar.company" 
                        qname="companyws:FoobarDO" 
 languageSpecificType="java:company.bar.foo.data.FoobarDO" 
                /> 
which puts the type in the http://data.foo.bar.company namespace. 
The default namespace is http://foo.bar.company namespace. 
The wsdl file is automatically generated from axis like this: 
http://hostname/webapp/services/FoobarWS?wsdl 

The schema definition of the returned object in the wsdl looks like this: 
(The extension base i found in the "http://framework.company" namespace) 

            <schema elementFormDefault="qualified" 
targetNamespace="http://data.foo.bar.company" xmlns="
http://www.w3.org/2001/XMLSchema"> 
               <import namespace="http://framework.company "/> 
               <complexType name="FoobarDO">     
                  <complexContent> 
                     <extension base="tns1:Data">       
                        <sequence> 
                           <element name="signatur" nillable="true" 
type="xsd:string"/> 
                           <element name="kommentar" nillable="true" 
type="xsd:string"/> 
                        </sequence> 
                     </extension>     
                  </complexContent> 
               </complexType>   

To me it looks like it's located in the correkt namespace as defines in 
the beanMapping in the wsdd file. 

The problem is that axis does not send the response in the correkt 
namespace: 
Eg. Soap response from axis: 

<?xml version="1.0" encoding="utf-8"?> 
   <soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/ " xmlns:xsd="
http://www.w3.org/2001/XMLSchema" xmlns:xsi=" 
http://www.w3.org/2001/XMLSchema-instance"> 
      <soapenv:Body> 
         <hentFoobarResponse xmlns="http://foo.bar.company"> 
            <hentFoobarReturn> 
               <signatur xsi:nil="true"/> 
               <kommentar>Viskom testing testing testing</kommentar> 
            </hentFoobarReturn> 
         </hentFoobarResponse> 
      </soapenv:Body> 
   </soapenv:Envelope> 

Here the .NET client clearly is trying to find objects and values in the 
wrong namespace. The wsdl says it's in http://data.foo.bar.company and 
axis sends it in http://foo.bar.company 

I have deployed the same app on a Websphere server (without axis) and this 
works fine. The return message from Websphere looks like this: 

<?xml version="1.0" encoding="utf-8"?> 
   <soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/ " xmlns:soapenc="
http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd=" 
http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"> 
      <soapenv:Header/> 
      <soapenv:Body> 
         <hentFoobarResponse xmlns="http://foo.bar.company"> 
            <hentFoobarReturn> 
               <signatur xsi:nil="true" xmlns="http://data.foo.bar.company
"/> 
               <kommentar xmlns="http://data.foo.bar.company">Viskom 
testing testing testing</kommentar> 
            </hentFoobarReturn> 
         </hentFoobarResponse > 
      </soapenv:Body> 
   </soapenv:Envelope> 

Here the correkt namespace is supplied and the .NET client can read and 
deserialize it correctly. 

So my question is: 
        1) Is this a bug in axis? 
        2) How to I go about fixing this? 


Regards Alex 

-- 
The content of this e-mail is intended solely for the use of the 
individual or entity to whom it is addressed. If you have received this 
communication in error, be aware that forwarding it, copying it or in any 
way disclosing its content to  any other person, is strictly prohibited. 
If you have received this communication in error, please notify the author 
by replying to this e-mail immediately.This email has been scanned for the 
presence of viruses!   http://www.storebrand.no 


-- 
The content of this e-mail is intended solely for the use of the 
individual or entity to whom it is addressed. If you have received this 
communication in error, be aware that forwarding it, copying it or in any 
way disclosing its content to  any other person, is strictly prohibited. 
If you have received this communication in error, please notify the author 
by replying to this e-mail immediately.This email has been scanned for the 
presence of viruses!   http://www.storebrand.no

Re: Axis does not supply correct namespace in SOAP message

Posted by Anne Thomas Manes <at...@gmail.com>.
Just checking... but perhaps you have a typo in your WSDD? In your email you
say the beanmapping says this:

<beanMapping                        xmlns:bedriftws="
http://data.foo.bar.company"
qname="companyws:FoobarDO"                languageSpecificType="java:
company.bar.foo.data.FoobarDO"/>

but I think you want it to say this:

<beanMapping
xmlns:bedriftws="http://data.foo.bar.company"
qname="bedriftws:FoobarDO"
languageSpecificType="java:company.bar.foo.data.FoobarDO"/>

Anne

On 3/24/06, Alexander.Vaagan@storebrand.no <Al...@storebrand.no>
wrote:
>
>
> Hi.
> I have a WebService running on axis and are trying to consume it from a
> .NET (C#) client, but all I get back is NULL values.
>
> I have search both this mailing list and others and I can see that I am
> not the only one having this problem, but I can't seem to find a real fix to
> the problem.
> Some people says I should manually edit the wsdl file and some mean I
> should manualy edit the .NET proxy, but I don't like either solution sinse
> it fixes the
> symptom not the real problem.
>
> The service takes a complex type and an int as input and returns å complex
> type.
> In the .wsdd file I have adden a beanMapping that looks like this:
>
>                 <beanMapping
>                         xmlns:bedriftws="http://data.foo.bar.company"
>                         qname="companyws:FoobarDO"
>                         languageSpecificType="java:
> company.bar.foo.data.FoobarDO"
>                 />
> which puts the type in the http://data.foo.bar.company namespace.
> The default namespace is http://foo.bar.company namespace.
> The wsdl file is automatically generated from axis like this:
> http://hostname/webapp/services/FoobarWS?wsdl
>
> The schema definition of the returned object in the wsdl looks like this:
> (The extension base i found in the "http://framework.company" namespace)
>
>             <schema elementFormDefault="qualified"
> targetNamespace="http://data.foo.bar.company" xmlns="
> http://www.w3.org/2001/XMLSchema">
>                <import namespace="http://framework.company"/>
>                <complexType name="FoobarDO">
>                   <complexContent>
>                      <extension base="tns1:Data">
>                         <sequence>
>                            <element name="signatur" nillable="true"
> type="xsd:string"/>
>                            <element name="kommentar" nillable="true"
> type="xsd:string"/>
>                         </sequence>
>                      </extension>
>                   </complexContent>
>                </complexType>
>
> To me it looks like it's located in the correkt namespace as defines in
> the beanMapping in the wsdd file.
>
> The problem is that axis does not send the response in the correkt
> namespace:
> Eg. Soap response from axis:
>
> <?xml version="1.0" encoding="utf-8"?>
>    <soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="
> http://www.w3.org/2001/XMLSchema" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance">
>       <soapenv:Body>
>          <hentFoobarResponse xmlns="http://foo.bar.company">
>             <hentFoobarReturn>
>                <signatur xsi:nil="true"/>
>                <kommentar>Viskom testing testing testing</kommentar>
>             </hentFoobarReturn>
>          </hentFoobarResponse>
>       </soapenv:Body>
>    </soapenv:Envelope>
>
> Here the .NET client clearly is trying to find objects and values in the
> wrong namespace. The wsdl says it's in http://data.foo.bar.company and
> axis sends it in http://foo.bar.company
>
> I have deployed the same app on a Websphere server (without axis) and this
> works fine. The return message from Websphere looks like this:
>
> <?xml version="1.0" encoding="utf-8"?>
>    <soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="
> http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="
> http://www.w3.org/2001/XMLSchema" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance">
>       <soapenv:Header/>
>       <soapenv:Body>
>          <hentFoobarResponse xmlns="http://foo.bar.company">
>             <hentFoobarReturn>
>                <signatur xsi:nil="true" xmlns="http://data.foo.bar.company
> "/>
>                <kommentar xmlns="http://data.foo.bar.company">Viskom
> testing testing testing</kommentar>
>             </hentFoobarReturn>
>          </hentFoobarResponse >
>       </soapenv:Body>
>    </soapenv:Envelope>
>
> Here the correkt namespace is supplied and the .NET client can read and
> deserialize it correctly.
>
> So my question is:
>         1) Is this a bug in axis?
>         2) How to I go about fixing this?
>
>
> Regards Alex
>
> --
> The content of this e-mail is intended solely for the use of the
> individual or entity to whom it is addressed. If you have received this
> communication in error, be aware that forwarding it, copying it or in any
> way disclosing its content to  any other person, is strictly prohibited. If
> you have received this communication in error, please notify the author by
> replying to this e-mail immediately.This email has been scanned for the
> presence of viruses!   http://www.storebrand.no
>