473,765 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4090
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.o ops>
User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: microsoft.publi c.dotnet.framew ork.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.n et>
Organization: Customer of PlusNet plc (http://www.plus.net)
NNTP-Posting-Host: f46fea78.ptn-nntp-reader03.plus.n et
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.ph x.gbl!TK2MSFTFE ED01.phx.gbl!TK 2MSFTNGP08.phx. gbl!newsfeed00. s
ul.t-online.de!t-online.de!news. zanker.org!nntp-peering.plus.ne t!ptn-nntp-fe
eder02.plus.net !ptn-nntp-spool01.plus.ne t!ptn-nntp-reader03.plus.n et!not-for
-mail
Xref: cpmsftngxa10.ph x.gbl
microsoft.publi c.dotnet.framew ork.webservices :7865
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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.o ops>
User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
Subject: Re: Axis. Object properties are null (serialisation problem?)
References: <41************ ***********@ptn-nntp-reader03.plus.n et>
<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.n et>
Organization: Customer of PlusNet plc (http://www.plus.net)
NNTP-Posting-Host: ab7d7759.ptn-nntp-reader01.plus.n et
X-Trace:
DXC=WnSkl84`nnS a_kifA?aFQVigd3 Y`7Rb;^YZmCHj47 lfUCL`dM@JUKB\_ 6hf5GTFZ4SGa_01 j
mm<WQ5kK67<7LGb ^
X-Complaints-To: ab***@plus.net
Path:
cpmsftngxa10.ph x.gbl!TK2MSFTFE ED01.phx.gbl!TK 2MSFTNGP08.phx. gbl!newsfeed00. s
ul.t-online.de!t-online.de!news. zanker.org!nntp-peering.plus.ne t!ptn-nntp-fe
eder01.plus.net !ptn-nntp-spool01.plus.ne t!ptn-nntp-reader01.plus.n et!not-for
-mail
Xref: cpmsftngxa10.ph x.gbl
microsoft.publi c.dotnet.framew ork.webservices :7916
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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.o ops>
User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
Subject: Re: Axis. Object properties are null (serialisation problem?)
References: <41************ ***********@ptn-nntp-reader03.plus.n et>
<S5************ **@cpmsftngxa10 .phx.gbl>
<41************ ***********@ptn-nntp-reader01.plus.n et>
<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.n et>
Organization: Customer of PlusNet plc (http://www.plus.net)
NNTP-Posting-Host: f7f7a0fe.ptn-nntp-reader04.plus.n et
X-Trace:
DXC=H>5SoDSQleZ BX8>[M_9^HWigd3Y`7Rb ;^3_LeXC3B]SY4j?]]JUIF5P9CE@6OHlA 3PGa_01j
mm<WQ@25M[oR06Q[
X-Complaints-To: ab***@plus.net
Path:
cpmsftngxa10.ph x.gbl!TK2MSFTNG XA03.phx.gbl!TK 2MSFTNGP08.phx. gbl!newsfeed00. s
ul.t-online.de!t-online.de!news. zanker.org!nntp-peering.plus.ne t!ptn-nntp-fe
eder01.plus.net !ptn-nntp-spool01.plus.ne t!ptn-nntp-reader04.plus.n et!not-for
-mail
Xref: cpmsftngxa10.ph x.gbl
microsoft.publi c.dotnet.framew ork.webservices :7934
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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.o ops>
User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
Subject: Re: Axis. Object properties are null (serialisation problem?)
References: <41************ ***********@ptn-nntp-reader03.plus.n et>
<S5************ **@cpmsftngxa10 .phx.gbl>
<41************ ***********@ptn-nntp-reader01.plus.n et>
<0D************ *@cpmsftngxa10. phx.gbl>
<41************ ***********@ptn-nntp-reader04.plus.n et>
<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.n et>
Organization: Customer of PlusNet plc (http://www.plus.net)
NNTP-Posting-Host: e68b321a.ptn-nntp-reader04.plus.n et
X-Trace:
DXC=L\8?;e:i9cc Bkei3e;9?nmigd3 Y`7Rb;n3_LeXC3B]Si4j?]]JUIF5`aLJofYg1J kcGa_01j
mm<WaO6oi6Oi?bF h
X-Complaints-To: ab***@plus.net
Path:
cpmsftngxa10.ph x.gbl!TK2MSFTNG XS01.phx.gbl!cp msftngxa06.phx. gbl!TK2MSFTNGP0 8
phx.gbl!newsfee d00.sul.t-online.de!t-online.de!news. zanker.org!nntp-peering
plus.net!ptn-nntp-feeder01.plus.n et!ptn-nntp-spool01.plus.ne t!ptn-nntp-read
er04.plus.net!n ot-for-mail
Xref: cpmsftngxa10.ph x.gbl
microsoft.publi c.dotnet.framew ork.webservices :7983
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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
4591
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 report has started printing the properties can't be changed. It can be done with an MDB by opening it in design mode hidden, making the change, saving it and then opening it in preview mode. However, this obviously doesn't work in an MDE which...
3
3692
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 file. It contains one table with ID, Date, and Price (Value) Column ID is automatically assigned Date is in the short date format
4
6316
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 2 strings <wsdl:portType name=SecurityLoginService"> <wsdl:operation name="login"> <wsdl:input message="tns:loginRequest" name="loginRequest"/> <wsdl:output message="tns:loginResponse" name="loginResponse"/> </wsdl:operation> </wsdl:portType>
3
9795
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 response. As a result of seraching news groups I guessed that the SOAP response defines an array element in a way that causes the dotnet deserialization routines to put the content in a generic object array (object) BUT the content is supposed to...
7
8898
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 which returns an object with the following characteristics: public class MMPerson { public string firstName; public string surname; public int age; public MMAddress address;
1
6610
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 xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> <globalConfiguration>
11
3251
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 and send. These are received without issue on the Axis server. The .NET client can also receive responses from the Axis web service when the response is a single value type (long, string, etc), or an array of value types. However if an object...
1
2695
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 document to a workplan object, and return the object. I can return the object okay, but do not see how I can do this with .NET. I was expecting something like an attachfile method that returns an array of bytes. I have the WSE 3.0 installed.
3
6097
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 of type System.Object to an object of type PersonWS.WorkGroupData.". I've included the wsdl of the consumed axis web service, the request/responses of the web service by the .net app and the exception and stack trace. Hoping someone can tell me...
0
9568
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10156
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9951
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7375
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5275
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2805
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.