473,406 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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 4049
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jeff | last post by:
Hi I have a report with a graph on it and want to change the minimum and maximum values for the value axis when it is previewed. This can't be done by adding code in the Open event as once the...
3
by: Claus Haslauer | last post by:
Hi, I want to create a chart value (y-axis) vs. time (x-axis). In fact very similar to the xy(scatter) example in the graph10.chm help-file. I ran into problems, so I started a very basic *.mdb...
4
by: JLJ | last post by:
I have a very simple webservice written in Java/Axis. It takes in a complexType with 2 string elements, userid and password. The response is a complexType containing two complexTypes each having...
3
by: parrot toes | last post by:
Summary: I have been trying to make requests of a web service provided by Axis using a dotnet client with code generated by wsdl.exe and have been getting exceptions when trying to process the...
7
by: Jamie Phillips | last post by:
I'm sure this topic has been "around the block" a few times, but I have not been able to find ANY solutin that fits this particular problem. I have written a Java Axis web service that has a method...
1
by: bbalet.free.fr | last post by:
Hello, Anyone succeed to make work a .Net WebService client WSE with WSS4J (I always get the error message 'Signature Verification failed') ? On the server my WSDD config is: <deployment...
11
by: David R | last post by:
This is a repost, with additional information. I have a Net 2.0 client (C# Winform) calling an Axis web service. The .NET client can authenticate, create requested objects, serialize the objects...
1
by: David R | last post by:
I am calling an Axis web service from a Net 2.0 client. To be helpful, the developers on the Axis side sent a test client that they created, with snippets below. What I am trying to do is add a...
3
by: Jeremy Chapman | last post by:
I've writtin a very simple web service in axis which returns an array of classes. I consume it in a .net app. When receiving the response, my .net app generates an error "Cannot assign object...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.