tag:help-archives.hannonhill.com,2010-02-09:/discussions/web-services/1537-error-changing-content-type-with-web-servicesCascade CMS: Discussion 2015-09-22T16:19:35Ztag:help-archives.hannonhill.com,2010-02-09:Comment/376536042015-08-14T12:02:33Z2015-08-14T12:02:33ZError changing content type with Web Services<div><p>Hi,</p>
<p>A couple of suggestions to try:</p>
<ul>
<li>Try also unsetting <code>configurationSetPath</code> to see if
maybe there's some weird reference going on:
<pre>
<code>unset ($page->configurationSetPath);</code>
</pre></li>
<li>Try using <code>contentTypeId</code> instead, perhaps there's
an issue with trying to assign the Content Type by name, which
could explain the NPE</li>
</ul>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/376536042015-08-17T16:07:43Z2015-08-17T16:07:43ZError changing content type with Web Services<div><p>Hi Ryan,</p>
<p>Thanks for the suggestions, I tried them but unfortunately I'm
still getting the same error.</p>
<p>Using web services, I compared the asset object model of one of
these broken assets with a working asset with the same
content-type. They really seem identical except for different ID,
title, etc, so I'm not sure what is causing the error..</p>
<p>I think I will try another route, use web services to read the
old assets and then create a fresh new page, copying the data.</p></div>daneviltag:help-archives.hannonhill.com,2010-02-09:Comment/376536042015-08-17T16:53:33Z2015-08-17T16:53:33ZError changing content type with Web Services<div><p>Hi,</p>
<p>If you haven't taken a look at my library yet, maybe you should.
Specifically, look at the <a href="http://www.upstate.edu/cascade-admin/projects/web-services/oop/classes/asset-classes/page.php">
Page</a> class.</p>
<p>Wing</p></div>Wing Ming Chantag:help-archives.hannonhill.com,2010-02-09:Comment/376536042015-08-25T20:03:40Z2015-08-25T20:03:40ZError changing content type with Web Services<div><p>Hi,</p>
<p>I was going over some older discussions and noticed this one is
still open. Were you able to work through your issue with changing
Content Types using Web Services? Did you have a chance to scope
out Wing's Web Services library?</p>
<p>Please feel free to let us know if you have any other
questions.</p>
<p>Thanks.</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/376536042015-08-25T20:33:04Z2015-08-25T20:33:04ZError changing content type with Web Services<div><p>Hi Ryan,</p>
<p>Thanks for following up. I never was able to change Content
Types using web services, but I took a different approach (created
new pages and then copy data to new pages using web services),
which solved my problem in the end.</p>
<p>I had already done that by the time Wing had replied, otherwise
I’m sure his library would have worked too.</p>
<p>Thanks!<br>
- Daniel</p></div>daneviltag:help-archives.hannonhill.com,2010-02-09:Comment/376536042015-08-26T15:05:39Z2015-08-26T15:05:39ZError changing content type with Web Services<div><p>Thank you for following up, Daniel, I am glad to hear you were
able to come up with a solution.</p>
<p>I'm going to go ahead and close this discussion, please feel
free to comment or reply to re-open if you have any additional
questions.</p>
<p>Have a great day!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/376536042015-09-08T16:24:01Z2015-09-08T16:24:01ZError changing content type with Web Services<div><p>Normally I don't write raw code (code without using my own
library) to deal with assets. But on this occasion I am working on
a new page in my tutorial site and I did write a simple program
with raw code to switch the content type associated with a page as
a demo. See <a href="http://www.upstate.edu/cascade-admin/projects/web-services/courses/advanced-course/advanced-lession-2.php">
Lesson 2</a> for details. Part of the purpose of this page, which
is not yet finished, is to show how clumsy it is to write raw code
to do something seemingly simple.</p>
<p>Wing</p></div>Wing Ming Chan