<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Java Class Cast Exception while parsing bodyContent to GetjoinurlMeetingResponse using XML API 8.0 SP3 in DevNet General Discussions</title>
    <link>https://community.cisco.com/t5/devnet-general-discussions/java-class-cast-exception-while-parsing-bodycontent-to/m-p/3439785#M93</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using XJC bundled with JDK 6 to convert the XSD files into Java classes. Is this the right way? I also tried using XMLBeans instead of XJC but the same problem occurred.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Jun 2014 13:03:22 GMT</pubDate>
    <dc:creator>pthakur01</dc:creator>
    <dc:date>2014-06-06T13:03:22Z</dc:date>
    <item>
      <title>Java Class Cast Exception while parsing bodyContent to GetjoinurlMeetingResponse using XML API 8.0 SP3</title>
      <link>https://community.cisco.com/t5/devnet-general-discussions/java-class-cast-exception-while-parsing-bodycontent-to/m-p/3439784#M92</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm getting the following exception trying to cast bodyContent to GetjoinurlMeetingResponse.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="color: #1f497d;"&gt;We are using JAXB to marshaling and un-marshaling of the WebEx request and response using XML API 8.0 SP3.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;While registering with WebEx, the registration is being done successfully. After registration while getting the WebEx URL, we are getting the response in following format.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&amp;lt;?xml version="1.0" encoding="ISO-8859-1"?&amp;gt;&amp;lt;serv:message xmlns:serv="&lt;A href="http://www.webex.com/schemas/2002/06/service" target="_blank"&gt;http://www.webex.com/schemas/2002/06/service&lt;/A&gt;" xmlns:com="&lt;A href="http://www.webex.com/schemas/2002/06/common" target="_blank"&gt;http://www.webex.com/schemas/2002/06/common&lt;/A&gt;" xmlns:meet="&lt;A href="http://www.webex.com/schemas/2002/06/service/meeting" target="_blank"&gt;http://www.webex.com/schemas/2002/06/service/meeting&lt;/A&gt;" xmlns:att="&lt;A href="http://www.webex.com/schemas/2002/06/service/attendee" target="_blank"&gt;http://www.webex.com/schemas/2002/06/service/attendee&lt;/A&gt;"&amp;gt;&amp;lt;serv:header&amp;gt;&amp;lt;serv:response&amp;gt;&amp;lt;serv:result&amp;gt;SUCCESS&amp;lt;/serv:result&amp;gt;&amp;lt;serv:gsbStatus&amp;gt;PRIMARY&amp;lt;/serv:gsbStatus&amp;gt;&amp;lt;/serv:response&amp;gt;&amp;lt;/serv:header&amp;gt;&amp;lt;serv:body&amp;gt;&amp;lt;serv:bodyContent xsi:type="&lt;A href="https://community.cisco.com/" target="_blank"&gt;meet:GetjoinurlMeetingResponse&lt;/A&gt;" xmlns:xsi="&lt;A href="http://www.w3.org/2001/XMLSchema-instance" target="_blank"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;"&amp;gt;&amp;lt;&lt;A href="https://community.cisco.com/" target="_blank"&gt;meet:joinMeetingURL&lt;/A&gt;&amp;gt;&lt;A href="https://apidemoeu.webex.com/apidemoeu/m.php?AT=JM&amp;amp;amp;MK=628501508&amp;amp;amp;AN=Soniya" target="_blank"&gt;https://apidemoeu.webex.com/apidemoeu/m.php?AT=JM&amp;amp;amp;MK=628501508&amp;amp;amp;AN=Soniya&lt;/A&gt;&lt;SPAN&gt; Moholkar&amp;amp;amp;&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:AE=smoholka@ccrn.com" target="_blank"&gt;AE=smoholka@ccrn.com&lt;/A&gt;&lt;SPAN&gt;&amp;lt;/meet:joinMeetingURL&amp;gt;&amp;lt;&lt;/SPAN&gt;&lt;A href="https://community.cisco.com/" target="_blank"&gt;meet:inviteMeetingURL&lt;/A&gt;&amp;gt;&lt;A href="https://apidemoeu.webex.com/apidemoeu/j.php?ED=305522212&amp;amp;amp;UID=0&amp;amp;amp;RT=MiM3%3c/meet:inviteMeetingURL%3e%3cmeet:registerMeetingURL%3ehttps://apidemoeu.webex.com/apidemoeu/j.php?ED=305522212&amp;amp;amp;UID=0&amp;amp;amp;RG=1&amp;amp;amp;RT=MiM3%3c/meet:registerMeetingURL%3e%3c/serv:bodyContent%3e%3c/serv:body%3e%3c/serv:message" target="_blank"&gt;https://apidemoeu.webex.com/apidemoeu/j.php?ED=305522212&amp;amp;amp;UID=0&amp;amp;amp;RT=MiM3&amp;lt;/meet:inviteMeetingURL&amp;gt;&amp;lt;meet:registerMeetingURL&amp;gt;https://apidemoeu.webex.com/apidemoeu/j.php?ED=305522212&amp;amp;amp;UID=0&amp;amp;amp;RG=1&amp;amp;amp;RT=MiM3&amp;lt;/meet:registerMeetingURL&amp;gt;&amp;lt;/serv:bodyContent&amp;gt;&amp;lt;/serv:body&amp;gt;&amp;lt;/serv:message&lt;/A&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Following is the code to un-marshal the response:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; text-indent: .5in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;JAXBContext jaxbContext = JAXBContext.&lt;EM&gt;newInstance&lt;/EM&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #2a00ff;"&gt;"com.webex.schemas._2002._06.common:"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; + &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #2a00ff;"&gt;"com.webex.schemas._2002._06.service:"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; + &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #2a00ff;"&gt;"com.webex.schemas._2002._06.service.history"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; MessageType response = (MessageType) ((&lt;SPAN style="text-decoration: underline;"&gt;JAXBElement&lt;/SPAN&gt;) unmarshaller.unmarshal(&lt;/SPAN&gt;&lt;STRONG style="color: #7f0055; font-size: 10.0pt; font-family: Consolas;"&gt;new&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; StringReader(responseXML))).getValue(); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; List&amp;lt;ResponseType&amp;gt;&amp;nbsp; responseType = response.getHeader().getResponse();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG style="color: #7f0055; font-size: 10.0pt; font-family: Consolas;"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;(responseType != &lt;/SPAN&gt;&lt;STRONG style="color: #7f0055; font-size: 10.0pt; font-family: Consolas;"&gt;null&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; &amp;amp;&amp;amp; !responseType.isEmpty())&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; GetjoinurlMeetingResponse meetingResponse = &lt;/SPAN&gt;&lt;STRONG style="color: #7f0055; font-size: 10.0pt; font-family: Consolas;"&gt;null&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG style="color: #7f0055; font-size: 10.0pt; font-family: Consolas;"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;(responseType.get(0).getResult().equals(ResultTypeType.&lt;/SPAN&gt;&lt;EM style="color: #0000c0; font-size: 10.0pt; font-family: Consolas;"&gt;SUCCESS&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; List&amp;lt;BodyContentType&amp;gt; bodyContent = response.getBody().getBodyContent();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; &lt;SPAN style="background: yellow;"&gt;meetingResponse = (GetjoinurlMeetingResponse) bodyContent.get(0);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in; text-indent: .5in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; text-indent: .5in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;But we are getting ClassCastException at the highlighted line.&lt;/SPAN&gt;&lt;/P&gt;&lt;OL style="list-style-type: lower-alpha;"&gt;&lt;LI&gt;&lt;SPAN style="color: navy; font-size: 10.0pt; text-decoration: underline; font-family: Consolas;"&gt;java.lang.ClassCastException&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: red;"&gt;: com.webex.schemas._2002._06.service.BodyContentType cannot be cast to com.webex.schemas._2002._06.service.meeting.GetjoinurlMeetingResponse&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same problem is also seen for RegisterMeetingAttendeeResponse. I'm attaching the XSD files and zipped Java classes I generated using Eclipse from the 8.0 SP3 .xsd files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly help me out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pranav Thakur&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2019 10:44:41 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-general-discussions/java-class-cast-exception-while-parsing-bodycontent-to/m-p/3439784#M92</guid>
      <dc:creator>pthakur01</dc:creator>
      <dc:date>2019-03-01T10:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Java Class Cast Exception while parsing bodyContent to GetjoinurlMeetingResponse using XML API 8.0 SP3</title>
      <link>https://community.cisco.com/t5/devnet-general-discussions/java-class-cast-exception-while-parsing-bodycontent-to/m-p/3439785#M93</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using XJC bundled with JDK 6 to convert the XSD files into Java classes. Is this the right way? I also tried using XMLBeans instead of XJC but the same problem occurred.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 13:03:22 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-general-discussions/java-class-cast-exception-while-parsing-bodycontent-to/m-p/3439785#M93</guid>
      <dc:creator>pthakur01</dc:creator>
      <dc:date>2014-06-06T13:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Java Class Cast Exception while parsing bodyContent to GetjoinurlMeetingResponse using XML API 8.0 SP3</title>
      <link>https://community.cisco.com/t5/devnet-general-discussions/java-class-cast-exception-while-parsing-bodycontent-to/m-p/3439786#M94</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Has anyone tried implementing XML API 8.0 SP3 in Java?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jun 2014 05:35:45 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-general-discussions/java-class-cast-exception-while-parsing-bodycontent-to/m-p/3439786#M94</guid>
      <dc:creator>pthakur01</dc:creator>
      <dc:date>2014-06-12T05:35:45Z</dc:date>
    </item>
  </channel>
</rss>

