.NET not specifying namespace in web reply, but Java/Axis needs it

From: PaulG (google_alias_at_blinkenlights.org)
Date: 02/28/04


Date: 27 Feb 2004 16:19:35 -0800

Greetings,

[In a nutshell, the Java client is throwing an exception because it
doesn't expect the returned type it sees, because the namespace isn't
specified when the .NET side responds.]

I'm trying to get web services running, with C#/.NET on the server and
Java/Axis on the client. I managed to get a remote object returned,
but now that I've created a derived class from the original base, I'm
experiencing problems on the Java side.

I've got a base class Task, and an inherited class SpecialTask, which
I've derived from Task, on the .NET side. GetTask is a web method of
TaskManager, which returns Task, although in my code right now, it's a
SpecialTask that I'm actually returning.

An [XmlInclude(typeof(SpecialTask))] at the top of my GetTask method
in the TaskManger causes a description of SpecialTask to be inserted
into the generated wsdl. It looks right to me.

I created my Java stubs with:

wscompile.bat -f:searchschema -keep -gen config.xml (config.xml
contains reference to the wsdl)

However, when I call from Java, the response I get back contains:

...<GetTaskResponse xmlns="blah"><GetTaskResult
xsi:type="SpecialTask">
   ...
   </GetTaskResult></GetTaskResponse>...

The actual exception the Java side throws starts with:

java.rmi.RemoteException: Runtime exception; nested exception is:
        unexpected element type: expected=, actual=SpecialTask

and from fiddling with the source in the generated stubs, I see that
the Java side isn't working because it's looking for
{mynamespace}SpecialTask (not "" as it claims), but getting
{}SpecialTask which doesn't match. The Java side doesn't see the type
as belonging to any namespace when it reads the response, and I
haven't found a way yet on either side to make changes to compensate
for the other.

Paul



Relevant Pages

  • =?iso-8859-1?q?Re:_Beyond_Java_Tiger_-_Defekte_und_L=FCcken_in_Java?=
    ... > synchronized-Block erweitert und dann eine Bibliothek für Threads zur ... man kann nicht sicher mehrere locks requiren ... > Java machen kann, wenn man denn will. ... > eine Exception soll abgefangen werden damit ich noch ein CleanUp machen ...
    (de.comp.lang.java)
  • .NET not specifying namespace in web reply, but Java/Axis needs it
    ... doesn't expect the returned type it sees, because the namespace isn't ... experiencing problems on the Java side. ... SpecialTask that I'm actually returning. ... The actual exception the Java side throws starts with: ...
    (comp.lang.java.programmer)
  • datetime exception 0xC0000008 JRE 1.4 windows
    ... In Australia, daylight savings is supposed to end at 2am on the last sunday ... sais 2am. ... This exception goes up through the JAVA and kills the program - but only ...
    (comp.lang.java.programmer)
  • Re: datetime exception 0xC0000008 JRE 1.4 windows
    ... > sais 2am. ... because both keys had 3am. ... > This exception goes up through the JAVA and kills the program - but only ...
    (comp.lang.java.programmer)
  • Re: contracted exceptions
    ... The Java experience shows that compiler checked exception ... violated exception contract caused Program_Error to be raised, the original, ...
    (comp.lang.ada)