Integrations and APIs for Service

Get Involved. Join the Conversation.

Topic

    Bharath Lohray
    PHP & SOAP APIAnswered
    Topic posted June 16, 2011 by Bharath LohrayBlue Ribbon: 750+ Points, last edited October 29, 2011, tagged SOAP 
    1189 Views, 5 Comments
    Title:
    PHP & SOAP API
    Content:

    I know that RightNow does not support PHP as a platform for the SOAP API. However, I was wondering if I could get some suggestiosn on how to parse an XML response that I received in php.

    I had attempted to use simpleXML and all I reecived was

    SimpleXMLElement Object
    (
    )
    

    I am looking for a way to parse the XML the right way. I would really like to avoid making a hack and work around kind of a program.

     

    Thank you.

    Best Comment

    Bharath Lohray

    Hi,

    I parsed it using the PHP DOM functions. It totally ignored the namespaces and just went on with the tag names. This is a compromise between a solution and a hack.

    Comment

     

    • Ryan McCullough

      Your best bet is to use the WSO2 PHP Soap Toolkit:

      http://wso2.com/products/web-services-framework/php/

    • Bharath Lohray

      Thank you for the quick response. I lookd into this. The installation guide states that I need to copy a few .dll files into the php folder. My organization security policies will not this happen :-(

      Is there a platform / solution that can be implemented with just php5 (using bundled libraries)?

       

      Thank you.

    • Daniel Andrews

      Which version of PHP are you using? SimpleXML used to have a bug with ':' in element tags, but as of PHP 5.1.3 this issue has been fixed. 

    • Bharath Lohray

      Hi,

      I parsed it using the PHP DOM functions. It totally ignored the namespaces and just went on with the tag names. This is a compromise between a solution and a hack.

    • Mark Ericson

      It isn't very safe to parse XML ignoring the namespaces.  It may work for now, but it definitely could break when there are any duplicate use of element names.  Namespaces are used to disambiguate.

      I don't know much details about using it, but supposedly you can instantiate a namespace aware version of the PHP XML-Parser with xml_parser_create_ns( ).