Using SOAP to generate XML attributes in PHP

前端 未结 2 605
孤独总比滥情好
孤独总比滥情好 2021-01-13 19:40

I found you can generate this in SOAP in php:

12345

With this:

array(\"foo\" => arra         


        
相关标签:
2条回答
  • 2021-01-13 20:01

    I don't have a quick way of testing, but maybe this would work:

    $a = array(
        'foo' => array(
            'bar' => 'blah',
            'aaa' => array(
                '_' => 'blah',
                'a' => "b",
            ),
        ),  
    );
    
    0 讨论(0)
  • 2021-01-13 20:04

    How can you add an attribute to a node that is the function;

    $update = $soap->UpdateMember($pRecord);
    

    or

    $update = $soap->__soapCall('UpdateMember', array($Updates));
    

    I need to add namescape or xmlns attribute to the actual function name here. I'm getting the following;

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.sample.net/">
    <SOAP-ENV:Body>
    <ns1:UpdateMember>
    MORE XML HERE
    </ns1:UpdateMember>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    

    but I need

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.sample.net/">
    <SOAP-ENV:Body>
    <ns1:UpdateMember xmlns="http://www.sample.net/">
    MORE XML HERE
    </ns1:UpdateMember>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    

    Need to have ns1:UpdateMember xmlns:ns1="http://www.sample.net/" or something like that.

    0 讨论(0)
提交回复
热议问题