Please note: These WebEx forums have replaced the earlier site forums. All the previous threads and posts have been replicated here, and if you subscribed to the previous forums, please re-subscribe. Thank you.
« Back to Scheduling Meetings

BodyContentType is empty even after setting the body

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hi ,
 
I am new to WebEx connect development and I am trying to use XML API.
 
1. I have genereated Java classes for XML Schema document ( Using JAXB2.2.1)
2. Creating the request object . Please see the below code snapshot.
 
SecurityContextType sct = new SecurityContextType();
                            sct.setPartnerID(partnerID);        sct.setWebExID(webExID);                            sct.setPassword(password);
                            sct.setSiteName(siteName);                            sct.setSiteID(siteID);
                           
        MessageType mt = new MessageType();
        Header header = new Header();
        MessageType.Body body = new MessageType.Body();
        LstsummaryMeeting au = new LstsummaryMeeting();
        OrderType orderType  = new OrderType();
                  orderType.getOrderBy().add(OrderByType.STARTTIME);
        au.setOrder(orderType);
        body.getBodyContent().add(au);
                       
            header.setSecurityContext(sct);
                   
                     mt.setHeader(header);
                     mt.setBody(body);
 
            
    Writer writer = new StringWriter();
    JAXBContext context = JAXBContext.newInstance(MessageType.class);
    Marshaller m = context.createMarshaller();

    m.marshal(mt, writer);
    reqXML = writer.toString();
     
        System.out.println(reqXML+"\n");
        out.println(reqXML);
 
 
4. Generated XML is
 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:messageType xmlns:ns2="http://www.webex.com/schemas/2002/06/service" xmlns="http://www.webex.com/schemas/2002/06/common"><ns2:header><ns2:securityContext><webExID>sff</webExID><password>ssdffs</password><siteID>1233</siteID><siteName>sd</siteName><partnerID>sdsd!</partnerID></ns2:securityContext></ns2:header><ns2:body><ns2:bodyContent/></ns2:body></ns2:messageType>
 
5. I got the below resposne
 

<?xml version="1.0" encoding="UTF-8"?><serv:message xmlns:serv="http://www.webex.com/schemas/2002/06/service" xmlns:com="http://www.webex.com/schemas/2002/06/common"><serv:header><serv:response><serv:result>FAILURE</serv:result><serv:reason>validation: Parsing Error : The version is required in the XML declaration.Line : 1Column : 58</serv:reason><serv:gsbStatus>PRIMARY</serv:gsbStatus><serv:exceptionID>999999</serv:exceptionID></serv:response></serv:header><serv:body><serv:bodyContent/></serv:body></serv:message>
 
Can please help to find the root cause of this issue ?
 
Regards
Ram

I'm also facing the same problem. Could any one let me know how to resolve it?
 
Thanks & Regards,
Suresh

It looks like this is being caused by not including your xsi:type in your bodyContent. The xsi:type is how you tell the XML API service which command you want to use. 
example:  <bodyContent xsi:type="java:com.webex.service.binding.site.GetSite">

Create a Cisco account today and gain access across all Cisco Collaboration Developer sites.

 

Follow the WebEx Developer program on Twitter for the latest industry and WebEx Meetings related information.