Error consuming Webservice SOAP in php

Asked

Viewed 580 times

0

I’m having a hard time consuming a Webservice in PHP, whenever I request via Soapclient I get the following error message:

'Nonetype' Object has no attribute 'unmarshall'

The call is being made as follows:

$conta = 'conta';
$token = 'token';
$url = 'url/soap?WSDL';

$soap_client = new SoapClient($url);

$soap_client->ProcessoAndamentosTodos($token, $conta, $parametro3);

Would anyone know how to fix it? Or what I’m doing wrong?

  • Does it have any model of how the WS should respond?

  • @Danielcosta, actually he should return a list with the information. One thing I realized but I confess that I do not know what it is: it seems that this WSDL has a protType that would be where I could access the methods, without accessing them directly. I just don’t know how to do it using php’s Soapclient. I did a test with C# and there, I was able to access, but using the so called protType.

2 answers

1


Well, I managed to solve the problem, I will leave the solution of what I did here, in case someone is with this same problem. The WSDL in question uses porType, and so it does not pass the parameters directly as I had done. In this way, I was able to access the methods in the following way:

$conta = 'conta';
$token = 'token';
$url = 'url/soap?WSDL';

$soap_client = new SoapClient($url);

$params = array('param1'=>$param1, 'param2'=>$param2, 'param3'=>$param1);

var_dump($soap_client->ProcessoAndamentosTodos($params));

Another form of access that also works is the following:

var_dump($soap_client->__soapCall('ProcessoAndamentosTodos', array($params)));

0

This error means that some method/attribute is returning Null and Voce is trying to access the attribute NodeValue of it. Try to verify the nulls of the WS responses.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.