Hi,
I'm trying to use the Microsoft.Web.S ervices2.Messag ing.
ISoapFormatter
but I receive this error:
System.Xml.XmlE xception: The root element is missing.
at System.Xml.XmlT extReader.Read( )
at Microsoft.Web.S ervices2.Xml.Xm lSkipDTDReader. Read()
at System.Xml.XmlL oader.Load(XmlD ocument doc, XmlReader reader, Boolean
preserveWhitesp ace)
at System.Xml.XmlD ocument.Load(Xm lReader reader)
at Microsoft.Web.S ervices2.SoapEn velope.Load(Str eam stream)
at
Microsoft.Web.S ervices2.Messag ing.SoapPlainFo rmatter.Microso ft.Web.Services 2.Messaging.ISo apFormatter.Des erialize
(Stream stream)
at WebSemantica.So apSmtp.Mailbox. EndReceive(IAsy ncResult result) in c:\
wsf-projeto+final-julio\wsf-projeto final\websemant ica\zutil-soapsmtp\
mailbox.cs:line 307
----------------------------------------------------------
the code I'm using is (line 307 is the last line):
UTF8Encoding encoding = new UTF8Encoding();
SimpleMailMessa ge m = messagesArray[i];
ISoapFormatter formatter = new SoapPlainFormat ter();
MemoryStream stream = new MemoryStream( encoding.GetByt es( m.TextDataStrin g
) );
envelopes[i] = formatter.Deser ialize( stream );
----------------------------------------------------------
if I print the xml (the "m.TextDataStri ng") the result is:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rdf:RDF [
<!ENTITY meetingmaker "http://websemantica.pu c-
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:Envelop e xmlns:wsa="http ://schemas.xmlsoap .org/ws/2004/03/addressing"
xmlns:wsse="htt p://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="htt p://schemas.xmlsoap .org/soap/envelope/"><soap:Header> <wsa:Action>Inv okeCoordinator</wsa:Action><wsa :MessageID>uuid :a341e5ea-
e828-43c6-88e0-
d74873ffd0af</wsa:MessageID>< wsa:To>urn:webs emanticaproxy</wsa:To><wsse:Se curity><wsu:Tim estamp
wsu:Id="Timesta mp-89698a3f-20d7-400d-ae99-80583ac02d3b">< wsu:Created>200 5-
02-26T17:11:37Z</wsu:Created><ws u:Expires>2005-02-
26T17:16:37Z</wsu:Expires></wsu:Timestamp></wsse:Security></soap:Header><so ap:Body><string
xmlns="http://tempuri.org/">
<rdf:RDF
xml:base="&meet ingmaker;"
xmlns:meetingma ker="&meetingma ker;"
xmlns:ical="&ic al;"
xmlns:rdf="&rdf ;"
xmlns:rdfs="&rd fs;"
xmlns:xsd="&xsd ;"
<meetingmaker:M eetingMaker rdf:ID="meeting maker_id">
<meetingmaker:c riteria
rdf:datatype="& xsd;string">maj ority</meetingmaker:cr iteria>
<meetingmaker:a lgorithm
rdf:datatype="& xsd;string">par allel</meetingmaker:al gorithm>
<meetingmaker:u id rdf:datatype="& xsd;string">ju* **@ntime.com.br-02-26-
2005 02:11:35</meetingmaker:ui d>
<meetingmaker:v event>
<ical:Vevent rdf:ID="vevent_ id">
<ical:locatio n rdf:datatype="& xsd;string">Puc </ical:location>
<ical:summary rdf:datatype="& xsd;string">Apr esentacao de
Trabalho</ical:summary>
<ical:dtstart rdf:datatype="& xsd;datetime">1 2-10-2004
10:00:00</ical:dtstart>
<ical:dtend rdf:datatype="& xsd;datetime">1 2-10-2004
11:00:00</ical:dtend>
<ical:contact
rdf:datatype="& xsd;string">ju* **@ntime.com.br </ical:contact>
<ical:attende >
<rdf:Bag rdf:ID="vevent_ ateende">
<rdf:li rdf:datatype="& xsd;string">ki* @teccomm.les.in f.puc-
rio.br</rdf:li><rdf:li
rdf:datatype="& xsd;string">fr* *****@gmail.com </rdf:li><rdf:li
rdf:datatype="& xsd;string">fs* ***@inf.puc-rio.br</rdf:li>
</rdf:Bag>
</ical:attende>
</ical:Vevent>
</meetingmaker:ve vent>
</meetingmaker:Me etingMaker>
</rdf:RDF></string></soap:Body></soap:Envelope>
(whitch is a valid XML, at least the Internet explorer open it...)
--
Message posted via http://www.dotnetmonster.com