473,586 Members | 2,463 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Nullable primitives from Java webservice received as null in .Net

I'm experience problems very similar to those reported in this thread on
dotnet.framewor k on May 16 at
(http://groups.google.com/group/micro..._26ZoVcD0w9aA).
Steven Cheng from MS was involved in the discussion, but it didn't seem that
there was a resolution on the group.

We have a Java web service which is using Java objects for the equivalent
primitives so they can be null (ie: java.lang.Integ er, Boolean, etc). What we
find is that the first instance of each unique value for the field will be
received correctly by our .Net client. However, subsequent values are
received as null, even when values are actually specified. Here is a snippet
of the xml received by the client which shows the problem:

<schonbucherPar ams i:type="wn11:Sc honbucherParams View">
<bucketLength i:type="d:int" n1:id="6">100</bucketLength>
<integrationNum berOfSteps n1:ref="6" />
</schonbucherPara ms>

Both values should be received as 100. However, bucketLength is received as
100, while integrationNumb erOfSteps is received as null. It looks as if the
second value is making a reference to the first instance of "100" through
n1:ref="6", but the reference is not being followed by the .Net client, so it
sees no value and gives it null.

The WSDL for integrationNumb erOfSteps is:

<xsd:element name="integrati onNumberOfSteps " nillable="true" type="xsd:int" />

It seems to me that the .Net client is seeing "xsd:int" as the type and
treating it as a primitive, and therefore not following the references.

Does anyone have any suggestions for ways to fix this problem? We have
little to no control over the WSDL and soap implementation of the server.
We're use WSE 3.0 on the client. The only option we can think of is making
our own wrapper classes for the primitive types so that they will be
serialized as objects without being recognised as having an underlying
primitive type.

Thanks,

Niall
Aug 8 '06 #1
5 3624
Hello Niall,

Yes, there does existing some existing thread discussing on the similar
issues in the newsgroup. I remember the issue you refered is related to a
custmo value object's boolean member, and we haven' been able to get
progress in that thread. For your scenario, I've got that you're just
sending some primitive values as web method's parameters. I think your
analysis below is reasonable

=============== =
It seems to me that the .Net client is seeing "xsd:int" as the type and
treating it as a primitive, and therefore not following the references.
=============== =

Actually, such problems mostly occurs when the webservice is defined as
"Rpc/Encoded" format instead of "Document/Literal", rpc/encoded style SOAP
message is likely causing interop issues since the client ans server are
difficult to followup a consistent SOAP message format(through XSD schema).
Since you're using .net 2.0(WSE 3.0), have you tried manually modify the
.net client proxy code and change the parameter object's type to Nullable
types in .net 2.0? This can help wrapper a primitive type in .net as a
reference type(without using a wrapper class).

#Nullable Class
http://msdn2.microsoft.com/en-us/library/fs5xdbk8.aspx

Also, I'm wondering whether it is convenient that you provide me a publich
accessible service endpoint address (demonstrate your current java
service). If so, I'd like to perform some local tests against it.

Please let me know if you have any other concerns.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.
Aug 9 '06 #2
Hi Steven,

We use the WSDL tool to generate the webservice proxy, and out of the box,
it's generating the nullable types (int? in this case). So there aren't any
issues when dealing with actual nulls when they occur.

I've talked with our Java server guys and apparently we're stuck with
RCP/encoded, as we have quite complex and large object graphs in the data
that we send, including bidirectional relationships (ie parent <=child).
The size of the SOAP messages are already a performance issue for us
(surprise surprise), so any extra data in the messages would unfortunately
only make it worse, even if we did manage to avoid the bidirectional
relationships.

As for publishing the service, unfortunately I don't think that can happen.
I work at a bank, so I'm a long way behind a firewall and don't have the
privileges to make any services public.

Thanks for your help so far. It's looking like our best/only option is to
creata small wrapper classes around the nullable primitives that we use, and
provide implicit conversions on the .Net side. It could be worse.

Niall

"Steven Cheng[MSFT]" wrote:
Hello Niall,

Yes, there does existing some existing thread discussing on the similar
issues in the newsgroup. I remember the issue you refered is related to a
custmo value object's boolean member, and we haven' been able to get
progress in that thread. For your scenario, I've got that you're just
sending some primitive values as web method's parameters. I think your
analysis below is reasonable

=============== =
It seems to me that the .Net client is seeing "xsd:int" as the type and
treating it as a primitive, and therefore not following the references.
=============== =

Actually, such problems mostly occurs when the webservice is defined as
"Rpc/Encoded" format instead of "Document/Literal", rpc/encoded style SOAP
message is likely causing interop issues since the client ans server are
difficult to followup a consistent SOAP message format(through XSD schema).
Since you're using .net 2.0(WSE 3.0), have you tried manually modify the
.net client proxy code and change the parameter object's type to Nullable
types in .net 2.0? This can help wrapper a primitive type in .net as a
reference type(without using a wrapper class).

#Nullable Class
http://msdn2.microsoft.com/en-us/library/fs5xdbk8.aspx

Also, I'm wondering whether it is convenient that you provide me a publich
accessible service endpoint address (demonstrate your current java
service). If so, I'd like to perform some local tests against it.

Please let me know if you have any other concerns.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights
Aug 9 '06 #3
Thanks for your reply Niall,

Yes, I can understand your decision since RPC/encoded does has performance
advantage since it act much more like the binary programming model(which
can use reference to avoid duplicated data).

Anyway, I also agree that using a wrapper should be the reasonable solution
for this case. If there is anything else we can help later, please feel
free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Aug 10 '06 #4
Thanks Steven. I'm sure all of this would be simpler (and faster!) if we were
using C# services as well as client (or Java server, Java client, but then I
wouldn't have a job). Unfortunately that's not my decision :(

Niall

"Steven Cheng[MSFT]" wrote:
Thanks for your reply Niall,

Yes, I can understand your decision since RPC/encoded does has performance
advantage since it act much more like the binary programming model(which
can use reference to avoid duplicated data).

Anyway, I also agree that using a wrapper should be the reasonable solution
for this case. If there is anything else we can help later, please feel
free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights
Aug 11 '06 #5
Yes, I can fully understand.

Good luck!

Steven Cheng

Microsoft MSDN Online Support Lead
Aug 14 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
6799
by: Ravi Tallury | last post by:
Hi We are having issues with our application, certain portions of it stop responding while the rest of the application is fine. I am attaching the Java Core dump. If someone can let me know what the issue is. Thanks Ravi
1
1001
by: Ron | last post by:
I posted this to 'questions' yesterday instead of 'general' by mistake. Sorry if anyone received duplicates. ---------------------------------------------------- Mandatories: Ver 7.3.4, Redhat Linux 8.0, P4, 2GB RAM I want to add a 'nullable' foreign key to a column in a table. I have tables "company" and "project" which may be related by...
9
3247
by: Mark Rae | last post by:
Hi, I posted a couple of days ago about the possibility of "simulating" in ..NET1.1 the nullable datatypes available in .NET2.0 - I'm nearly there, but require a bit more guidance. Basically, I have a class file which contains the various class definitions, as follows: using System;
0
1167
by: Andrej | last post by:
hi, i have a java webservice which i would like to invoke from .net Application. i am able to generate the proxy class, but if i try to invoke the webservice i got an exception of type "java.lang.Nullpointer". if i run the webservice in the debugmode i got an exception: Message="Tried to invoke method public byte...
0
4160
by: pranesh.nayak | last post by:
Hello Group, (tech: C#, VS2005) I'm facing a problem in passing Nullable<DateTimeto a webservice. Below is code in webservice wrapper (reference.cs) used set/get date. When i set date value WS.PropertyDateTime = DateTime.Now();
5
51591
by: GG | last post by:
I am trying to add a nullable datetime column to a datatable fails. I am getting exception DataSet does not support System.Nullable<>. None of these works dtSearchFromData.Columns.Add( new DataColumn( "StartDate", typeof( DateTime? ) ) ); dtSearchFromData.Columns.Add( new DataColumn( "EndDate", typeof( System.Nullable<DateTime>) ) ); Any...
5
6509
by: John Grandy | last post by:
Is it considered good practice to perform a switch operation on nullable types ?
20
2414
by: sarnold | last post by:
Hello, I am proposing to create two new keywords for C, 'notnull' and 'nullable'. Their meaning is a sort of 'design by contract', ensuring some rules are verified at compile-time. It should not require additional runtime- checks to be implemented. I have posted my description of how it should work at this URL:
2
180
by: Tony Johansson | last post by:
Hello! These two declarations(1 and 2) are the same I assume. 1. System.Nullable<intnullable; 2. System.Nullable<intnullable = new System.Nullable<int(); So because these 1 and 2 are the same is no point to use the longer declaration as 2 it good enough to use decaration 1.
0
7915
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...
0
7841
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8204
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. ...
0
8339
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7965
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...
1
5712
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...
1
2345
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
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1184
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...

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.