VB client can't access results from Axis 1.2 service returning arr

Discussion in 'Microsoft Dot NET' started by Guest, Aug 3, 2004.

  1. Guest

    Guest Guest

    Hi!

    I have a VB .NET client that is accessing an rpc/encoded service deployed in Axis 1.2. One of the operations, whoami, returns a string array. The server-side Java signature of this method is
    String[] whoami(MyPrincipal principal)
    My .NET client is unable to access the results of that array. The odd thing is that the very same client was able to access the results when the same service was deloyed in Axis 1.1. I've asked the Axis folks what the problem may be and they insist that the response sent by Axis 1.2 is correct. According to them Axis 1.1 may have had a bug and .NET just accidentally happened to work. Below I show a snippet of the response that causes a problem.

    When the VB .NET client accessed the same operation with Axis 1.1, the response snippet looked like this:
    <ns1:whoamiResponse
    soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:ns1="urn:MyAPIRpcEnc">
    <whoamiReturn soapenc:arrayType="xsd:string[9]"
    xsi:type="soapenc:Array"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    ...

    When the same VB .NET client accesses the same operation with Axis 1.2, the response looks like this:
    <ns1:whoamiResponse
    soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:ns1="urn:MyAPIRpcEnc">
    <whoamiReturn soapenc:arrayType="soapenc:string[9]"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    ...

    As you can see the only significant difference is the namespace associated with "string" in the whoamiReturn segment - with 1.1 it is "xsd", and with 1.2 it is "soapenc".

    The client works as expected with 1.1. With 1.2, when the whoami operation is executed, VB responds with the following error:
    Unhandled Exception: System.InvalidOperationException: There is an error in XML
    document (1, 308). ---> System.InvalidOperationException: The specified type was
    not recognized: name='string', namespace='http://schemas.xmlsoap.org/soap/encoding/', at <whoamiReturn xmlns=''>.
    at System.Xml.Serialization.XmlSerializationReader.GetPrimitiveType(XmlQualifiedName typeName, Boolean throwOnUnknown)
    at System.Xml.Serialization.XmlSerializationReader.ReadArray(String typeName, String typeNs)
    at System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(String name, String ns, Boolean elementCanBeType, String& fixupReference)
    at System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(String name, String ns, String& fixupReference)
    at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read70_whoamiResponse()
    --- End of inner exception stack trace ---
    at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
    at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)
    at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
    at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
    at DotNetWSAPITest.MyAPIRpcEnc.MyAPIRpcEncService.whoami(MyPrincipal principal)
    at DotNetWSAPITest.DotNetWSAPITest.actualTests(MyPrincipal principal)
    at DotNetWSAPITest.DotNetWSAPITest.testMyWSAPI()
    at DotNetWSAPITest.DotNetWSAPITest.Main()

    Any ideas why this may be happening? Why isn't .NET able to recognise the namespace for "string"?

    Thanks!

    Anand
     
    Guest, Aug 3, 2004
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    0
    Views:
    735
    Guest
    Feb 12, 2004
  2. matt breedlove

    Returning error during service startup

    matt breedlove, Apr 12, 2004, in forum: Microsoft Dot NET
    Replies:
    4
    Views:
    230
    Cor Ligthert
    Apr 12, 2004
  3. Guest
    Replies:
    1
    Views:
    168
    Guest
    Aug 4, 2004
  4. Guest
    Replies:
    3
    Views:
    614
    Steven Cheng[MSFT]
    Jan 7, 2005
  5. Nate
    Replies:
    0
    Views:
    511
  6. JohnFol

    Directory.Exists returning wrong results

    JohnFol, May 18, 2005, in forum: Microsoft Dot NET
    Replies:
    2
    Views:
    326
    Ivan Zuzak
    May 19, 2005
  7. Guest
    Replies:
    2
    Views:
    407
    Robbe Morris [C# MVP]
    Jul 15, 2005
  8. Alexiel
    Replies:
    0
    Views:
    422
    Alexiel
    Mar 2, 2006
Loading...