openwsman XML parsing

View: New views
11 Messages — Rating Filter:   Alert me  

openwsman XML parsing

by arasto02 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I am trying to build xml parsing for SOAP request using openwsman API. Do let me know if there is any example to do this as i am unable to find any particular reference for this. Below is code snipet that i am trying:

WsXmlNodeH node = ws_xml_get_soap_body(doc);

                if (node && (node = ws_xml_get_child(node, 0,
                        XML_NS_SOAP_,
                        WSENUM_ENUMERATE_RESP)))
                {
                        WsXmlNodeH filter = ws_xml_get_child(node,
                                0, XML_NS_WS_MAN, WSM_FILTER);
                        if (filter) {
                                node = ws_xml_get_child(filter, 0, XML_NS_CIM_BINDING, WSMB_ASSOCIATION_INSTANCES);
                                //node = ws_xml_get_child(node, 0, XML_NS_CIM_BINDING, WSMB_OBJECT);

                                epr_t *epr = epr_deserialize(node, WSMB_OBJECT, XML_NS_CIM_BINDING, 1);
                                if (!epr)
                                        return 1;
                                printf("Resource uri: %s\n", epr->refparams.uri );
                                int i;
                                Selector *ss =
                                        (Selector *) epr->refparams.selectorset.selectors;
                                if (ss == NULL) {
                                        debug("epr->refparams.selectors.data == NULL\n");
                                        return 1;
                                }
                                for (i = 0; i < epr->refparams.selectorset.count; i++) {
                                        Selector *s;
                                        s = ss + i;
                                        printf("%s", s->name );
                                        printf("  =  %s\n", s->value);
                                }
                        }
                }
        }

here is the doc contaning XML which i dump into an file:

