I've seen many postings/solutions on this, but none have worked for me.
I have a Java method which returns an custom array type that I published
using Apache Axis 1.3. With a Java client, it is fine. But a C# 2005 client
errors out. I was hoping someone can try it and let me know what is wrong
(or what is wrong with the WSDL)? The WSDL's are:
http://weblogs.trax.aero/WebModuleTraxInterface/services/AC_In_Out_Service_Maste
r_Service?wsdl
The queryRecords function - It returns an array type.
or
http://weblogs.trax.aero/WebModuleTraxInterface/services/Defect_Report_Service?wsdl
Also the queryRecords function... It returns a class which contains inside
an array type.
I've gotten other functions that return classes to work fine... it is only
when it returns an array of them that it fails, and it only fails on a .net
client.
This is the error:
System.InvalidOperationException was unhandled
Message="There is an error in XML document (1, 365007)."
Source="System.Xml"
StackTrace:
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
xmlReader, String encodingStyle, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
xmlReader, String encodingStyle)
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
WindowsApplication1.aero.trax.weblogs2.AC_In_Out_Service_Master_ServiceService.queryRecords
-
Replace nospam with gmail for e-mail.
reez - 20 Dec 2005 14:06 GMT
Hi Luch,
I have encoutered errors like this before. What is happening is there
are some control characters in the XML response that is causing it to
get "confused" which makes no sense (took me three days to figure this
out). Marking your instance vars as CDATA will not help.
In my situation, the application that i was pulling data from made a
call to a dll to get a username. However this was assigned to a
CharArray. When the username was smaller than the length of the
CharArray it padded it with control characters e.g. line feeds,
carriage returns, not sure what it was really. So what i did was i
manually updated the data and edited the code to trim the extra
characters off.
While this might not be your case, you might want to start look at
this...basically your XML output is in error and it's a data problem.
Marking the fields as CDATA is not going to help.
you might want to consider getting web service studio. While you cannot
see everything it is a useful testing tool.
Take care and good luck.
Reeza