cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
171
Views
0
Helpful
0
Comments
cdnadmin
Community Member
This document was generated from CDN thread

Created by: Raykan Morgan on 18-11-2013 07:52:21 PM
hi everybody,

I am trying to serialize a request to send XML API . My sample case is around GetSite.
1. Downloaded latest schema (8.0.0)
2. Created c# classes by using xsd /c  fileName1 fileName2 ... where file names are related xsd files from schema.
 I think the problem is in these classess.
The following is for the complex type getSite

[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://www.webex.com/schemas/2002/06/service/site")]
public partial class getSite : bodyContentType
{
}

....
3. After I serialized this I get the following xml


<?xml version="1.0" encoding="utf-16"?>
<message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.webex.com/schemas/2002/06/service">
  <header>
    <securityContext>
      <webExID xmlns="http://www.webex.com/schemas/2002/06/common">webExID</webExID>
      <password xmlns="http://www.webex.com/schemas/2002/06/common">webExPassword</password>
      <siteID xmlns="http://www.webex.com/schemas/2002/06/common">siteID</siteID>
      <partnerID xmlns="http://www.webex.com/schemas/2002/06/common">partnerID</partnerID>
    </securityContext>
  </header>
  <body>
    <bodyContent xmlns:q1="http://www.webex.com/schemas/2002/06/service/site" xsi:type="q1:getSite">
      <q1:returnSettings />
    </bodyContent>
  </body>
</message>


====>

When I submit this into the webex server this is the response:

<serv:reason>
validation: unable to instantiate com.webex.xmlapi.service.binding.GetSite; java.lang.ClassNotFoundException: com.webex.xmlapi.service.binding.GetSite
</serv:reason>



I think the bodyContent part should be something like this:

<bodyContent xsi:type="site:getSite">

To be able to get such an XML output what should I have in the class file? or if you have any other recommendation I am ready to hear.


Thanks in advance ...

Subject: RE: Using XmlSerializer
Replied by: Nathan Morrow on 21-11-2013 05:54:01 PM
Hello,

     xmlns:site is already defined in the schema. XML API ignores new namespace definition in the XML request, aside from xmlns:xsi and xsi:type. xsi:type="site:getSite" would work, as would xsi:type="java:com.webex.xmlapi.service.binding.site.GetSite". I'm not familiar with c# XML generation from schema, but there should be a way to make it use the already defined namespace for the site service.
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links