<?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" xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns:n1="http://schema.omc-project.org/wbem/wscim/1/cim-schema/2/OMC_HardwareSubSystem" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:n2="http://schema.omc-project.org/wbem/wscim/1/cim-schema/2/OMC_UnitaryComputerSystem" xmlns:n3="http://schema.omc-project.org/wbem/wscim/1/cim-schema/2/OMC_IPMISubSystem" xmlns:n4="http://schemas.vmware.com/wbem/wscim/1/cim-schema/2/VMware_HHRCController">
  <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/EnumerateResponse</wsa:Action>
    <wsa:RelatesTo>uuid:905a6e24-16c5-40b1-9674-3eff52623028</wsa:RelatesTo>
    <wsman:TotalItemsCountEstimate>6</wsman:TotalItemsCountEstimate>
    <wsa:MessageID>uuid:e3d96714-7812-1812-817e-2a9f42565000</wsa:MessageID>
  </s:Header>
  <s:Body>
    <wsen:EnumerateResponse>
      <wsman:Items>
        <wsman:Item>
          <n1:OMC_HardwareSubSystem>
            <n1:Caption>System Board 7:1</n1:Caption>
            <n1:CommunicationStatus xsi:nil="true"/>
            <n1:CreationClassName>OMC_HardwareSubSystem</n1:CreationClassName>
            <n1:Dedicated>2</n1:Dedicated>
            <n1:Description>System Board 7:1</n1:Description>
            <n1:DetailedStatus xsi:nil="true"/>
            <n1:ElementName>System Board 7:1</n1:ElementName>
            <n1:EnabledDefault>2</n1:EnabledDefault>
            <n1:EnabledState>0</n1:EnabledState>
            <n1:Generation xsi:nil="true"/>
            <n1:HealthState>0</n1:HealthState>
            <n1:InstallDate xsi:nil="true"/>
            <n1:InstanceID xsi:nil="true"/>
            <n1:Name>7.1</n1:Name>
            <n1:NameFormat>Other</n1:NameFormat>
            <n1:OperatingStatus xsi:nil="true"/>
            <n1:OperationalStatus>0</n1:OperationalStatus>
            <n1:OtherDedicatedDescriptions>System Board</n1:OtherDedicatedDescriptions>
            <n1:OtherEnabledState xsi:nil="true"/>
            <n1:PrimaryOwnerContact xsi:nil="true"/>
            <n1:PrimaryOwnerName xsi:nil="true"/>
            <n1:PrimaryStatus xsi:nil="true"/>
            <n1:RequestedState>12</n1:RequestedState>
            <n1:ResetCapability xsi:nil="true"/>
            <n1:Status xsi:nil="true"/>
            <n1:TimeOfLastStateChange xsi:nil="true"/>
            <n1:TransitioningToState>12</n1:TransitioningToState>
          </n1:OMC_HardwareSubSystem>
          <wsa:EndpointReference>
            <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
            <wsa:ReferenceParameters>
              <wsman:ResourceURI>http://schema.omc-project.org/wbem/wscim/1/cim-schema/2/OMC_HardwareSubSystem</wsman:ResourceURI>
              <wsman:SelectorSet>
                <wsman:Selector Name="CreationClassName">OMC_HardwareSubSystem</wsman:Selector>
                <wsman:Selector Name="Name">7.1</wsman:Selector>
              </wsman:SelectorSet>
            </wsa:ReferenceParameters>
          </wsa:EndpointReference>
        </wsman:Item>
        <wsman:Item>
          <n1:OMC_HardwareSubSystem>
            <n1:Caption>System Internal Expansion Board 16:1</n1:Caption>
            <n1:CommunicationStatus xsi:nil="true"/>
            <n1:CreationClassName>OMC_HardwareSubSystem</n1:CreationClassName>
            <n1:Dedicated>2</n1:Dedicated>
            <n1:Description>System Internal Expansion Board 16:1</n1:Description>
            <n1:DetailedStatus xsi:nil="true"/>
            <n1:ElementName>System Internal Expansion Board 16:1</n1:ElementName>
            <n1:EnabledDefault>2</n1:EnabledDefault>
            <n1:EnabledState>0</n1:EnabledState>
            <n1:Generation xsi:nil="true"/>
            <n1:HealthState>0</n1:HealthState>
            <n1:InstallDate xsi:nil="true"/>
            <n1:InstanceID xsi:nil="true"/>
            <n1:Name>16.1</n1:Name>
            <n1:NameFormat>Other</n1:NameFormat>
            <n1:OperatingStatus xsi:nil="true"/>
            <n1:OperationalStatus>0</n1:OperationalStatus>
            <n1:OtherDedicatedDescriptions>System Internal Expansion Board</n1:OtherDedicatedDescriptions>
            <n1:OtherEnabledState xsi:nil="true"/>
            <n1:PrimaryOwnerContact xsi:nil="true"/>
            <n1:PrimaryOwnerName xsi:nil="true"/>
            <n1:PrimaryStatus xsi:nil="true"/>
            <n1:RequestedState>12</n1:RequestedState>
            <n1:ResetCapability xsi:nil="true"/>
            <n1:Status xsi:nil="true"/>
            <n1:TimeOfLastStateChange xsi:nil="true"/>
            <n1:TransitioningToState>12</n1:TransitioningToState>
          </n1:OMC_HardwareSubSystem>
          <wsa:EndpointReference>
            <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
            <wsa:ReferenceParameters>
              <wsman:ResourceURI>http://schema.omc-project.org/wbem/wscim/1/cim-schema/2/OMC_HardwareSubSystem</wsman:ResourceURI>
              <wsman:SelectorSet>
                <wsman:Selector Name="CreationClassName">OMC_HardwareSubSystem</wsman:Selector>
                <wsman:Selector Name="Name">16.1</wsman:Selector>
              </wsman:SelectorSet>
            </wsa:ReferenceParameters>
          </wsa:EndpointReference>
        </wsman:Item>
        <wsman:Item>
          <n1:OMC_HardwareSubSystem>
            <n1:Caption>System Internal Expansion Board 16:2</n1:Caption>
            <n1:CommunicationStatus xsi:nil="true"/>
            <n1:CreationClassName>OMC_HardwareSubSystem</n1:CreationClassName>
            <n1:Dedicated>2</n1:Dedicated>
            <n1:Description>System Internal Expansion Board 16:2</n1:Description>
            <n1:DetailedStatus xsi:nil="true"/>
            <n1:ElementName>System Internal Expansion Board 16:2</n1:ElementName>
            <n1:EnabledDefault>2</n1:EnabledDefault>
            <n1:EnabledState>0</n1:EnabledState>
            <n1:Generation xsi:nil="true"/>
            <n1:HealthState>0</n1:HealthState>
            <n1:InstallDate xsi:nil="true"/>
            <n1:InstanceID xsi:nil="true"/>
            <n1:Name>16.2</n1:Name>
            <n1:NameFormat>Other</n1:NameFormat>
            <n1:OperatingStatus xsi:nil="true"/>
            <n1:OperationalStatus>0</n1:OperationalStatus>
            <n1:OtherDedicatedDescriptions>System Internal Expansion Board</n1:OtherDedicatedDescriptions>
            <n1:OtherEnabledState xsi:nil="true"/>
            <n1:PrimaryOwnerContact xsi:nil="true"/>
            <n1:PrimaryOwnerName xsi:nil="true"/>
            <n1:PrimaryStatus xsi:nil="true"/>
            <n1:RequestedState>12</n1:RequestedState>
            <n1:ResetCapability xsi:nil="true"/>
            <n1:Status xsi:nil="true"/>
            <n1:TimeOfLastStateChange xsi:nil="true"/>
            <n1:TransitioningToState>12</n1:TransitioningToState>
          </n1:OMC_HardwareSubSystem>
          <wsa:EndpointReference>
            <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
            <wsa:ReferenceParameters>
              <wsman:ResourceURI>http://schema.omc-project.org/wbem/wscim/1/cim-schema/2/OMC_HardwareSubSystem</wsman:ResourceURI>
              <wsman:SelectorSet>
                <wsman:Selector Name="CreationClassName">OMC_HardwareSubSystem</wsman:Selector>
                <wsman:Selector Name="Name">16.2</wsman:Selector>
              </wsman:SelectorSet>
            </wsa:ReferenceParameters>
          </wsa:EndpointReference>
        </wsman:Item>
        <wsman:Item>
          <n2:OMC_UnitaryComputerSystem>
            <n2:Caption>blrnqvmex03.symphonysv.com</n2:Caption>
            <n2:CommunicationStatus xsi:nil="true"/>
            <n2:CreationClassName>OMC_UnitaryComputerSystem</n2:CreationClassName>
            <n2:Dedicated>2</n2:Dedicated>
            <n2:Description xsi:nil="true"/>
            <n2:DetailedStatus xsi:nil="true"/>
            <n2:ElementName>blrnqvmex03.symphonysv.com</n2:ElementName>
            <n2:EnabledDefault>2</n2:EnabledDefault>
            <n2:EnabledState>2</n2:EnabledState>
            <n2:Generation xsi:nil="true"/>
            <n2:HealthState xsi:nil="true"/>
            <n2:InstallDate xsi:nil="true"/>
            <n2:InstanceID xsi:nil="true"/>
            <n2:LastLoadInfo xsi:nil="true"/>
            <n2:Name>44454c4c-4200-1046-8030-c3c04f354431</n2:Name>
            <n2:NameFormat>HWA</n2:NameFormat>
            <n2:OperatingStatus xsi:nil="true"/>
            <n2:OtherDedicatedDescriptions>System Virtualization</n2:OtherDedicatedDescriptions>
            <n2:OtherEnabledState xsi:nil="true"/>
            <n2:PowerManagementSupported xsi:nil="true"/>
            <n2:PowerState xsi:nil="true"/>
            <n2:PrimaryOwnerContact xsi:nil="true"/>
            <n2:PrimaryOwnerName xsi:nil="true"/>
            <n2:PrimaryStatus xsi:nil="true"/>
            <n2:RequestedState>5</n2:RequestedState>
            <n2:ResetCapability>2</n2:ResetCapability>
            <n2:Status xsi:nil="true"/>
            <n2:TimeOfLastStateChange xsi:nil="true"/>
            <n2:TransitioningToState>12</n2:TransitioningToState>
            <n2:WakeUpType xsi:nil="true"/>
          </n2:OMC_UnitaryComputerSystem>
          <wsa:EndpointReference>
            <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
            <wsa:ReferenceParameters>
              <wsman:ResourceURI>http://schema.omc-project.org/wbem/wscim/1/cim-schema/2/OMC_UnitaryComputerSystem</wsman:ResourceURI>
              <wsman:SelectorSet>
                <wsman:Selector Name="CreationClassName">OMC_UnitaryComputerSystem</wsman:Selector>
                <wsman:Selector Name="Name">44454c4c-4200-1046-8030-c3c04f354431</wsman:Selector>
              </wsman:SelectorSet>
            </wsa:ReferenceParameters>
          </wsa:EndpointReference>
        </wsman:Item>
        <wsman:Item>
          <n3:OMC_IPMISubSystem>
            <n3:Caption>Hardware Management Controller</n3:Caption>
            <n3:CommunicationStatus xsi:nil="true"/>
            <n3:CreationClassName>OMC_IPMISubSystem</n3:CreationClassName>
            <n3:Dedicated>28</n3:Dedicated>
            <n3:Description xsi:nil="true"/>
            <n3:DetailedStatus xsi:nil="true"/>
            <n3:ElementName>Hardware Management Controller (Node 0)</n3:ElementName>
            <n3:EnabledDefault>2</n3:EnabledDefault>
            <n3:EnabledState>0</n3:EnabledState>
            <n3:Generation xsi:nil="true"/>
            <n3:HealthState>0</n3:HealthState>
            <n3:InstallDate xsi:nil="true"/>
            <n3:InstanceID xsi:nil="true"/>
            <n3:Name>Management (Node 0)</n3:Name>
            <n3:NameFormat>Other</n3:NameFormat>
            <n3:OperatingStatus xsi:nil="true"/>
            <n3:OperationalStatus>0</n3:OperationalStatus>
            <n3:OtherEnabledState xsi:nil="true"/>
            <n3:PrimaryOwnerContact xsi:nil="true"/>
            <n3:PrimaryOwnerName xsi:nil="true"/>
            <n3:PrimaryStatus xsi:nil="true"/>
            <n3:RequestedState>12</n3:RequestedState>
            <n3:ResetCapability xsi:nil="true"/>
            <n3:Roles>Hardware Management Controller</n3:Roles>
            <n3:Status xsi:nil="true"/>
            <n3:TimeOfLastStateChange xsi:nil="true"/>
            <n3:TransitioningToState>12</n3:TransitioningToState>
          </n3:OMC_IPMISubSystem>
          <wsa:EndpointReference>
            <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
            <wsa:ReferenceParameters>
              <wsman:ResourceURI>http://schema.omc-project.org/wbem/wscim/1/cim-schema/2/OMC_IPMISubSystem</wsman:ResourceURI>
              <wsman:SelectorSet>
                <wsman:Selector Name="CreationClassName">OMC_IPMISubSystem</wsman:Selector>
                <wsman:Selector Name="Name">Management (Node 0)</wsman:Selector>
              </wsman:SelectorSet>
            </wsa:ReferenceParameters>
          </wsa:EndpointReference>
        </wsman:Item>
        <wsman:Item>
          <n4:VMware_HHRCController>
            <n4:Caption>Controller 0 (PERC 5/i Integrated)</n4:Caption>
            <n4:CardType>2</n4:CardType>
            <n4:CommunicationStatus xsi:nil="true"/>
            <n4:CreationClassName>VMware_HHRCController</n4:CreationClassName>
            <n4:Dedicated>3</n4:Dedicated>
            <n4:Description xsi:nil="true"/>
            <n4:DetailedStatus xsi:nil="true"/>
            <n4:ElementName>Controller 0 (PERC 5/i Integrated)</n4:ElementName>
            <n4:EnabledDefault>2</n4:EnabledDefault>
            <n4:EnabledState>2</n4:EnabledState>
            <n4:Generation xsi:nil="true"/>
            <n4:HealthState>5</n4:HealthState>
            <n4:IdentifyingDescriptions>Serial Number</n4:IdentifyingDescriptions>
            <n4:InstallDate xsi:nil="true"/>
            <n4:InstanceID xsi:nil="true"/>
            <n4:Name>vmwController0</n4:Name>
            <n4:NameFormat>Other</n4:NameFormat>
            <n4:OperatingStatus xsi:nil="true"/>
            <n4:OperationalStatus>2</n4:OperationalStatus>
            <n4:OtherEnabledState xsi:nil="true"/>
            <n4:OtherIdentifyingInfo>12345</n4:OtherIdentifyingInfo>
            <n4:PrimaryOwnerContact xsi:nil="true"/>
            <n4:PrimaryOwnerName xsi:nil="true"/>
            <n4:PrimaryStatus xsi:nil="true"/>
            <n4:RequestedState>11</n4:RequestedState>
            <n4:ResetCapability xsi:nil="true"/>
            <n4:Status xsi:nil="true"/>
            <n4:TimeOfLastStateChange xsi:nil="true"/>
            <n4:TransitioningToState>12</n4:TransitioningToState>
          </n4:VMware_HHRCController>
          <wsa:EndpointReference>
            <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
            <wsa:ReferenceParameters>
              <wsman:ResourceURI>http://schemas.vmware.com/wbem/wscim/1/cim-schema/2/VMware_HHRCController</wsman:ResourceURI>
              <wsman:SelectorSet>
                <wsman:Selector Name="CreationClassName">VMware_HHRCController</wsman:Selector>
                <wsman:Selector Name="Name">vmwController0</wsman:Selector>
              </wsman:SelectorSet>
            </wsa:ReferenceParameters>
          </wsa:EndpointReference>
        </wsman:Item>
      </wsman:Items>
      <wsen:EnumerationContext/>
      <wsman:EndOfSequence/>
    </wsen:EnumerateResponse>
  </s:Body>
