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?
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:element name="webExId" type="xsd:string"/>
<xsd:element name="email" type="xsd:string"/>
<xsd:element name="personalUrl" type="xsd:string"/>
<xsd:element name="size" type="xsd:integer" minOccurs="0"/>
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.
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.
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.
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:
I have been successful with ep, history and site thus far, but it has required a lot of trial and error along the way.
Well at the very least it is good to know that I am not alone! :-)
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
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!
Please sign in to leave a comment.