473,379 Members | 1,423 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

array deserialization in Axis webservice repsonses

I tried to post this question before, but there was an error when posting.
I case it did get posted and in order to avoid duplication, I'll just repost
a summary.

I have written a dotnet client that accesses a Axis provided web service.
The client uses the code generated, using wsdl.exe, from the wsdl file
provided by the web service provider.

The web response has the following schema (roughly):

public class response {

public string elem1;
public thing[] elem2;


public class thing {
public string thingy1;
public string thingy2;

i.e. the response has an array of custom objects within a custom object.

I do not have access to the server, I can't make changes to it. I may be
able to convince service provider to make changes, though.

When processing the response, I the following is thrown:
System.InvalidOperationException: There is an error in XML document (12,
19). ---> System.InvalidCastException: Cannot assign object of type
System.Object[] to an object of type customertransactions.thing[].
Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializationReader1.Read3_ResponseModel()
System.Xml.Serialization.XmlSerializationReader.Re adReferencingElement(String
name, String ns, Boolean elementCanBeType, String& fixupReference)
at System.Xml.Serialization.XmlSerializationReader.Re adReferencedElements()
Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializationReader1.Read6_walletPaymentResponse()

I've read at
http://www.mail-archive.com/ax******.../msg00195.html that there
are deserialization issues with certain elements. e.g. if the element is an
array of other stuff, but the element is defined as anyType[n], then the
contents may get put into an object array (object[]) instead of into the
appropriate array (thing[]). I would guess from the exception that this is
happening (an that the exception is thrown when the application tries to
assign the object[] to the Response.elem2 property).

I have managed to intercept and modify the SOAP response prior to
The SOAP response does define the offending array element as a anyType[2]. I
even managed to modify the response prior to deserialization and changed it
to thing[2].
When I did that, the exception went away and the response contents were
properly stuffed into the response oject.

My question is this. My solution is ugly and specific to a particular SOAP
I thought that a purpose of webservices and wsdl was to remove the developer
from the loop - the web service details are handled by a wsdl processor and
as such the developer doesn't mess with the details of request formatting and
response parsing.

Is there a way that I am supposed to use wsdl and the resulting proxy class
that will allow me to consume an Axis service with a dotnet client? Is there
a problem with either the dotnet deserialization or the Axis serialization of
Is there a known Axis issue that requires the service provider to adjust
some stuff in order to service dotnet clients?

Thanks for your time.

Nov 21 '05 #1
1 3703
Please diregard my original post in this thread. I noticed that my first
attempt at posting this question did in fact make it onto the discussion
board. Please refer to it, "deserialization arrays in Axis SOAP messages"
posted 11/11/2004, intead.


Nov 21 '05 #2

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

Similar topics

by: Maarten van Reeuwijk | last post by:
I am constructing a "placeholder array" to mimick Numeric arrays. I have a 3D regular structured domain, so I can describe the axis with 3 1D arrays x, y and z. All the variables defined on this...
by: Jacky Zhu | last post by:
Hi all, I am having a problem trying to consume a webservice that is developed on ..Net. I can access it without any problem using a .net client, but when I use a java client (based on Axis...
by: parrot toes | last post by:
Summary: I have been trying to make requests of a web service provided by Axis using a dotnet client with code generated by wsdl.exe and have been getting exceptions when trying to process the...
by: Dhananjayan | last post by:
Hi, I have a webservice(eg.IStringServicePort) running on Axis, iam able to create a java client for the same and invoke the service and obtain the result. I wanted to create a .Net client(C#)...
by: Lucvdv | last post by:
I have to connect to a server set up by the government, where they used Apache Axis to create a webservice. The code I use to interface to the webservice is generated by wsdl.exe, based on a...
by: karazy | last post by:
I have been reading all the forums and understand whats going wrong but am not sure how to fix it. I have written a basic doc/literal web service. But when it is called by a .net client it will...
by: zmbharmal | last post by:
I have a .NET client My vendor has a Axis/Java Webservice I am able to pass the parameters to their webmethod. They can read it. When they return a Response, it is coming as NULL. The webservice...
by: TraceyAnnison | last post by:
I wonder if you can help me - I'm new to this, and working in a project that has already been configured to work with Axis. We have a Java project built with the Spring framework, in order to...
by: Purohit.Amit | last post by:
Hi, I have a AXIS Webservice that is expecting a hashtable as an input. I add the web reference to the webservice and the WSDL that is generated contains the below schema for the HashTable. When I...
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.