</s:Envelope>

Re: openwsman XML parsing

by Klaus Kaempf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

* arasto02 <anmol.rastogi@...> [Nov 11. 2009 12:24]:
>
> Hi,
> I am trying to build xml parsing for SOAP request using openwsman API. Do
> let me know if there is any example to do this as i am unable to find any
> particular reference for this.

no, I'm not aware of any C language examples for the XML api.

> Below is code snipet that i am trying:

This code snippet looks reasonable. You might want to pay attention to
releasing aquired objects to prevent memory leakage.

There are also Perl, Python, and Ruby bindings for the openwsman
client API available, making it a bit easier to operate on SOAP/XML
elements.


Hth,

Klaus
---
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Openwsman-devel mailing list
Openwsman-devel@...
https://lists.sourceforge.net/lists/listinfo/openwsman-devel

Re: openwsman XML parsing

by arasto02 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

But my call is failing at

node = ws_xml_get_child(node, 0 XML_NS_WS_MAN,WSM_FILTER)

Regards,
Anmol Rastogi

-----Original Message-----
From: Klaus Kaempf [mailto:kkaempf@...]
Sent: Wednesday, November 11, 2009 7:36 PM
To: Anmol Rastogi
Cc: openwsman-devel@...
Subject: Re: [Openwsman-devel] openwsman XML parsing

