Osiris Sandoval
Osiris Sandoval

Reputation: 1

How add level in SoapServer using SoapVar

I need to emulate this in PHP the original was made in C#:

<s:Envelope>
   <s:Body>
      <ExpedirCFDI_SinSesion_ConAddendaResponse>
            <a:CadenaOriginal>OriginalString</a:CadenaOriginal>
            <a:CodigoError>0</a:CodigoError>
            <a:DescripcionError>Proceso exitoso</a:DescripcionError>
            <a:FechaCertificacion>2024-08-23T19:07:33</a:FechaCertificacion>
            <a:NumeroCertificadoSAT>30001000000500000000</a:NumeroCertificadoSAT>
            <a:SelloCfdTimbrado>CertificateSeal</a:SelloCfdTimbrado>
           <a:SelloSAT>SatSeal</a:SelloSAT>
            <a:Timbrado>true</a:Timbrado>
            <a:TokenTimbradoAsincrono/>
            <a:Uuid>ThisUUID</a:Uuid>
            <a:XmlTimbrado><![CDATA[xmlTimbrado...]]></a:XmlTimbrado>
         </ExpedirCFDI_SinSesion_ConAddendaResult>
      </ExpedirCFDI_SinSesion_ConAddendaResponse>
      </s:Body>
    </s:Envelope>

I get this actually:

    <SOAP-ENV:Envelope>
       <SOAP-ENV:Body>
      <ns2:ExpedirCFDI_SinSesion_ConAddendaResponse>
            <CadenaOriginal>OriginalString</CadenaOriginal>
            <CodigoError>0</CodigoError>
            <DescripcionError>Proceso exitoso</DescripcionError>
            <FechaCertificacion>2024-08-23T19:07:33</FechaCertificacion>
            <NumeroCertificadoSAT>30001000000500000000</NumeroCertificadoSAT>
            <SelloCfdTimbrado>CertificateSeal</SelloCfdTimbrado>
           <SelloSAT>SatSeal</SelloSAT>
            <Timbrado>true</Timbrado>
            <TokenTimbradoAsincrono/>
            <Uuid>ThisUUID</Uuid>
            <XmlTimbrado><![CDATA[xmlTimbrado...]]></XmlTimbrado>
      </ExpedirCFDI_SinSesion_ConAddendaResponse>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

I need add the: <ExpedirCFDI_SinSesion_ConAddendaResponse>

Section...

The code is:

$r = [
        new SoapVar ($result['CadenaOriginal'], XSD_STRING, null, null, 'CadenaOriginal',];

    $result = new SoapVar ($r, SOAP_ENC_ARRAY, null, null, 'ExpedirCFDI_SinSesion_ConAddendaResult');
    
    $DatosCfdi = new SoapVar ($result, SOAP_ENC_ARRAY, null, null, 'IComITManagerSW_ExpedirCFDI_SinSesion_ConAddenda_OutputMessage');
    

    $returnValue = $DatosCfdi;

But, does not appear the section.

Explanation of how use and control the elements with SoapServer and SoapVar

Upvotes: 0

Views: 12

Answers (0)

Related Questions