Problem with ws_deserialize

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem with ws_deserialize

Wen Chen
Hi,

 

I am trying to figure out how to use deserialization.  I think I need some
help to make progress.

 

Basically, if I compile and run openwsman-1.0.1/tests/xml/xml1.c, with the
following xml, I will get "No cs".  Notice the last two arguments (0,0) of
the call.  I am wondering if they have something to do with getting the
parsing done correctly.

 

    CIM_ComputerSystem *cs  = ws_deserialize(cntx,

                                     node,

                                     CIM_ComputerSystem_TypeInfo,

                                     "CIM_ComputerSystem",

                                     NS, NULL,

                                     0, 0);

 

<?xml version="1.0" encoding="UTF-8"?>

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsen="http://schemas.xmlsoap.org/ws/2004/09/enumeration">

<s:Header>

<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa
:To>

<wsa:Action>http://schemas.xmlsoap.org/ws/2004/09/enumeration/PullResponse</
wsa:Action>

<wsa:RelatesTo>uuid:f314d4dc-240b-140b-8004-be0448251100</wsa:RelatesTo>

<wsa:MessageID>uuid:f31513fc-240b-140b-8012-be0448251100</wsa:MessageID>

</s:Header>

<s:Body>

   <p:CIM_ComputerSystem
xmlns:p="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSyste
m" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

   <p:NameFormat>IP</p:NameFormat>

   <p:test>test 1</p:test>

   <p:test>test 2</p:test>

   <p:foo>foo 2</p:foo>

   <p:foo>foo 2</p:foo>

   <p:foo>foo 2</p:foo>

   <p:foo>foo 2</p:foo>

   </p:CIM_ComputerSystem>

</s:Body>

</s:Envelope>


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel

winmail.dat (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with ws_deserialize

Wen Chen
It looks like ws_deserialize works only from the parent node.  In this case,
I need to first navigate to the "<s:Body>" node with  "WsXmlNodeH node =
ws_xml_get_soap_body(doc)" before calling ws_deserialize.  

 

My follow-up question is about the deserialization related memory
management.  When ws_deserialize returns the binary struct, does the caller
need to free it when the work is done?  If openwsman manages this memory
directly, when does openwsman free it AND should caller try to copy this
memory as soon as possible?  

 

Thanks,

 

Wen

 

  _____  

From: Wen Chen [mailto:[hidden email]]
Sent: Monday, May 14, 2007 4:33 PM
To: '[hidden email]'
Subject: Problem with ws_deserialize

 

Hi,

 

I am trying to figure out how to use deserialization.  I think I need some
help to make progress.

 

Basically, if I compile and run openwsman-1.0.1/tests/xml/xml1.c, with the
following xml, I will get "No cs".  Notice the last two arguments (0,0) of
the call.  I am wondering if they have something to do with getting the
parsing done correctly.

 

    CIM_ComputerSystem *cs  = ws_deserialize(cntx,

                                     node,

                                     CIM_ComputerSystem_TypeInfo,

                                     "CIM_ComputerSystem",

                                     NS, NULL,

                                     0, 0);

 

<?xml version="1.0" encoding="UTF-8"?>

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsen="http://schemas.xmlsoap.org/ws/2004/09/enumeration">

<s:Header>

<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa
:To>

<wsa:Action>http://schemas.xmlsoap.org/ws/2004/09/enumeration/PullResponse</
wsa:Action>

<wsa:RelatesTo>uuid:f314d4dc-240b-140b-8004-be0448251100</wsa:RelatesTo>

<wsa:MessageID>uuid:f31513fc-240b-140b-8012-be0448251100</wsa:MessageID>

</s:Header>

<s:Body>

   <p:CIM_ComputerSystem
xmlns:p="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSyste
m" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

   <p:NameFormat>IP</p:NameFormat>

   <p:test>test 1</p:test>

   <p:test>test 2</p:test>

   <p:foo>foo 2</p:foo>

   <p:foo>foo 2</p:foo>

   <p:foo>foo 2</p:foo>

   <p:foo>foo 2</p:foo>

   </p:CIM_ComputerSystem>

</s:Body>

</s:Envelope>


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel

winmail.dat (11K) Download Attachment
Loading...