Hi,

* arasto02 <anmol.rastogi@...> [Nov 11. 2009 12:24]:
>
> Hi,
> I am trying to build xml parsing for SOAP request using openwsman API. Do
> let me know if there is any example to do this as i am unable to find any
> particular reference for this.

no, I'm not aware of any C language examples for the XML api.

> Below is code snipet that i am trying:

This code snippet looks reasonable. You might want to pay attention to
releasing aquired objects to prevent memory leakage.

There are also Perl, Python, and Ruby bindings for the openwsman
client API available, making it a bit easier to operate on SOAP/XML
elements.


Hth,

Klaus
---
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)

"This email and any files transmitted with it contain confidential, proprietary,
privileged information of Symphony Services Corp (India) Pvt. Ltd. and are intended
solely for the use of the recipient/s to whom it is addressed. Any unauthorized
notifying, copying or distributing of this e-mail, directly or indirectly, and the
contents therein in full or part is prohibited by any entity who is not a recipient.
Any email received inadvertently or by mistake should be deleted by the entity who
is not a recipient thereof. You may be pleased to notify the sender immediately by
email and the email should be deleted from your system".
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Openwsman-devel mailing list
Openwsman-devel@...
https://lists.sourceforge.net/lists/listinfo/openwsman-devel

Re: openwsman XML parsing

