0 Replies Latest reply on Feb 15, 2008 8:43 AM by garag

    Problem managing Web Service answer in XML format

    garag Level 1
      Hi All,

      I have a problem managing a XML returned by a call to a WebServices.

      For example, my WebService call returns a XML like this:

      <Response xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns=" http://MyWebServiceIP/MyWebService/" xmlns:soap=" http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance">
      <ResultList>
      <Client1>
      <Name1>1</Name1>
      <CompanyId1>1</CompanyId1>
      </Client1>
      <Client2>
      <Name2>2</Name2>
      <CompanyId2>2</CompanyId2>
      </Client2>
      </ResultList>
      </Response>

      When I try to select a specific node of this XML, for example if I try to read the path:

      MyXml.Response.ResultList.Client1.Name1 (*)

      it returns an empty value.

      Investigating on this, I have discovered that the string xmlns=" http://MyWebServiceIP/MyWebService/" in the Xml generates problem.

      Infact, if I try to select the same path in the (*), in the original XML without the xmlns=" http://MyWebServiceIP/MyWebService/" :

      <Response xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:soap=" http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance">
      <ResultList>
      <Client1>
      <Name1>1</Name1>
      <CompanyId1>1</CompanyId1>
      </Client1>
      <Client2>
      <Name2>2</Name2>
      <CompanyId2>2</CompanyId2>
      </Client2>
      </ResultList>
      </Response>


      I obtain the right value.

      It seems that the namespace xmlns=" http://MyWebServiceIP/MyWebService/" creates problem reading the XML.

      Are someone expienced something like this?

      Any help will be appreciated.

      Thank you very much