Consume PHP Web Service

1

I'm trying to consume a Web Service and I'm not getting the results you expect.

Apparently the error I was able to figure out is in the structure as I am passing the Vector of arguments to the method call, I have already tried to do it in several ways and still continue with the error.

The web service request framework I am using is shown below.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.senior.com.br">
      <soapenv:Body>
        <ser:ColaboradoresAdmitidos>
          <user>String</user>
          <password>String</password>
          <encryption>Integer</encryption>
          <parameters>
            <NumEmp>Integer</NumEmp>
            <AbrTipCol>String</AbrTipCol>
            <IniPer>DateTime</IniPer>
            <FimPer>DateTime</FimPer>
          </parameters>
        </ser:ColaboradoresAdmitidos>
      </soapenv:Body>
    </soapenv:Envelope>

My PHP code is this:

$url = new SoapClient('http://10.50.3.3:8080/g5-senior-services/rubi_Synccom_senior_g5_rh_fp_colaboradoresAdmitidos?wsdl');

    $funcao     = 'ColaboradoresAdmitidos';
    $argumentos = array('ColaboradoresAdmitidos'=> 
                          array('user'        => 'USER',
                                'password'    => 'XXX',
                                'encryption'  =>  0,
                                'parameters'  => 
                                array('NumEmp'=> 1,

                                      'AbrTipCol' => 1,

                                      'IniPer'    => '01/01/2018',

                                      'FimPer'    => '01/01/2018')
                           ) 
                  );

$opcoes  = array('location' => 'http://10.50.3.3:8080/g5-senior-services/rubi_Synccom_senior_g5_rh_fp_colaboradoresAdmitidos');
$result  = $url->__soapCall($funcao,$argumentos,$opcoes);

The result I get is the following: There was an error running the "AP - Supported Employees" service: Mandatory parameter values were not reported.

Details: Mandatory parameters not reported:

  • NumEmp
  • AbrTipCol
  • IniPer

I am passing the parameters that the message says I have not passed, if anyone can help me, maybe I'm just wrong in assembling the array arguments for the method call soap__call

    
asked by anonymous 11.04.2018 / 19:49

0 answers