by arasto02 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for your reply. my code is failing at node = ws_xml_get_child(node, 0 XML_NS_WS_MAN,WSM_FILTER).

It's not returning nay node though XML containing the child.

Klaus Kaempf wrote:
Hi,

* arasto02 <anmol.rastogi@symphonysv.com> [Nov 11. 2009 12:24]:
>
> Hi,
> I am trying to build xml parsing for SOAP request using openwsman API. Do
> let me know if there is any example to do this as i am unable to find any
> particular reference for this.

no, I'm not aware of any C language examples for the XML api.

> Below is code snipet that i am trying:

This code snippet looks reasonable. You might want to pay attention to
releasing aquired objects to prevent memory leakage.

There are also Perl, Python, and Ruby bindings for the openwsman
client API available, making it a bit easier to operate on SOAP/XML
elements.


Hth,

Klaus
---
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Openwsman-devel mailing list
Openwsman-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openwsman-devel

Re: openwsman XML parsing

by Klaus Kaempf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

* Anmol Rastogi <Anmol.Rastogi@...> [Nov 12. 2009 10:43]:
> But my call is failing at
>
> node = ws_xml_get_child(node, 0 XML_NS_WS_MAN,WSM_FILTER)

Ah, must have missed this from your first mail.

The problem is already before when you try to get the
WSENUM_ENUMERATE_RESP. You're using the wrong XML namespace
(XML_NS_SOAP_) but it should be wsen (XML_NS_ENUMERATION).
The first node within <s:body> is '<wsen:EnumerateResponse>'

