locked
Defining an XML Method & PHP RRS feed

  • Question

  • User-721934350 posted

    Hi there,

    I have a WebService that has been used for a while by other users without any problems. My WebService calls are defined as follows:

    [WebMethod] 
    public XmlDocument MarkIt(String xmlNodePassed)

    I basically take XML in a string format.

    I now have a PHP client who cannot make this call .... they show me the "xml" - which in my way of thinking is just a string, but I am 99.9% certain they are sending an XML object and not the "XML" text,

    I thought I would write a new web service function and let it receive Xml, but this seems to be more complicated than I thought.

    I would have thought the following would work, but I cannot seem to pass an XML document to it .. can someone see what I am doing wrong?

    [WebMethod]
    public XmlDocument MarkIt2(XmlDocument xmlNodePassed)

    TIA

    Thursday, October 17, 2013 4:31 PM

Answers

  • User-488622176 posted

    I have no experience with PHP, but XmlDocument is a C#/.NET framework object that, as far as I know, has no mapped alternative in PHP.

    Use primitive datatypes such as int, string, bool, ... for interoperability. Furthermore, I'd recommend WCF instead of the old webservices ...

    See this article for sample code in C# & PHP : http://www.codeproject.com/Questions/442208/ConsumeWCF-service-from-PHP

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 18, 2013 4:25 AM