Pregunta

Voy a empezar por decir que nunca he usado jabón antes.

De todos modos, aquí está el código que estoy tratando de crear.

<soapenv:Body> 
<Circuits xmlns="http://www.qpricer.com/Services/Pricing"> 
<Circuit bandwidth="DS-3" port-billing-type="Flat" product="Dedicated Voice" term="1-Year"> 
<ns1:Loop npanxx="212255" xmlns:ns1="http://www.qpricer.com/Schema/Pricing"> 
<ns1:Address city="MANHATTAN" postal-code="10011" state="NY" street="111 8 AV FLR 1"/> 
</ns1:Loop> 
</Circuit> 
</Circuits> 
</soapenv:Body>

Las cabeceras ya están en su lugar. Puedo llamar el servicio es bueno.

Lo que tengo es este

//Make the call  
$result = $client->Price('Circuits',
        array(
        'Circuit'           =>  array(
        'product'           =>  'Dedicated Voice',
        'port-billing-type' => 'flat',
        'term'              =>  '1-Year',
        'bandwidth'         =>  'DS-3'
        ),

        'Loop'              =>  array(
        'npanxx'            =>  '212255'
        ),

        'Address'           =>  array(
        'street'            =>  '111 8 AV FLR 1',
        'city'              =>  'MANHATTAN',
        'state'             =>  'NY',
        'postal-code'       =>  '10011')
        ));

// Display the result  
print_r($client->__getLastRequest());  
print_r($result);
¿Fue útil?

Solución

¿Funciona esto:

$result = $client->Price('Circuits',
    array(
    'Circuit'           =>  array(
        '_'                 => array(
            'Loop'              =>  array(
                '_' => '',
                'npanxx'            =>  '212255'
            ),
            'Address'           =>  array(
                '_' => '',
                'street'            =>  '111 8 AV FLR 1',
                'city'              =>  'MANHATTAN',
                'state'             =>  'NY',
               'postal-code'       =>  '10011'
            ) 
         ),
        'product'           =>  'Dedicated Voice',
        'port-billing-type' => 'flat',
        'term'              =>  '1-Year',
        'bandwidth'         =>  'DS-3'
        )
    ));

El '_' parece ser indocumentado pero factibles. Si esto no funciona, pruebe los comentarios http: //www.php .net / manual / es / soapvar.soapvar.php .

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top