Getting a WSM_FILTER node fails simply because there is no
<wsman:Filter> node in the XML tree.

Hth,

Klaus
---
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Openwsman-devel mailing list
Openwsman-devel@...
https://lists.sourceforge.net/lists/listinfo/openwsman-devel

Re: openwsman XML parsing

by arasto02 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks once again for your reply.
It's seem that it's working now but just after <wsen:EnumerateResponse> I have <wsman:Items> so in this case what should be the name space need to be passed to get the next node and what is the way to iterate on child??

-----Original Message-----
From: Klaus Kaempf [mailto:kkaempf@...]
Sent: Thursday, November 12, 2009 3:32 PM
To: Anmol Rastogi
Cc: openwsman-devel@...
Subject: Re: [Openwsman-devel] openwsman XML parsing

* Anmol Rastogi <Anmol.Rastogi@...> [Nov 12. 2009 10:43]:
> But my call is failing at
>
> node = ws_xml_get_child(node, 0 XML_NS_WS_MAN,WSM_FILTER)

Ah, must have missed this from your first mail.

The problem is already before when you try to get the
WSENUM_ENUMERATE_RESP. You're using the wrong XML namespace
(XML_NS_SOAP_) but it should be wsen (XML_NS_ENUMERATION).
The first node within <s:body> is '<wsen:EnumerateResponse>'

Getting a WSM_FILTER node fails simply because there is no
<wsman:Filter> node in the XML tree.

Hth,

Klaus
---
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)

"This email and any files transmitted with it contain confidential, proprietary,
privileged information of Symphony Services Corp (India) Pvt. Ltd. and are intended
solely for the use of the recipient/s to whom it is addressed. Any unauthorized
notifying, copying or distributing of this e-mail, directly or indirectly, and the
contents therein in full or part is prohibited by any entity who is not a recipient.
Any email received inadvertently or by mistake should be deleted by the entity who
is not a recipient thereof. You may be pleased to notify the sender immediately by
email and the email should be deleted from your system".
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Openwsman-devel mailing list
Openwsman-devel@...
https://lists.sourceforge.net/lists/listinfo/openwsman-devel

Re: openwsman XML parsing

by Klaus Kaempf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

* Anmol Rastogi <Anmol.Rastogi@...> [Nov 12. 2009 11:12]:
> Thanks once again for your reply.

