alexjamesbrown / JoeBlogs

Wordpress / Metaweblog API Wrapper
53 stars 40 forks source link

WordPress 3.3.1 - Response from server does not contain valid XML #12

Open Ascott03 opened 12 years ago

Ascott03 commented 12 years ago

I get the exception at the bottom of this message when I make a call to either GetUserInfo, GetCategories, GetAuthors on both the classes WordPressWrapper and MetaWeblogWrapper.

try { WordPressWrapper wp = new WordPressWrapper(siteURL, username, password); IList authors = wp.GetAuthors();

 foreach(Author a in authors)
 {
      Console.WriteLine("User Name:       {0}", a.user_id);
      Console.WriteLine("User Login:        {0}", a.user_login);
     Console.WriteLine("Display Name:  {0}", a.display_name);
}

} catch (Exception ex3) { throw new Exception("Failed to retrieve author information.", ex3); }

System.Exception: Failed to retrieve author information. ---> CookComputing.XmlRpc.XmlRpcIllFormedXmlException: Response from server does not contain valid XML.---> System.Xml.XmlException: Reference to undeclared entity 'raquo'. Line 25,position 78. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.HandleGeneralEntityReference(String name, Boolean isInAttributeValue, Boolean pushFakeEntityIfNullResolver, Int32 entityStartLinePos) at System.Xml.XmlTextReaderImpl.HandleEntityReference(Boolean isInAttributeValue, EntityExpandType expandType, Int32& charRefEndPos) at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr) at System.Xml.XmlTextReaderImpl.ParseAttributes() at System.Xml.XmlTextReaderImpl.ParseElement() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace) at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) at System.Xml.XmlDocument.Load(XmlReader reader) at System.Xml.XmlDocument.Load(Stream inStream) at CookComputing.XmlRpc.XmlRpcSerializer.DeserializeResponse(Stream stm, Type svcType) --- End of inner exception stack trace ---

Ascott03 commented 12 years ago

I got around this this issue by replacing the CookComputing.XmlRpcV2 DLL that comes with the binaries from CodePlex (i.e. v.2.3.2) with version 2.5.0.

Note, this may no longer be a issue as the source from this site is using CookComputing.XmlRpcV2 version 2.5.0.

alexjamesbrown commented 11 years ago

Sorry for taking 4 months to reply...

Any chance you could fork this and update? Will merge your changes in?

V. Keen to grow this project

GarethWright commented 11 years ago

You may also get this if you have been reading xmlrpc tutorials on the web, which I did before finding this.

They incorrectly specify the URL as http://[url]/wordpress/xmlprc.php Not everyone installs wordpress in a subfolder called wordpress.

URL using this wrapper must be the the full path to xmlrpc.php

alexjamesbrown commented 11 years ago

Ahh ok... hmm.. i can't tell from the stack trace of the OP if this is the case though?

GarethWright commented 11 years ago

Perhaps its worth adding a standard http request object to check that the URL is valid http 200 response? On Aug 14, 2012 4:38 PM, "Alex Brown" notifications@github.com wrote:

Ahh ok... hmm.. i can't tell from the stack trace of the OP if this is the case though?

— Reply to this email directly or view it on GitHubhttps://github.com/alexjamesbrown/JoeBlogs/issues/12#issuecomment-7729799.

alexjamesbrown commented 11 years ago

Good idea... I'll try and get that implemented...

Feel free to do it & create a pull request if you have time ;-)

GarethWright commented 11 years ago

I'll try get to that tomorrow. Need to figure out how to create a new post with featured image and custom fields first.

:) On Aug 14, 2012 11:10 PM, "Alex Brown" notifications@github.com wrote:

Good idea... I'll try and get that implemented...

Feel free to do it & create a pull request if you have time ;-)

— Reply to this email directly or view it on GitHubhttps://github.com/alexjamesbrown/JoeBlogs/issues/12#issuecomment-7742187.

alexjamesbrown commented 11 years ago

Cool! Just created #17 to handle featured image...

GarethWright commented 11 years ago

Magic. Really outstanding project. Can't wait to show finish off the new blog admin tool :) On Aug 14, 2012 11:37 PM, "Alex Brown" notifications@github.com wrote:

Cool! Just created #17 https://github.com/alexjamesbrown/JoeBlogs/issues/17to handle featured image...

— Reply to this email directly or view it on GitHubhttps://github.com/alexjamesbrown/JoeBlogs/issues/12#issuecomment-7742836.