Hi,
I am migrating our institute's calendar using perl/soap. I get the old appointment info from the datebase then create soap envelops to send to zimbra's soap API. Most appointments are migrated without problem. But when appointment's organizer, attendee, location, summary or comment contain special chars, the appointment failed to get into zimbra. The following is a failed envelop:
The error I got isCode:<ns0:CreateAppointmentRequest xmlns:ns0="urn:zimbraMail"> <m l="291"> <inv allday="0" loc="" name="Dinner with Ângela" fb="B" type="event" transp="O"> <or a="asmith@myschool.edu" d="Ana smith"/> <s d="20060309T191500"/> <e d="20060309T220000"/> </inv> <e p="Ana smith" a="asmith@myschool.edu" t="t"/> <su>Dinner with Ângela</su> <mp ct="multipart/alternative"> <mp ct="text/plain"> <content>The following is a meeting request migrated from OpenGroupware:Dinner with Ângela Time:March 9, 2006, 19:15:00 - 22:00:00 (GMT-05) America/New_York Organizer:"Ana smith"<asmith@myschool.edu> Location:Tina´s, Resources: Invitees: "Ana smith"<asmith@myschool.edu>; </content> </mp> <mp ct="text/html"> <content><h3>The following is a meeting request migrated from OpenGroupware:</h3><p><table border='0'><tr><th align=left>Subject: </th><td>Dinner with Ângela</td></tr><tr><th align=left>Organizer: </th><td>Ana smith</td></tr><tr><th align=left>Location: </th><td>Tina´s</td></tr><tr><th align=left>Time: </th><td>March 9, 2006, 19:15:00 - 22:00:00 (GMT-05) America/New_York</td></tr><tr><th align=left>Invitees: </th><td>"Ana smith"<asmith@myschool.edu>; </td></tr></table></p></content> </mp> </mp> </m> </ns0:CreateAppointmentRequest>
I think it breaks at "Ângela". Basically the error says the soap envelop could not be parsed. But how can I make it work? The same thing happens whereever the special chars appeared in organizer, attendee, location, summary, mp or comment.Code:<ns0:Fault xmlns:ns0="http://www.w3.org/2003/05/soap-envelope"> <ns0:Code> <ns0:Value>soap:Sender</ns0:Value> </ns0:Code> <ns0:Reason> <ns0:Text>parse error: Error on line 2 of document : The element type "ns0:Envelope" must be terminated by the matching end-tag "</ns0:Envelope>". Nested exception: The element type "ns0:Envelope" must be term inated by the matching end-tag "</ns0:Envelope>".</ns0:Text> </ns0:Reason> <ns0:Detail> <ns1:Error xmlns:ns1="urn:zimbra"> <ns1:Code>service.PARSE_ERROR</ns1:Code> <ns1:Trace>com.zimbra.common.service.ServiceException: parse error: Error on line 2 of document : The element type &qu ot;ns0:Envelope" must be terminated by the matching end-tag "</ns0:Envelope>". Nested exception: The ele ment type "ns0:Envelope" must be terminated by the matching end-tag "</ns0:Envelope>". Code:service.PARSE_ERROR at com.zimbra.common.service.ServiceException.PARSE_ERROR(ServiceException.java:201) at com.zimbra.soap.SoapEngine.dispatch(SoapEngine.java:112) at com.zimbra.soap.SoapServlet.doPost(SoapServlet.java:272) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at com.zimbra.cs.servlet.ZimbraServlet.service(ZimbraServlet.java:174) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093) at org.mortbay.servlet.UserAgentFilter.doFilter(UserAgentFilter.java:81) at org.mortbay.servlet.GzipFilter.doFilter(GzipFilter.java:148) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:211) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.handler.RewriteHandler.handle(RewriteHandler.java:176) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:313) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:844) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:644) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442) Caused by: org.dom4j.DocumentException: Error on line 2 of document : The element type "ns0:Envelope" must be terminated by the matching end-tag "</ns0:Envelope>". Nested exception: The element type "ns0:Envelope" must be terminated by the matching end-tag "</ns0:Envelope>". at org.dom4j.io.SAXReader.read(SAXReader.java:350) at org.dom4j.io.SAXReader.read(SAXReader.java:264) at com.zimbra.common.soap.Element.parseXML(Element.java:373) at com.zimbra.common.soap.Element.parseXML(Element.java:371) at com.zimbra.soap.SoapEngine.dispatch(SoapEngine.java:106) ... 27 more </ns1:Trace> </ns1:Error> </ns0:Detail> </ns0:Fault>
Any help will be greatly appreciated,
Jing


LinkBack URL
About LinkBacks