> It's seem that it's working now but just after <wsen:EnumerateResponse>
> I have <wsman:Items> so in this case what should be the name space need
> to be passed to get the next node and what is the way to iterate on
> child??

Look at the start of the XML tree. All the namespaces are introduced
as <xmlns:XYZ="...">. The 'XYZ' part is used in the Header and Body
parts of the SOAP tree.

<wsman:Items> is using the 'wsman' namespace, introduced as
xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"

Find its value ("http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd") in
the 'wsman-names.h' include file of openwsman. This will lead to
XML_NS_WS_MAN as the namespace.

Hth,

Klaus
---
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Openwsman-devel mailing list
Openwsman-devel@...
https://lists.sourceforge.net/lists/listinfo/openwsman-devel

Re: openwsman XML parsing

by arasto02 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for your patience on this
Now I got stuck on what would be fourth corresponding parameter(i.e. local name) to ws_xml_get_child API in case of xml namespace XML_NS_WS_MAN ?

Could you please do let me know where I can get the complete reference for the namespace and their corresponding local name??

Regards,
Anmol Rastogi | NetIQ GOC
L +91.80.3027.1164 | M +91.9945.111.393
mailto:anmol.rastogi@...

ENGINEERING OUTCOME CERTAINTY

Symphony Services
Innovation and Excellence Center, 13/1, Kadubeesanahalli, Varthur Hobli, Bangalore, KA 560103
www.symphonysv.com

 Think before you print on recyclable paper: Remember - ink waste is hazardous!


-----Original Message-----
From: Klaus Kaempf [mailto:kkaempf@...]
Sent: Thursday, November 12, 2009 4:18 PM
To: Anmol Rastogi
Cc: openwsman-devel@...
Subject: Re: [Openwsman-devel] openwsman XML parsing

* Anmol Rastogi <Anmol.Rastogi@...> [Nov 12. 2009 11:12]:
> Thanks once again for your reply.

> It's seem that it's working now but just after <wsen:EnumerateResponse>
> I have <wsman:Items> so in this case what should be the name space need
> to be passed to get the next node and what is the way to iterate on
> child??

Look at the start of the XML tree. All the namespaces are introduced
as <xmlns:XYZ="...">. The 'XYZ' part is used in the Header and Body
parts of the SOAP tree.

<wsman:Items> is using the 'wsman' namespace, introduced as
xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"

Find its value ("http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd") in
the 'wsman-names.h' include file of openwsman. This will lead to
XML_NS_WS_MAN as the namespace.

Hth,

Klaus
---
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)

"This email and any files transmitted with it contain confidential, proprietary,
privileged information of Symphony Services Corp (India) Pvt. Ltd. and are intended
solely for the use of the recipient/s to whom it is addressed. Any unauthorized
notifying, copying or distributing of this e-mail, directly or indirectly, and the
contents therein in full or part is prohibited by any entity who is not a recipient.
Any email received inadvertently or by mistake should be deleted by the entity who
is not a recipient thereof. You may be pleased to notify the sender immediately by
email and the email should be deleted from your system".
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Openwsman-devel mailing list
Openwsman-devel@...
https://lists.sourceforge.net/lists/listinfo/openwsman-devel

Re: openwsman XML parsing

by Klaus Kaempf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

* Anmol Rastogi <Anmol.Rastogi@...> [Nov 12. 2009 12:26]:
> Thanks for your patience on this
> Now I got stuck on what would be fourth corresponding parameter(i.e. local name) to ws_xml_get_child API in case of xml namespace XML_NS_WS_MAN ?

Prototypes for all xml api functions are in include/wsman-xml-api.h, see
http://openwsman.svn.sourceforge.net/viewvc/openwsman/openwsman/trunk/include/wsman-xml-api.h?view=markup

ws_xml_get_child() is defined as

WsXmlNodeH ws_xml_get_child(WsXmlNodeH parent, int index, const char *nsUri, const char *localName);

with

  parent: the XML parent node
  index: 0 => get first child
         >0 => get n'th child
  nsUri: XML namespace
  localName: XML node name
 
