<?php
require_once("nusoap.php");
require_once("functions.php");
$ns="http://www.miservidor.com.ar/";
$server = new soap_server();
$server->configureWSDL('Calculator',$ns);
$server->wsdl->schemaTargetNamespace=$ns;
// register a web service method
$server->wsdl->addComplexType('argAuth','complexType','struct','all','',
array(
'Token' => array ('name' => 'Token1', 'type'=>'xsd:string'),
'Sign' => array ('name' => 'Sign1' , 'type'=>'xsd:string'),
'Cuit' => array ('name' => 'cuit1' , 'type'=>'xsd:long' )
)
);
$server->wsdl->addComplexType('Fecr','complexType','struct','all','',
array(
'id' => array ('name' => 'id1', 'type'=>'xsd:long' ),
'cantidadreg' => array ('name' => 'cantidadreg1', 'type' =>'xsd:int'),
'presta_serv' => array ('name' => 'presta_serv1', 'type' =>'xsd:int')
)
);
$server->wsdl->addComplexType('FEDetalleRequest','complexType','struct','all','',
array(
'tipo_doc' => array ('name' => 'tipo_doc1', 'type'=>'xsd:int'),
'nro_doc' => array ('name' => 'nro_doc1', 'type' => 'xsd:long'),
'tipo_cbte' => array ('name' => 'tipo_cbte1' , 'type' => 'xsd:int'),
'punto_vta' => array ('name' => 'punto_vte1' , 'type' => 'xsd:int'),
'cbt_desde' => array ('name' => 'cbt_desde1' , 'type' => 'xsd:long'),
'cbt_hasta' => array ('name' => 'cbt_hasta1' , 'type' => 'xsd:long'),
'imp_total' => array ('name' => 'imp_total1' , 'type' => 'xsd:double'),
'imp_tot_conc' => array('name' => 'imp_tot_conc1' , 'type' => 'xsd:double'),
'imp_neto' => array ('name' => 'imp_neto1', 'type' => 'xsd:double'),
'impto_liq' => array ('name' => 'impto_liq1' , 'type' => 'xsd:double'),
'impto_liq_rni' => array ('name' => 'impto_liq_rni1' , 'type' => 'xsd:double'),
'imp_op_ex' => array ('name' => 'imp_op_ex1' , 'type' => 'xsd:double'),
'fecha_cbte' => array ('name' => 'fecha_cbte1' , 'type' => 'xsd:string'),
'fecha_serv_desde' => array ('name' => 'fecha_cbte_desde1' , 'type' => 'xsd:string'),
'fecha_serv_hasta' => array ('name' => 'fecha_serv_hasta1' , 'type' => 'xsd:string'),
'fecha_venc_pago' => array ('name' => 'fecha_vec_pago1' , 'type' => 'xsd:string')
)
);
$server->wsdl->addComplexType ('Fedr','complexType','array','','SOAP-ENC:Array',array(),
array (array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:FEDetalleRequest[]')),
'tns:Fedr'
);
$server->wsdl->addComplexType('FEDetalleResponse','complexType','struct','all','',
array(
'tipo_doc' => array ('name' => 'tipo_doc', 'type'=>'xsd:int'),
'nro_doc' => array ('name' => 'nro_doc', 'type' => 'xsd:long'),
'tipo_cbte' => array ('name' => 'tipo_cbte' , 'type' => 'xsd:int'),
'punto_vta' => array ('name' => 'punto_vte' , 'type' => 'xsd:int'),
'cbt_desde' => array ('name' => 'cbt_desde' , 'type' => 'xsd:long'),
'cbt_hasta' => array ('name' => 'cbt_hasta' , 'type' => 'xsd:long'),
'imp_total' => array ('name' => 'imp_total' , 'type' => 'xsd:double'),
'imp_tot_conc' => array('name' => 'imp_tot_conc' , 'type' => 'xsd:double'),
'imp_neto' => array ('name' => 'imp_neto', 'type' => 'xsd:double'),
'impto_liq' => array ('name' => 'impto_liq' , 'type' => 'xsd:double'),
'impto_liq_rni' => array ('name' => 'impto_liq_rni' , 'type' => 'xsd:double'),
'imp_op_ex' => array ('name' => 'imp_op_ex' , 'type' => 'xsd:double'),
'resultado' => array('name' => 'resultado' , 'type' => 'xsd:string'),
'cae' => array('name'=> 'cae','type' => 'xsd:string'),
'fecha_cbte' => array ('name' => 'fecha_cbte' , 'type' => 'xsd:string'),
'fecha_vto' => array('name' => 'fecha_vto', 'type'=> 'xsd:string'),
'motivo' => array('name' => 'motivo' , 'type' => 'xsd:string'),
'fecha_serv_desde' => array ('name' => 'fecha_cbte_desde' , 'type' => 'xsd:string'),
'fecha_serv_hasta' => array ('name' => 'fecha_serv_hasta' , 'type' => 'xsd:string'),
'fecha_venc_pago' => array ('name' => 'fecha_vec_pago' , 'type' => 'xsd:string')
)
);
$server->wsdl->addComplexType('Fer','complexType','array','','SOAP-ENC:Array',array(),
array ( array('ref' => 'SOAP-ENC:arrayType','wsdl:arrayType' => 'tns:Fecr[]'),
array('ref' => 'SOAP-ENC:arrayType','wsdl:arrayType' => 'tns:Fedr[]')),
'tns:Fer'
);
$server->wsdl->addComplexType ('FedResp','complexType','array','','SOAP-ENC:Array',array(),
array( array('ref' => 'SOAP-ENC:arrayType','wsdl:arrayType' => 'tns:FEDetalleResponse[]')),
'tns:FedResp'
);
$server->wsdl->addComplexType ('FEAutRequest','complexType','array','','SOAP-ENC:Array',array(),
array( array('ref' => 'SOAP-ENC:arrayType','wsdl:arrayType' => 'tns:argAuth[]'),
array('ref' => 'SOAP-ENC:arrayType','wsdl:arrayType' => 'tns:Fer[]')),
'tns:FEAutRequest'
);
$server->wsdl->addComplexType ('FecResp','complextype','struct','all','',
array(
'id' => array('name' => 'id', 'type' => 'xsd:long'),
'cuit' => array('name' => 'cuit' , 'type' => 'xsd:long'),
'fecha_cae' => array('name' => 'fecha_cae' , 'type' => 'xsd:string'),
'cantidadreg' => array('name' => 'cantidadreg' , 'type' => 'xsd:int'),
'resultado' => array('name' => 'resultado' , 'type' => 'xsd:string'),
'motivo' => array('name' => 'motivo' , 'type' => 'xsd:string'),
'reproceso' => array('name' => 'reproceso' , 'type'=>'xsd:string'),
'presta_serv' => array('name' => 'presta_serv' , 'type' => 'xsd:int')
)
);
$server->wsdl->addComplextype ('RError','complexType','struct','all','',
array (
'percode' => array('name' => 'percode' , 'type'=> 'xsd:int'),
'perrmsg' => array('name' => 'perrmsg' , 'type'=> 'xsd:string')
)
);
$server->wsdl->addComplexType('FEAutRequestResult','complexType','array','','SOAP-ENC:Array',array(),
array( array('ref'=> 'SOAP-ENC:arrayType','wsdl:arrayType' => 'tns:FecResp[]'),
array('ref'=> 'SOAP-ENC:arrayType','wsdl:arrayType' => 'tns:FedResp[]'),
array('ref'=> 'SOAP-ENC:arrayType','wsdl:arrayType' => 'tns:RError[]' )),
'tns:FEAutRequestResult'
);
$server->wsdl->addComplexType('FEAutRequestResponse','complexType','array','','SOAP-ENC:Array',array(),
array( array('ref'=> 'SOAP-ENC:arrayType','wsdl:arrayType' => 'tns:FEAutRequestResults[]')),
'tns:FEAutRequestResponse'
);
$server->register('FacturaElectronica',
array( 'solicitud' => 'tns:FEAutRequest'),
array( 'respuesta' => 'tns:FEAutRequestResponse'),
$ns,
"$ns#FEAuth",
'rpc',
'encoded',
'Simula el procedimiento de autenticacion de una factura de la AFIP'
);
$server->service($HTTP_RAW_POST_DATA);
?>