InvalidOperationException when Axis web service returns null array

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Nino Benvenuti (ngbenvenuti_at_spamless-hotmail.com)
Date: 09/30/04


Date: Thu, 30 Sep 2004 18:50:22 -0400

I am working on a .NET CF application that returns an InvalidOperationException
when the Axis(1.1) web service it consumes returns a null array (the return type
of the web service is an array of a complex type - see below).

The situation described here:
http://www.error-bank.com/microsoft.public.dotnet.framework.webservices/3575_Thread.aspx
  is my issue.

Like the individual in that post, I can successfully consume the web service
with a full .NET Framework client without issue (even if a null array is returned).

The fixes in .NET CF 1.0 SP3 (http://blogs.msdn.com/onoj/articles/178293.aspx)
seemed like they might fit our issue, so we installed the .NET CF 1.0 SP3 beta
on to one of our devices (custom device running Windows CE.NET). Unfortunately,
we still experienced the issue.

One item that I thought may be cause for concern is that the namespace of the
object (app.foo.bar.com) and the array of oject (webservices.baz.bar.com) in the
WSDL were different. Might this be an issue?

Here is a snippet from the WSDL (some names have been changed):

   <types>
     <s:schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://app.foo.bar.com">
       <s:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
       <s:complexType name="SomeSpiffyObj">
         <s:sequence>
           <s:element name="SQLTypeName" nillable="true" type="s:string" />
           <s:element name="assetStsInd" nillable="true" type="s:string" />
           <s:element name="finalDest" nillable="true" type="s:string" />
           <s:element name="legNbr" type="s:int" />
           <s:element name="operDate" nillable="true" type="s:dateTime" />
           <s:element name="rteID" nillable="true" type="s:string" />
           <s:element name="schedDTM" nillable="true" type="s:dateTime" />
           <s:element name="tripID" nillable="true" type="s:string" />
         </s:sequence>
       </s:complexType>
     </s:schema>
     <s:schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://webservices.baz.bar.com">
       <s:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
       <s:complexType name="ArrayOf_tns2_SomeSpiffyObj">
         <s:complexContent mixed="false">
           <s:restriction base="soapenc:Array">
             <s:attribute d7p1:arrayType="s0:SomeSpiffyObj[]"
ref="soapenc:arrayType" xmlns:d7p1="http://schemas.xmlsoap.org/wsdl/" />
           </s:restriction>
         </s:complexContent>
       </s:complexType>
     </s:schema>
   </types>

*** End snippet **

If the namespace issue is not a problem, what else might be problematic?

TIA,
Nino



Relevant Pages

  • Re: .NET based SOAP client inter-op issue with Apache Axis based w
    ... I've developed a web service using Apache Axis 1.4 (WSDL shown at the ... defining a ServiceDescriptor array in the WSDL (without the ServiceList ...
    (microsoft.public.dotnet.framework.webservices)
  • RE: Ajax AutoCompleteExtender is Auto-Calculating
    ... You must add apostrophe symbol before and after string inserted in web ... service array. ... AutoCompleteExtender is not the data that resides in the database, ... data being returned by the web service the AutoCompleteExtender consumes. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Problem with WS method returning an array of complex type
    ... Can you change the web service ... > I developped a WS with IBM tools and used the wsdl in Visual Studio> 2003 to add a Web Reference in my client. ... AccountInfo ). ... > Though I got en empty object, when I am calling a method returning an> array of complex type. ...
    (microsoft.public.dotnet.framework)
  • RE: Interesting Problem With WebService results and Repeater Control
    ... The array of items is probably setting up the item class to have fields ... exposed directly instead of properties (which the form binding requires). ... you need to make the proxy use a class that exposes the data ... I have written a web service to provide some back-end functionality to a Web ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Stumped - Strongly Typed Arrays question (with simplified code example)
    ... You can put the array in an ArrayList, ... > When done without a web service, ... > public class ItemCollection: CollectionBase ... int index) ...
    (microsoft.public.dotnet.framework.webservices)