You can call it as
  ws_xml_get_child(parent, n, NULL, NULL)
to retrieve the n'th child of a node regardless of namespace or name

Or you call it as
  ws_xml_get_child(parent, 0, namespace, name)
to retrieve the first child of a node matching <namespace:name ...>

Or you call it as
  ws_xml_get_child(parent, n, namespace, name)
to retrieve the n'th child of a node matching <namespace:name ...>

>
> Could you please do let me know where I can get the complete reference for the namespace and their corresponding local name??

Its in include/wsman-names.h of the openwsman source code. You can
view it also with a web browser at
http://openwsman.svn.sourceforge.net/viewvc/openwsman/openwsman/trunk/include/wsman-names.h?view=markup

Hth,

Klaus
---
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Openwsman-devel mailing list
Openwsman-devel@...
https://lists.sourceforge.net/lists/listinfo/openwsman-devel

Re: openwsman XML parsing

by arasto02 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks dear. I really want to appreciate your effort on this. Now I am able to parse the entire XML very easily. Is there any site where I can give kudos to you??

Regards,
Anmol Rastogi
 M +91.9945.111.393

-----Original Message-----
From: Klaus Kaempf [mailto:kkaempf@...]
Sent: Thursday, November 12, 2009 5:11 PM
To: Anmol Rastogi
Cc: openwsman-devel@...
Subject: Re: [Openwsman-devel] openwsman XML parsing

* Anmol Rastogi <Anmol.Rastogi@...> [Nov 12. 2009 12:26]:
> Thanks for your patience on this
> Now I got stuck on what would be fourth corresponding parameter(i.e. local name) to ws_xml_get_child API in case of xml namespace XML_NS_WS_MAN ?

Prototypes for all xml api functions are in include/wsman-xml-api.h, see
http://openwsman.svn.sourceforge.net/viewvc/openwsman/openwsman/trunk/include/wsman-xml-api.h?view=markup

ws_xml_get_child() is defined as

WsXmlNodeH ws_xml_get_child(WsXmlNodeH parent, int index, const char *nsUri, const char *localName);

with

  parent: the XML parent node
  index: 0 => get first child
         >0 => get n'th child
  nsUri: XML namespace
  localName: XML node name

You can call it as
  ws_xml_get_child(parent, n, NULL, NULL)
to retrieve the n'th child of a node regardless of namespace or name

Or you call it as
  ws_xml_get_child(parent, 0, namespace, name)
to retrieve the first child of a node matching <namespace:name ...>

Or you call it as
  ws_xml_get_child(parent, n, namespace, name)
to retrieve the n'th child of a node matching <namespace:name ...>

>
> Could you please do let me know where I can get the complete reference for the namespace and their corresponding local name??

Its in include/wsman-names.h of the openwsman source code. You can
view it also with a web browser at
http://openwsman.svn.sourceforge.net/viewvc/openwsman/openwsman/trunk/include/wsman-names.h?view=markup

Hth,

Klaus
---
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)

"This email and any files transmitted with it contain confidential, proprietary,
privileged information of Symphony Services Corp (India) Pvt. Ltd. and are intended
solely for the use of the recipient/s to whom it is addressed. Any unauthorized
notifying, copying or distributing of this e-mail, directly or indirectly, and the
contents therein in full or part is prohibited by any entity who is not a recipient.
Any email received inadvertently or by mistake should be deleted by the entity who
is not a recipient thereof. You may be pleased to notify the sender immediately by
email and the email should be deleted from your system".
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Openwsman-devel mailing list
Openwsman-devel@...
https://lists.sourceforge.net/lists/listinfo/openwsman-devel

Re: openwsman XML parsing

by Klaus Kaempf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

* Anmol Rastogi <Anmol.Rastogi@...> [Nov 12. 2009 13:22]:
> Thanks dear. I really want to appreciate your effort on this. Now I am able to parse the entire XML very easily.

Great !

> Is there any site where I can give kudos to you??

Spread the word and praise openwsman.org ;-)

Klaus
---
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Openwsman-devel mailing list
Openwsman-devel@...
https://lists.sourceforge.net/lists/listinfo/openwsman-devel