cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1855
Views
6
Helpful
8
Replies

Problems creating C# class from user.xsd 10 SP7

bbalzarini
Level 1
Level 1

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>

8 Replies 8

ryanhunt
Level 5
Level 5

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.

phillip.isley
Level 1
Level 1

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.

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.

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.

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!

k