I built the example application outlined in this artical:
url=/library/en-us/dnservice/html/service02112003 .asp
There were a number of questions along the same lines
posted to the page's discussion forum but no one replied
with a solution.
The problem I am experiencing is with the 3rd example.
On the server you code the following web service:
[WebMethod()]
[return: XmlElement(type of(Items[]))]
public XmlDataDocument GetTypedXmlData Document()
{
sqlDataAdapter1 .Fill(typedData Set1);
XmlDataDocument dataDoc
= new XmlDataDocument (typedDataSet1) ;
return dataDoc;
}
On the client, after adding a reference to the web service
you code:
localhost.Servi ce1 proxy = new localhost.Servi ce1();
localhost.Items[] items = proxy.GetTypedX mlDataDocument( );
string description;
description = items[1].Description;
What the example is attempting to do is to cast the
returned XmlDataDocment xml data stream into an array of
xml elements of type Item.
The web service works when called with 'invoke' from the
automatically generated test web page. Invoke uses the
http protocol. When the web service is called using the
Soap protocol the server returns:
System.Web.Serv ices.Protocols. SoapException: Server was
unable to process request. --->
System.InvalidO perationExcepti on: There was an error
generating the XML document. --->
System.InvalidC astException: Specified cast is not valid.
at
Microsoft.Xml.S erialization.Ge neratedAssembly .XmlSerializat
ionWriter1.Writ e16_Test4Respon se(Object[] p) [...]
Can someone point out why this error is occuring and what
the solution is?
At the end of the day this process creates a wsdl file
that is properly constructed to describe the casted return
object. How is the wsdl generated; what program\api call
is used to generate the wsdl? Is this feature accesible
to anyone other than microsoft and if so where is the
documentation?
Thanks
Mark
url=/library/en-us/dnservice/html/service02112003 .asp
There were a number of questions along the same lines
posted to the page's discussion forum but no one replied
with a solution.
The problem I am experiencing is with the 3rd example.
On the server you code the following web service:
[WebMethod()]
[return: XmlElement(type of(Items[]))]
public XmlDataDocument GetTypedXmlData Document()
{
sqlDataAdapter1 .Fill(typedData Set1);
XmlDataDocument dataDoc
= new XmlDataDocument (typedDataSet1) ;
return dataDoc;
}
On the client, after adding a reference to the web service
you code:
localhost.Servi ce1 proxy = new localhost.Servi ce1();
localhost.Items[] items = proxy.GetTypedX mlDataDocument( );
string description;
description = items[1].Description;
What the example is attempting to do is to cast the
returned XmlDataDocment xml data stream into an array of
xml elements of type Item.
The web service works when called with 'invoke' from the
automatically generated test web page. Invoke uses the
http protocol. When the web service is called using the
Soap protocol the server returns:
System.Web.Serv ices.Protocols. SoapException: Server was
unable to process request. --->
System.InvalidO perationExcepti on: There was an error
generating the XML document. --->
System.InvalidC astException: Specified cast is not valid.
at
Microsoft.Xml.S erialization.Ge neratedAssembly .XmlSerializat
ionWriter1.Writ e16_Test4Respon se(Object[] p) [...]
Can someone point out why this error is occuring and what
the solution is?
At the end of the day this process creates a wsdl file
that is properly constructed to describe the casted return
object. How is the wsdl generated; what program\api call
is used to generate the wsdl? Is this feature accesible
to anyone other than microsoft and if so where is the
documentation?
Thanks
Mark
Comment