integration with SOAP protocol with PHP Help!

0

I want to integrate a server (Client) to the server of my work. The problem is that the client uses the SOAP protocol for sending data information, something that currently is not seen much and I can not find the information I need.

I show the code that connects to the client server.

<?php class Client{
private $_soapClient = null;
public function __construct(){
    require_once(getcwd() . '/lib/nusoap.php');
    $this->_soapClient = new nusoap_client("http://serverservice/Service.asmx", true);
    $this->_soapClient->soap_defencoding = 'UTF-8';
}
public function Magento_GrabarPedido(){
    try
    {
        $result = $this->_soapClient->call('Magento_GrabarPedido', array(
            "idVistaMagento" => "string",
            "idPedidoMagento" => "string",
            "productosCarro" => "string",
            "gastosEnvio" => "0",
            "cifCliente" => "string",
            "shipToName" => "string",
            "shipToAddress" => "string",
            "shipToPostCode" => "string",
            "shipToCity" => "string",
            "shipToCounty" => "string",
            "shipToCountry" => "string",
            "shipToPhone" => "string",
            "shipToMail" => "string",
            "observaciones" => "string",
            "formaPago" => "string",
            "newsletter"=> "string",
            "apellido1" => "string",
            "apellido2" => "string",
            "sexo" => "1",
            "fechaNacimiento" => "string"
        ));
        $this->_soapResponse($result);
    }
    catch (SoapFault $fault)
    {
        trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);
    }
}
private function _soapResponse($result)
{
    echo '<h2>Result</h2>';
    echo '<h2>Request</h2>' . print_r($result);
    echo '<h2>XML Response</h2>';
    echo $this->_soapClient->responseData;
    echo '<h2>Request</h2>' . $this->_soapClient->request;
    echo '<h2>Response</h2>' . $this->_soapClient;
    echo '<h2>Debug</h2>' . $this->_soapClient->debug_str;
}}?>

At the same time, I have a file that shows the result

<?php 
     require_once(getcwd() . '/Client.php');
     $client = new Client();
     $client->Magento_GrabarPedido();

 ?>

Apparently with this something works because even the styles of that url " link " brings them to mine but returns a series of illegible matrices and codes that I do not understand much. Alfinal of everything I could find a particular error

2018-08-17 09:38:58.808243 nusoap_client: checkWSDL 2018-08-17 09:38:58.808243 nusoap_client: got wsdl error: XML error parsing WSDL from http://serverservice/Service.asmx on line 1293: Mismatched tag

I guess what I'm missing is the WSDL ... so I decided to add the wsdl to the url with link , but I received an error again.

Array ( [Magento_GrabarPedidoResult] => Error;It does not find the message in the queue. Check event viewer )

Ah, this point, I do not know what to do, I can not even understand the error well. This is my first question in the forum of programmers, I know that not many people work with this technology, but I need an answer, please. I'm desperate.

    
asked by Nazareno Ciancaglini 17.08.2018 в 12:50
source

0 answers