XML oluşturmak için SOAP kullanarak PHP niteliklerini

2 Cevap php

Ben php SOAP bu üretebilir bulundu:

<foo bar="blah">12345</foo>

Bu grubu:

array("foo" => array("_" => 12345, "bar" => "blah"));

Ancak, çizgi yöntemi değer bir sayı ve dize değilken çalışmak için görünmüyor, ancak bunun yerine embedded xml code. Bu örnek için ne yapardınız?

<foo bar="blah">
    <aaa a="b">blah</aaa>
</foo>

This is an extension of this person's question: http://www.bigresource.com/Tracker/Track-php-uQwDoUib/

2 Cevap

Ben test hızlı bir yolu yok, ama belki bu işe:

$a = array(
    'foo' => array(
        'bar' => 'blah',
        'aaa' => array(
            '_' => 'blah',
            'a' => "b",
        ),
    ),  
);

Nasıl bir fonksiyonu olan bir düğüme bir nitelik ekleyebilirsiniz;

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

veya

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

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

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

ama ihtiyacım var

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.veyag/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/" veya something like that.