471,071 Members | 1,204 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,071 software developers and data experts.

Axis. Object properties are null (serialisation problem?)

Hi All,

I've been going through Google Groups, but nothing seems to quite match
my problem. It's hard to post a WSDL or anything at the moment (it's not
my service, I'm just using it), but maybe someone will be able to make
suggestions anyway.

I'm using .NET, the server is using Axis. The web method I'm calling
returns a simple complex type with two properties - a string and an int.
In the soap envelope, these are set to values fine, but in .NET, they
seem to have default values (as if the object wasn't de-serialised at all).

eg:

s.TestObj test = s.CallMethod();
if (s == null)
{
}
if (s.name == null)
{
}
if (s.number == 0)
{
}

The first test fails (the object is not null), but the second two pass.
The properties are all null.

Does anyone have any suggestions, before I try and get permisson to post
a WSDL/Soap Envelopes?

Thanks,
--
Danny Tuppeny
Nov 23 '05 #1
7 3902
Hi Danny,

You may run into some interop issues if your partner service is designed to
only be called by java clients. In the case of returning a null/nill value
for an int - which is a value type in .NET - you will experience runtime
exceptions if you try and serialize a nill value into an integer. Strings
don't have this problem since these are reference types in .NET.

If you are seeing only null values (or the default value of zero) in your
code, the likely culprit is code that fails to account for or properly mark
the XML being serialized with the right XML namespace information.

Do you have a trace to work with - the raw XML received? From there we can
determine what is happening more readily.

Regards

Dan Rogers
Microsoft Corporation
--------------------
Date: Sun, 05 Dec 2004 17:50:13 +0000
From: Danny Tuppeny <da***@nospam.oops>
User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: microsoft.public.dotnet.framework.webservices
Subject: Axis. Object properties are null (serialisation problem?)
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 34
Message-ID: <41***********************@ptn-nntp-reader03.plus.net>
Organization: Customer of PlusNet plc (http://www.plus.net)
NNTP-Posting-Host: f46fea78.ptn-nntp-reader03.plus.net
X-Trace:
DXC=<naE[_Xic4gF^D@XFNl<:figd3Y`7Rb;n@`8gV4CC7IgT[db>`FM51hF\7F4g>HO4jGa_01j
mm<Wa]>RHBVOV7ok
X-Complaints-To: ab***@plus.net
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.phx.gbl!newsfeed00.s
ul.t-online.de!t-online.de!news.zanker.org!nntp-peering.plus.net!ptn-nntp-fe
eder02.plus.net!ptn-nntp-spool01.plus.net!ptn-nntp-reader03.plus.net!not-for
-mail
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7865
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Hi All,

I've been going through Google Groups, but nothing seems to quite match
my problem. It's hard to post a WSDL or anything at the moment (it's not
my service, I'm just using it), but maybe someone will be able to make
suggestions anyway.

I'm using .NET, the server is using Axis. The web method I'm calling
returns a simple complex type with two properties - a string and an int.
In the soap envelope, these are set to values fine, but in .NET, they
seem to have default values (as if the object wasn't de-serialised at all).

eg:

s.TestObj test = s.CallMethod();
if (s == null)
{
}
if (s.name == null)
{
}
if (s.number == 0)
{
}

The first test fails (the object is not null), but the second two pass.
The properties are all null.

Does anyone have any suggestions, before I try and get permisson to post
a WSDL/Soap Envelopes?

Thanks,
--
Danny Tuppeny

Nov 23 '05 #2
Dan Rogers wrote:
You may run into some interop issues if your partner service is designed to
only be called by java clients. In the case of returning a null/nill value
for an int - which is a value type in .NET - you will experience runtime
exceptions if you try and serialize a nill value into an integer. Strings
don't have this problem since these are reference types in .NET.

If you are seeing only null values (or the default value of zero) in your
code, the likely culprit is code that fails to account for or properly mark
the XML being serialized with the right XML namespace information.

Do you have a trace to work with - the raw XML received? From there we can
determine what is happening more readily.


I posted another thread not long after his one, with all the relevant
info. The suggestions where to change from rcp, but now we've got a
great problem - all return objects are null (though they exist properly
in the envelopes, as objects with properties set) instead of just the
properties being null (default values). We've given up for now - we'll
stick to passing strings around and pipe-delimiting our data. Maybe next
time we'll spend more time debugging it!

Danny
Nov 23 '05 #3
If everything is coming up null, it's almost certain that you are seeing
namespace mismatch.

Good luck

Dan Rogers
Microsoft Corporation
--------------------
Date: Mon, 06 Dec 2004 21:22:10 +0000
From: Danny Tuppeny <da***@nospam.oops>
User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: microsoft.public.dotnet.framework.webservices
Subject: Re: Axis. Object properties are null (serialisation problem?)
References: <41***********************@ptn-nntp-reader03.plus.net>
<S5**************@cpmsftngxa10.phx.gbl>
In-Reply-To: <S5**************@cpmsftngxa10.phx.gbl>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 23
Message-ID: <41***********************@ptn-nntp-reader01.plus.net>
Organization: Customer of PlusNet plc (http://www.plus.net)
NNTP-Posting-Host: ab7d7759.ptn-nntp-reader01.plus.net
X-Trace:
DXC=WnSkl84`nnSa_kifA?aFQVigd3Y`7Rb;^YZmCHj47lfUCL `dM@JUKB\_6hf5GTFZ4SGa_01j
mm<WQ5kK67<7LGb^
X-Complaints-To: ab***@plus.net
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.phx.gbl!newsfeed00.s
ul.t-online.de!t-online.de!news.zanker.org!nntp-peering.plus.net!ptn-nntp-fe
eder01.plus.net!ptn-nntp-spool01.plus.net!ptn-nntp-reader01.plus.net!not-for
-mail
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7916
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Dan Rogers wrote:
You may run into some interop issues if your partner service is designed to only be called by java clients. In the case of returning a null/nill value for an int - which is a value type in .NET - you will experience runtime
exceptions if you try and serialize a nill value into an integer. Strings don't have this problem since these are reference types in .NET.

If you are seeing only null values (or the default value of zero) in your
code, the likely culprit is code that fails to account for or properly mark the XML being serialized with the right XML namespace information.

Do you have a trace to work with - the raw XML received? From there we can determine what is happening more readily.


I posted another thread not long after his one, with all the relevant
info. The suggestions where to change from rcp, but now we've got a
great problem - all return objects are null (though they exist properly
in the envelopes, as objects with properties set) instead of just the
properties being null (default values). We've given up for now - we'll
stick to passing strings around and pipe-delimiting our data. Maybe next
time we'll spend more time debugging it!

Danny

Nov 23 '05 #4
Dan Rogers wrote:
If everything is coming up null, it's almost certain that you are seeing
namespace mismatch.


I've updated all the files here:

http://dantup.me.uk/SoapProb/

Afraid I can't get a copy of the soap envelopes from here, but if you
can see anything with the WSDL, any suggestions would be much appreciated.

Thanks,

Danny
Nov 23 '05 #5
Hi Danny,

I looked at this WSDL, and then tried it out. From what I can see, there
is no web service at the specified URL. Since the WSDL specifices a URL,
this is the one I tried. The URL cannot be resolved (e.g. the SOAP request
is rejected by the server).

I notice that there is no SOAP Action specified... is it possible that your
web service requires a specific SOAP action? I also noted that unqualified
elements are called for... I really need to see the XML that you think is
being returned. If you took the proxy code you have on this site and used
it, I suspect that you are also getting a rejected request - which will
make your ASP.net test script expose a null (I'm assuming you have ignore
all errors enabled in your test environment).

The WSDL itself has some oddities. The schema target namespace and the
WSDL target namespace are identical - and this is also the URL for the
service endpoint. Since each represents a version reference (in the first
two cases) and a service callable end point (the latter case) this is
unusual Regardless, it looks like add-web-reference is doing what you
asked.

Where did this WSDL come from? Did you hand code it? I am not familiar
with how Axis plays with the XML or the SOAP packet on the wire... or did
Axis create this WSDL file for you?

I hope this helps

Dan
--------------------
Date: Tue, 07 Dec 2004 07:48:18 +0000
From: Danny Tuppeny <da***@nospam.oops>
User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: microsoft.public.dotnet.framework.webservices
Subject: Re: Axis. Object properties are null (serialisation problem?)
References: <41***********************@ptn-nntp-reader03.plus.net>
<S5**************@cpmsftngxa10.phx.gbl>
<41***********************@ptn-nntp-reader01.plus.net>
<0D*************@cpmsftngxa10.phx.gbl>
In-Reply-To: <0D*************@cpmsftngxa10.phx.gbl>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 14
Message-ID: <41***********************@ptn-nntp-reader04.plus.net>
Organization: Customer of PlusNet plc (http://www.plus.net)
NNTP-Posting-Host: f7f7a0fe.ptn-nntp-reader04.plus.net
X-Trace:
DXC=H>5SoDSQleZBX8>[M_9^HWigd3Y`7Rb;^3_LeXC3B]SY4j?]]JUIF5P9CE@6OHlA3PGa_01j
mm<WQ@25M[oR06Q[
X-Complaints-To: ab***@plus.net
Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFT NGP08.phx.gbl!newsfeed00.s
ul.t-online.de!t-online.de!news.zanker.org!nntp-peering.plus.net!ptn-nntp-fe
eder01.plus.net!ptn-nntp-spool01.plus.net!ptn-nntp-reader04.plus.net!not-for
-mail
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7934
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Dan Rogers wrote:
If everything is coming up null, it's almost certain that you are seeing
namespace mismatch.


I've updated all the files here:

http://dantup.me.uk/SoapProb/

Afraid I can't get a copy of the soap envelopes from here, but if you
can see anything with the WSDL, any suggestions would be much appreciated.

Thanks,

Danny

Nov 23 '05 #6
Dan Rogers wrote:
Hi Danny,

I looked at this WSDL, and then tried it out. From what I can see, there
is no web service at the specified URL. Since the WSDL specifices a URL,
this is the one I tried. The URL cannot be resolved (e.g. the SOAP request
is rejected by the server).


I replaced our domain with "ourdomain" because I'm not allowed to
publicly post the address (it's a private service, and not written by
our company)!

The WSDL was generated by Axis (minus the domain mods), not hand coded!
Nov 23 '05 #7
Hi Dany,

I tried this and still can't get thru - that's either not the right URL, or
the request is being denied.

If you can email me the URL where the service endpoint is, I can try and
find time this week to play with it.

Regards

Dan
--------------------
Date: Wed, 08 Dec 2004 18:04:58 +0000
From: Danny Tuppeny <da***@nospam.oops>
User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: microsoft.public.dotnet.framework.webservices
Subject: Re: Axis. Object properties are null (serialisation problem?)
References: <41***********************@ptn-nntp-reader03.plus.net>
<S5**************@cpmsftngxa10.phx.gbl>
<41***********************@ptn-nntp-reader01.plus.net>
<0D*************@cpmsftngxa10.phx.gbl>
<41***********************@ptn-nntp-reader04.plus.net>
<wd*************@cpmsftngxa10.phx.gbl>
In-Reply-To: <wd*************@cpmsftngxa10.phx.gbl>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 13
Message-ID: <41***********************@ptn-nntp-reader04.plus.net>
Organization: Customer of PlusNet plc (http://www.plus.net)
NNTP-Posting-Host: e68b321a.ptn-nntp-reader04.plus.net
X-Trace:
DXC=L\8?;e:i9ccBkei3e;9?nmigd3Y`7Rb;n3_LeXC3B]Si4j?]]JUIF5`aLJofYg1JkcGa_01j
mm<WaO6oi6Oi?bFh
X-Complaints-To: ab***@plus.net
Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXS01.phx.gbl!cpmsftn gxa06.phx.gbl!TK2MSFTNGP08
phx.gbl!newsfeed00.sul.t-online.de!t-online.de!news.zanker.org!nntp-peering
plus.net!ptn-nntp-feeder01.plus.net!ptn-nntp-spool01.plus.net!ptn-nntp-read
er04.plus.net!not-for-mail
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7983
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Dan Rogers wrote:
Hi Danny,

I looked at this WSDL, and then tried it out. From what I can see, there
is no web service at the specified URL. Since the WSDL specifices a URL,
this is the one I tried. The URL cannot be resolved (e.g. the SOAP request is rejected by the server).


I replaced our domain with "ourdomain" because I'm not allowed to
publicly post the address (it's a private service, and not written by
our company)!

The WSDL was generated by Axis (minus the domain mods), not hand coded!

Nov 23 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Claus Haslauer | last post: by
3 posts views Thread by parrot toes | last post: by
1 post views Thread by bbalet.free.fr | last post: by
3 posts views Thread by Jeremy Chapman | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.