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.Ge tPrimitiveType(XmlQualifiedName typeName, Boolean throwOnUnknown)
at System.Xml.Serialization.XmlSerializationReader.Re adArray(String typeName, String typeNs)
at System.Xml.Serialization.XmlSerializationReader.Re adReferencingElement(String name, String ns, Boolean elementCanBeType, String& fixupReference)
at System.Xml.Serialization.XmlSerializationReader.Re adReferencingElement(String name, String ns, String& fixupReference)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializationReader1.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.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String methodName, Object[] parameters)
at DotNetWSAPITest.MyAPIRpcEnc.MyAPIRpcEncService.who ami(MyPrincipal principal)
at DotNetWSAPITest.DotNetWSAPITest.actualTests(MyPrin cipal 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