ISoapFormatter - System.Xml.XmlException: The root element is missing

  • Thread starter Frederico Guimar?es via DotNetMonster.com
  • Start date
F

Frederico Guimar?es via DotNetMonster.com

Hi,
I'm trying to use the Microsoft.Web.Services2.Messaging.
ISoapFormatter

but I receive this error:
System.Xml.XmlException: The root element is missing.
at System.Xml.XmlTextReader.Read()
at Microsoft.Web.Services2.Xml.XmlSkipDTDReader.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean
preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at Microsoft.Web.Services2.SoapEnvelope.Load(Stream stream)
at
Microsoft.Web.Services2.Messaging.SoapPlainFormatter.Microsoft.Web.Services2.Messaging.ISoapFormatter.Deserialize
(Stream stream)
at WebSemantica.SoapSmtp.Mailbox.EndReceive(IAsyncResult result) in c:\
wsf-projeto+final-julio\wsf-projeto final\websemantica\zutil-soapsmtp\
mailbox.cs:line 307
----------------------------------------------------------
the code I'm using is (line 307 is the last line):

UTF8Encoding encoding = new UTF8Encoding();
SimpleMailMessage m = messagesArray;
ISoapFormatter formatter = new SoapPlainFormatter();
MemoryStream stream = new MemoryStream( encoding.GetBytes( m.TextDataString
) );
envelopes = formatter.Deserialize( stream );
----------------------------------------------------------
if I print the xml (the "m.TextDataString") the result is:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rdf:RDF [
<!ENTITY meetingmaker "http://websemantica.puc-
rio.br/2004/06/meetingmaker/meetingmaker#">
<!ENTITY ical "http://www.w3.org/2002/12/cal/ical#">
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
]>
<soap:Envelope xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-
wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-
open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><wsa:Action>InvokeCoordinator</wsa:Action><wsa:MessageID>uuid:a341e5ea-
e828-43c6-88e0-
d74873ffd0af</wsa:MessageID><wsa:To>urn:websemanticaproxy</wsa:To><wsse:Security><wsu:Timestamp
wsu:Id="Timestamp-89698a3f-20d7-400d-ae99-80583ac02d3b"><wsu:Created>2005-
02-26T17:11:37Z</wsu:Created><wsu:Expires>2005-02-
26T17:16:37Z</wsu:Expires></wsu:Timestamp></wsse:Security></soap:Header><soap:Body><string
xmlns="http://tempuri.org/">
<rdf:RDF
xml:base="&meetingmaker;"
xmlns:meetingmaker="&meetingmaker;"
xmlns:ical="&ical;"
xmlns:rdf="&rdf;"
xmlns:rdfs="&rdfs;"
xmlns:xsd="&xsd;"<meetingmaker:MeetingMaker rdf:ID="meetingmaker_id">
<meetingmaker:criteria
rdf:datatype="&xsd;string">majority</meetingmaker:criteria>
<meetingmaker:algorithm
rdf:datatype="&xsd;string">parallel</meetingmaker:algorithm>
<meetingmaker:uid rdf:datatype="&xsd;string">[email protected]
2005 02:11:35</meetingmaker:uid>
<meetingmaker:vevent>
<ical:Vevent rdf:ID="vevent_id">
<ical:location rdf:datatype="&xsd;string">Puc</ical:location>
<ical:summary rdf:datatype="&xsd;string">Apresentacao de
Trabalho</ical:summary>
<ical:dtstart rdf:datatype="&xsd;datetime">12-10-2004
10:00:00</ical:dtstart>
<ical:dtend rdf:datatype="&xsd;datetime">12-10-2004
11:00:00</ical:dtend>
<ical:contact
rdf:datatype="&xsd;string">[email protected]</ical:contact>
<ical:attende>
<rdf:Bag rdf:ID="vevent_ateende">
<rdf:li rdf:datatype="&xsd;string">[email protected]
rio.br</rdf:li><rdf:li
rdf:datatype="&xsd;string">[email protected]</rdf:li><rdf:li
rdf:datatype="&xsd;string">[email protected]</rdf:li>
</rdf:Bag>
</ical:attende>
</ical:Vevent>
</meetingmaker:vevent>
</meetingmaker:MeetingMaker>
</rdf:RDF></string></soap:Body></soap:Envelope>


(whitch is a valid XML, at least the Internet explorer open it...)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top