10-31-2016 04:10 PM
I am attempting to create a C# class from the user.xsd file. I have tried using xsd.exe which is included with Visual Studio as well as Xsd2Code++.
I can not successfully create the user.cs file because validation of the .xsd file fails.
The error message is:
Error: Schema validation failed:
The 'name' attribute is not supported in this context.
I believe that it is talking about the name attribute in the xsd:complexContent tag that is within the getUserCard complexType that I have shown below. Is the name attribute necessary?
<xsd:complexType name="getUserCard">
<xsd:annotation>
<xsd:documentation xml:lang="en">
1. One of the webexId/email/personalUrl is a required input element.
2. There could be multiple avatar images on the server and size is used to choose the matching one from this set.
</xsd:documentation>
</xsd:annotation>
<xsd:complexContent name="IdTypeForUserCardQuery">
<xsd:extension base="serv:bodyContentType">
<xsd:sequence>
<xsd:choice>
<xsd:element name="webExId" type="xsd:string"/>
<xsd:element name="email" type="xsd:string"/>
<xsd:element name="personalUrl" type="xsd:string"/>
</xsd:choice>
<xsd:element name="size" type="xsd:integer" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
11-01-2016 10:22 AM
In order to maintain backward compatibility, we aren’t really free to update the XSD, other than additions. The schema was built with and tends to validate properly with JAVA. You are free to modify your local copy of the schema to successfully build classes with Visual Studio, as long as the resulting XML requests are properly formatted when sent to WebEx. We do recommend against response validation because upgrades do tend to include schema additions.
11-01-2016 12:36 PM
The problem appears to be the name associated with the choice block:
<xsd:choice name="IdTypeForUserCardQuery">
<xsd:element name="webExId" type="xsd:string"/>
<xsd:element name="email" type="xsd:string"/>
<xsd:element name="personalUrl" type="xsd:string"/>
</xsd:choice>
Every other choice block does not have a name associated with it. After I removed the name="IdTypeForUserCardQuery" portion of text, I was able to get the class to compile successfully using user.xsd, common.xsd and service.xsd in the command line arguments.
11-01-2016 12:42 PM
Thanks Phillip,
That is the route I ended up taking as well, now I am wrestling with trying to build a comprehensive set of classes that work together to create XML that the WebEx API will accept.
11-01-2016 01:04 PM
No problem. You will find that a good bit of the documentation is in need of updating. I find myself juggling between these two websites to get the full details necessary:
https://developer.cisco.com/media/webex-xml-api/Preface.html
https://developer.cisco.com/media/webex-xml-api/schemas/
I have been successful with ep, history and site thus far, but it has required a lot of trial and error along the way.
11-01-2016 01:07 PM
Well at the very least it is good to know that I am not alone! :-)
11-18-2016 02:29 AM
Is it possible WebEx Integration by .Net (Asp.Net) regarding training sessions ,if it's possible I need relevant uri api or xml api reference document
11-18-2016 08:11 AM
I haven't been able to create anything from the xsds regarding training sessions. Something about the structure makes xsd2code as well as xsd.exe crash when ever I try to make use of those files.
I am going to resort to building the classes manually so if you do find something please share!
11-21-2016 08:01 AM
k
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide