Recently we have received a couple of projects in which we consume webservices SOAP for data. The truth is that it was a while since I saw them in my usual work. A few years ago were very common for just about anything that would involve communication with external sources, however recent years had fallen into disuse for some simple things complicated since quite a job with a simple HTTP request and basic XML could be resolved . Precisely this has always been one of the main criticisms of the protocol SOAP , high bandwidth consumption for a simple request.
Until now had always used nusoap to make SOAP calls from PHP , however I ran into a problem when accessing a service of an important means of international communication. The call nusoap not returning results while from html test system everything worked properly.
After giving many turns and did not find any errors (other requests to the same service itself that worked) I realized that PHP already has a set of SOAP functions native, so no need nusoap. The question was would it work well, as it were. After adding the appropriate extension arises a small inconsistency. Nusoap can not use native and you run the same installation of PHP. Put another way, if you enable the SOAP extension, nusoap stop working and start throwing error messages because many of the functions you use have the same name as the native, which would then be reserved names. If you have any application that uses nusoap on the same machine also have to migrate it to use native functions.
Today's example is a simple call to a service that returns a list of news.
The process is very simple, you need the url of the webservice, the method that you call and the parameters to pass and, as in any SOAP service will return XML.
- ; //url del servicio $ Service = "http://dominio.com/noticias?wsdl" / / url of the service
- 'idioma' ] = "es" ; $ Parameters ['language'] = "is";
- 'usuario' ] = "manolo" ; $ Parameters ['user'] = "manolo";
- 'clave' ] = "tuclave" ; $client = new SoapClient ( $servicio , $parametros ) ; $ Parameters ['key'] = "tuclave"; $ client = new SoapClient ($ service, $ parameters);
- -> getNoticias ( $parametros ) ; //llamamos al métdo que nos interesa con los parámetros $ Result = $ client -> getNoticias ($ parameters) / / call the metdo that interests us the parameters
With these simple guidelines we have in $ result the result XML service call. How to work with XML is a bit cumbersome, convert it to an associative array so that we make it easier to process the data, we use the function obj2array I indicate below.
- $result ) ; $ Result = obj2array ($ result);
- [ 'resultado' ] [ 'noticias' ] ; $ News = $ result ['result'] ['news'];
- / / Process the result as any other array
- $i = 0 ; $i < $n ; $i ++ ) { for ($ i = 0, $ i <$ n, $ i + +) {
- [ $i ] ; $ News = $ news [$ i];
- [ 'id' ] ; $ Id = $ news ['id'];
- / / Here go the rest of your code where you process the data received
- }
- $obj ) { obj2array function ($ obj) {
- $obj as $key => $val ) { foreach ($ obj as $ key => $ val) {
- true ) { switch (true) {
- $key ] = obj2array ( $val ) ; $ Out [$ key] = obj2array ($ val);
- break;
- $key ] = obj2array ( $val ) ; $ Out [$ key] = obj2array ($ val);
- break;
- default:
- $key ] = $val ; $ Out [$ key] = $ val;
- }
- }
- ; return $ out;
- }
In the second line we keep the array elements that we want to process. If you do not know what your webservice returns can do a var_dump ($ result) and see all the results. In our case, as is a sequence of news, we are left with the item that has the news.
As you may have noticed, I have not worried error handling when calling the webservice. That I leave as an exercise to you, it's August and I do not want
. In Manual of PHP is all the information.
And that's all folks, today was a simple example but very useful when you need to use SOAP.










66 users have commented on "Consuming SOAP webservices from PHP"
Feed The comments to this entry TrackbackHolap such good the tutorial. I have a problem with the php SOAP. The problem is:
When calling a web service call without parameters it works perfectly, but to call it a WS with parameters I get the following error:
Fatal error: Uncaught SoapFault exception: [soap: Server] System.Web.Services.Protocols.SoapException: Server was unable to process request. -> System.Data.SqlClient.SqlException: Procedure or function 'GetBibleWordsByChapterAndVerse' expects parameter '@ BookTitle', que was not supplied. at WebServicex.BibleWebservice.GetBibleWordsByChapterAndVerse (String BookTitle, chapter Int32, Int32 Verse) - End of inner exception stack trace - in / home / cbarcos / htdocs / test / soapCliente.php: 35
This is my code:
$ Client = new SoapClient ("http://www.webservicex.net/BibleWebservice.asmx?wsdl", array ('trace' => 1));
$ Params = array (
SoapParam new ("Romans", "BookTitle")
new SoapParam (1, "chapter"),
new SoapParam (1, "Verse")
);
$ Data = $ client-> __soapCall ('GetBibleWordsByChapterAndVerse', $ params);
I hope you can help me thanks!
Hello Fernando,
Try this code, it has worked well:
"Romans"
"Chapter" => 1,
"Verse" => 1
);
$ Client = new SoapClient ("http://www.webservicex.net/BibleWebservice.asmx?wsdl", $ pair);
$ Result = $ client-> GetBibleWordsByChapterAndVerse ($ parameters);
var_dump ($ result);
?>
Regards,
Osus
I have a Web Service to consume and this requires certificate so it can be consumed, as I do to send the certificate? Thank you ..
Hello,
Do not know much where does the certificate. Please explain in more detail what the problem is, do you want to do, what requirements have ...
Good afternoon very interesting tutorial, I would like to know how we should proceed if I consume a web service that I have designed in eclipse, please any ideas you can give me is welcome
Hello Melvil,
Could you elaborate?
In principle one ws hang it on your web server and consume it without problems.
hello, good day, I wonder if anyone can help me. I want to consume a service in wb hacho. net, that returns a dataset from php. I looking information and really very little that I could find. thanks
hello, good day. I would like to know which are the extensions to be added ("as you say up there"), to others as you should set as the code that you place it does not work at least I do not. I see according to your example you need to break down the bone to consume wsdl php or php IDE does not bring the necessary options to generate the poxis or class to consume a web service.? and another question how to create a web service in php? you can create? in the examples I've seen do not find the server that hosts the wsdl.
Please send a copy to my email I appreciate it!
Att johnx
http://j2ee-vs-net.blogspot.com
jjjpropio@gmail.com
COMPARATIVE ANALYSIS AND PLATFORMS J2EE. APPLIED NET WEB DEVELOPMENT SERVICES
Good jjjpropio,
To have the SOAP functions have to compile PHP with-enable-soap. There is probably some package already compiled packages for your system. In my case there is a php-soap you install the extension.
If your server is windows will only enable the extension in the php.ini.
Sure you can create a SOAP service.
http://es.php.net/manual/es/function.soap-soapserver-construct.php
Regards,
Osus
Hello, I am currently creating WS clients in PHP 5 when consumption WS facts or using nusoap php I have no problem, but when I try to consume WS. net I can do it as long as the method I want to consume does not receive any parameters. if the method receives a parameter (s) I have the following problem then the parameter that sent him through the php client to WS never arrives or something like that, I mean, if the WS. net receives a string to greet the typed name (HOLA lunaris), then sends me HELLO result is as if some porblema in the parameter sent from PHP, so with me whole if it is a multiplication of two numbers then always returns a value of 0. The other question I have about WS and PHP clients is: Is there any kind of incompatibility when the WS generates the schema (Schema) in a wsdl url I built apart from WS in JEE 5 using netbeans 6.5, and generates separate Schema ... and when I try to consume it generates error in php ..... Well maybe you have some PHP client example that accesses a service. Net which has some parameters, if I can spend would be good and if the WS. Net internet this would be much better for problarlo
Please send a copy to my email I appreciate it!
My msn is jjjpropiox@hotmail.com , I like that you added me to your msn! talk to .. much better on the subject
Thanks
Att johnx
http://j2ee-vs-net.blogspot.com
jjjpropio@gmail.com
COMPARATIVE ANALYSIS AND PLATFORMS J2EE. APPLIED NET WEB DEVELOPMENT SERVICES
Hi, I built a web service in java and php client, I work very well, but from a time here I have a problem that the customer is not able to connect to the service, and this only happens to me a few times, but each time is more often and not to do throwing error as follows:
Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host in D: \ xampp \ htdocs \ ProyFrances \ classes \ clienteService_class.php: 136 Stack trace: # 0 [internal function]: SoapClient-> __doRequest ('__call ( 'datosEjercicio', Array) # 2 D: \ xampp \ htdocs \ ProyFrances \ classes \ clienteService_class.php (136): SoapClient-> datosEjercicio (Array) # 3 D: \ xampp \ htdocs \ ProyFrances \ encejercicio.php (13) : ClienteService-> datosEjercicio ('1 ') # 4 {main} thrown in D: \ xampp \ htdocs \ ProyFrances \ classes \ clienteService_class.php on line 136
I've checked everything and it can not be, the funny thing is that when I turn off the computer and light it sometimes runs smoothly.
I appreciate the help
Hi Leonardo,
I think the message is completely indicative of your error:
According to the message and your explanation, sometimes you lose connectivity to the server.
Osus
That such Osus, thanks for the input, I want to bother with a query, the question is more related to the response time, I mean, I have a webservice client developed in php with nusoap mounted on a server with an architecture somewhat sparse, Pentium III 256 RAM 1 Ghz processor, quite small but in its time it was a maquinota, doubt is good because in your post you mention that soap consuming bandwidth and client webservice I mention this taking about 15 seconds to consume a service from another well developed in php webservice with nusoap, the question is that probe and mount the client over another more robust server, without changing anything, and there the answer is received almost instantly, and wanted to know if you know of any parameter to be modified on the settings of apache or php that will serve to decrease the response time. Agradecere you any suggestions.
Greetings.
How about, I have determined that the problem is related to the parameter settings MaxKeepAliveRequests of apache (in my case this in apache2.conf'm using ubuntu 7.04 feisty-fawn), the parameter had been increased to allow a greater number of connections and this caused that consumption of webservices became too slow (15 sec per-use). Will lower the value and now takes 2 seconds, clearly the problem is that now accept a smaller number of connections but by the time I is more favorable to reduce the response time.
We'll see.
Hi, I have a web service client in java and php, I works relatively well, because when it returns the web service is an array of several records the result I get is an array with two records unless it actually returns java web service. You know it can be due.
Thanks
Hi, I have a web service client in java and php, I works relatively well, because when it returns the web service is an array of several records the result I get is an array with two records unless it actually returns java web service. You know it can be due.
Thanks
Hi good morning, I need help, someone can help with a webservice to query information about a sharp
l server is http://200.26.159.122/webservicessystem/webservices.asmx?WSDL And the script I'm using is the following, if I can help with something simpler would appreciate it a lot:
clienteWeb _ws = new ();
}
getMembershipValue function () {
}
checkMembership function ($ identification card) {
$ Identification card = ($ sCedula);
$ Response = $ this-> _ws-> request ('cargaDatosAfiliado', $ identification card);
foreach ($ response as $ resActual) {
if (is_array ($ resActual)) {
return true;
Else {}
return false;
}
}
}
}
?>
Select
Cedula:
$ AElemento)
echo "". $ resActual ["name"]. "";
?>
If you want you can contact me by mail, and that I can not put it here full code juantorrado@hotmail.com
Greetings, I need to connect to a web service, and I have to send as parameters a node in a xml file, try with nusoap and xmlnode NULL answered me, and I'm dealing with php5 soap like ...
example =
$ File = "abcdefgh.xml";
$ Content = simplexml_load_file ($ file);
to test:
print_r ($ content);
$ Parameters = array ("abcdefg" => $ content);
and call the function and returns me:
Failed. Reason: Null XmlNode Encountered
If I can help, I thank you, if you need more information let me know ...
THANK YOU ...
Hello Osus,
Thanks for the post, is very instructive. YOU wanted to ask ...
I have to connect with ws that returns a class.
In PHP there is no way of generating classes or something like that (proxy) to collect response method called?
Or the only option is to parse a little hand?
thank you very much in advance.
Best regards,
marten
Hi Marta,
You can make a mapping between server classes and you believe in your php.
Look on the website of manufacturer:
http://es2.php.net/manual/en/soapclient.soapclient.php
regarding ClassMap
Osus
Hello! Thank you very much for your answer.
Then I see ... are not automatically generated. I think that Java and. Net takes much advantage to PHP, at least in regard to the consumption of web services ...
I think it worth using PHP for this purpose.
Best regards,
marten
Hi I am working in c # consuming ws and wanted to know if it is equal if the same function utilisa register to look for that is what I insert data or should I use another function other than register for:
$ Server-> register ('insertarCliente'
array ('Nitt' => 'xsd: string'),
array ('return' => 'xsd: boolean'),
$ Ns);
this is my function that does my search
SearchClient function ($ Nitt)
{
$ Right = false;
$ Q = "SELECT * FROM customer WHERE nit LIKE '%". $ Nitt. "% '";
$ M = new MYSQL (_host, _login, _passdb, _dbname);
if ($ m-> query ($ q))
{
$ Good = true;
/ / $ Userid = m-> getID ();
}
return $ right;
}
insertarCliente function ($ FullName, $ nit, $ address, $ phone, $ phone, $ email, $ city)
{
$ Right = false;
$ Q = "INSERT INTO customer (fullname, nit, address, phone, cell, email, city) values
$ M = new MYSQL (_host, _login, _passdb, _dbname);
if ($ m-> query ($ q))
{
$ Good = true;
/ / $ Userid = m-> getID ();
}
return $ right;
}
lighter and insert a data in my DB without repeating.
ing student first semester system
Hello David,
I do not understand your 4 comments, after reading all that clear coat is that they have nothing to do with webservices.
Can you explain your problem in more detail?
Hello friends I'm trying to create a web services client that communicates with other transport ministry ( https://manifiesto.mintransporte.gov.co/mucregistro/RegistraManifiesto?WSDL ) and I could not even do anything in php5 and send communicates empty data, but using a class created by the datearlas wsdl2php and throws me the error: 'No deserializer found for ArrayOfmucRegistra_RemesaType2User'
Wish I could help.
Pdt: Heintentado a java desktop application but it throws the error: "[SOAPException: faultCode = SOAP-ENV: IOException; msg = Unsupported protocol 'https'; TargetException = HTTPClient.ProtocolNotSuppException: Unsupported protocol' https'] '
Thanks in advance
Hi Javier,
Can you tell test data in the method you indicate to test its performance?
$ Pusuario = (real) 96,191,554;
$ Pempresa = (real) 8600068755;
$ SClient = new soapclient ("RegistraManifiesto1.wsdl", array ('uri' => 'http://mucRegistra/registraManifiesto.wsdl'
'SOAPAction' => ",)
Thanks for your answer Osus and hopefully I can work, the you will return something like:
StdClass Object Object ([peregremesaOut] => stdClass Object ([array] => Array ([0] => stdClass Object ([remnumero] => [remnromanifiesto] => [state] =>))) [peregmanifiestoOut] => stdClass Object ([array] => Array ([0] => stdClass Object ([mannumero] => [mannumeroEmpresa] => [tarifaflete] => [state] =>))) [peregvehiculoOut] => stdClass Object ([ array] => Array ([0] => stdClass Object ([vehplaca] => [state] =>))) [peregconductorOut] => [peregterceroOut] => stdClass Object ([array] => Array ([0] => stdClass Object ([pertipid] => [Periden] => [state] =>))) [pmensajeOut] => 0)
But to fill the data does not allow sending takes the errors: 'mapping not found for ....' dezerializer or not found for ... 'thanks
sorry for such information
Hello Javierwicca,
You through an example that has worked:
$ Client = new SoapClient ("https://manifiesto.mintransporte.gov.co/mucregistro/RegistraManifiesto?wsdl", Array ());
$ Res = $ client-> wsmani ($ pusuario, $ pempresa, $ pfirma, $ pfirmado);
var_dump ($ res);
I returned:
object (stdClass) # 2 (6) {
["PeregremesaOut"] =>
NULL
["PeregmanifiestoOut"] =>
NULL
["PeregvehiculoOut"] =>
NULL
["PeregconductorOut"] =>
NULL
["PeregterceroOut"] =>
NULL
["PmensajeOut"] =>
string (2190) "The signature that the information sent is {T = TRAFFIC CONTROL, SURNAME = ACOSTA BARRERA, STREET 63 SOUTH STREET = N WHITE BUS SA, L = BOGOTA, GIVENNAME = DANILO HERNANDO, E = SISTEMAS@BUSESBLANCOS.COM.CO, CN = DANILO HERNANDO ACOSTA BARRERA, C = CO} fimado text is Error ORA-06531: Reference to uninitialized collection "
}
You may need to turn in your php.ini cURL and openssl extensions since ws is ssl url.
Hope that solved the problem
Thanks for the reply:
because until I logarado there getting the poblem is when Dateo PregRemesa2 objects (Contains an array of class mucRegistra_RemesaType2User) PregManifiesto (which contains an array mucRegistra_ManifiestoType2User class) and so on in the data pregVehiculo, pregConductor, pregTercero Use a tool known as WSDL2PHP and she generates automatically classes php but I fill them and try to send them throws the error "not found for ArrayOfmucRegistra_RemesaType2User deserialer"
Too bad you both agradesceria osus bother if you could help me this is one of the class that generates me WSDL2PHP:
mucRegistra_RegRemesa2 class {
public $ array; / / ArrayOfmucRegistra_RemesaType2User
}
mucRegistra_RemesaType2User class {
public $ nitempresa; / / decimal
public $ remnumero; / / decimal
public $ remunidaMedida; / / decimal
public $ remcantidad; / / decimal
public $ rempeso; / / decimal
public $ remunidaEmpaq; / / decimal
public $ remnaturaleza; / / decimal
public $ remcodproducto; / / string
public $ remdescrProdu; / / string
public $ remremitente; / / string
public $ remdestinatario; / / string
public $ remciudadDesti; / / decimal
public $ remnromanifiesto; / / string
public $ remtipidremitente; / / string
public $ remidenremitente; / / decimal
public $ remnroremempresa; / / string
public $ remestado; / / string
public $ remtipiddestinatario; / / string
public $ remidendestinatario; / / decimal
public $ rempoliza; / / string
public $ remaseguradora; / / decimal
public $ remvencimiento; / / string
public $ remduenopoliza; / / string
public $ remciudadOrig; / / decimal
public $ remvalremesa; / / decimal
public $ remvalproducto; / / decimal
public $ status; / / string
}
And the problem appears to be the mapping but WSDL2PHP think with the other classes:
private static $ classmap = array (
'MucRegistra_RegRemesa2' => 'mucRegistra_RegRemesa2'
'MucRegistra_RemesaType2User' => 'mucRegistra_RemesaType2User'
'MucRegistra_RegManifiesto2' => 'mucRegistra_RegManifiesto2'
'MucRegistra_ManifiestoType2User' => 'mucRegistra_ManifiestoType2User'
'MucRegistra_RegVehiculo2' => 'mucRegistra_RegVehiculo2'
'MucRegistra_VehiculoType2User' => 'mucRegistra_VehiculoType2User'
'MucRegistra_RegConductor' => 'mucRegistra_RegConductor'
'MucRegistra_ConductorTypeUser' => 'mucRegistra_ConductorTypeUser'
'MucRegistra_RegTercero' => 'mucRegistra_RegTercero', 'mucRegistra_TerceroTypeUser' => 'mucRegistra_TerceroTypeUser'
'MucRegistra_RegistraManifiestoImpl_wsmani_Out' => 'mucRegistra_RegistraManifiestoImpl_wsmani_Out'
'MucRegistra_RegEstRemesa' => 'mucRegistra_RegEstRemesa'
'MucRegistra_EstRemesaTypeUser' => 'mucRegistra_EstRemesaTypeUser'
'MucRegistra_RegEstManifiesto' => 'mucRegistra_RegEstManifiesto'
'MucRegistra_EstManifiestoTypeUser' => 'mucRegistra_EstManifiestoTypeUser'
'MucRegistra_RegEstVehiculo' => 'mucRegistra_RegEstVehiculo'
'MucRegistra_EstVehiculoTypeUser' => 'mucRegistra_EstVehiculoTypeUser'
'MucRegistra_RegEstConductor' => 'mucRegistra_RegEstConductor'
'MucRegistra_EstConductorTypeUser' => 'mucRegistra_EstConductorTypeUser'
'MucRegistra_RegEstTercero' => 'mucRegistra_RegEstTercero'
'MucRegistra_EstTerceroTypeUser' => 'mucRegistra_EstTerceroTypeUser'
);
public function registraManifiesto ($ wsdl = "https://manifiesto.mintransporte.gov.co/mucregistro/RegistraManifiesto?WSDL", $ options = array ()) {
foreach (self :: $ classmap as $ key => $ value) {
if (! isset ($ options ['classmap'] [$ key])) {
$ Options ['classmap'] [$ key] = $ value;
}
}
parent :: __construct ($ wsdl, $ options);
again I apologize for the excess of info.
Thanks Totals
Old ... I need a advice you can offer me
What is your problem Alexander?
Hello everyone, sorry someone can show that they are 'result' and 'news'?, In this line???
$ News = $ result ['result'] ['news'];
This is the result of my webservice, now what I need is to retrieve each value, eg> 0, I need to retrieve the 0.
How do I?? please help!! Thank you ...
010012094224739MATE-1Blue-603330-732 483 732 483 010 012 094 224 0100120942241057MATE
Sorry this is the result my web service ...
1Blue-603330 010 012 094 224>
@ Rachel,
I do not understand the format of your webservice response.
In the example response becomes an array and access as you indicate, but it is only in the case of my example.
In your case you should begin to do:
var_dump ($ result)
after executing the method, so you'll see the answer and you can decide how to handle such data.
I mean I know that doing var_dump see the result, but what I want is to retrieve those values I've shown, they are different fields, and I need to recover to save in a table ... if not have to retrieve the xml webservice or I can do to differentiating values and to insert them in my board ... I do?? considering that not a lot of php ...
@ Rachel,
To learn how to collect the data you need to know how you get back, or view the answer ($ result) or analyze the signature of webservice (wsdl), but you have to know how you get the data, that's why I said that mirases the var_dump.
var_dump response is as follows:
1Blue-603330-0100120942241057MATE 010012094224739MATE-732 483 732 483 010 012 094 224 ...
here are 3 registers but if the wwebservice me back more than 1000 records, for example the first one is inside a sequence tag, BLUE-603330 is a code and so every thing but the 1000 records returned to me in a single chain to do the var_dump and I have no idea how to make or retrieve the xml and treat it that way or identify each field to store the value in my table ... if you porfa messenger that would be too much hassle facilites me?? ? this is mine ditaraquel82@hotmail.com
If what you returned is, as you indicate, a single chain have to find a way to divide as you need, I can not think of anything.
A good example, thanks.
Hello friend,
I just want to communicate with the Web Service's transport announcement was made by Colombia, the URL is
https://manifiesto.mintransporte.gov.co/mucregistro/RegistraManifiesto
To communicate just do this:
$ Client = new SoapClient ('https://manifiesto.mintransporte.gov.co/mucregistro/RegistraManifiesto');
var_dump ($ client-> __getFunctions ());
But I say that you can not load the information from the url.
What I can do?
Hi Edgar,
The problem is that the url you indicate does not work, no more. The code is well.
Osus Hello, I have days trapped in com WS response process, your example has been the best I've seen on the web. But to use it to my connection I get the error Undefined offset:
the var_dump gives me this:
Object (stdClass) [2]
public 'generarCFDIPruebaResult' =>
object (stdClass) [3]
public 'string' =>
array
0 => string 'True' (length = 4)
1 => string '(length = 0)
2 => string 'Z' (length = 1)
3 => string '283 '(length = 3)
4 => string '2011-07-07T00: 49:33 '(length = 19)
5 => string 'This document is a printed representation of a CFDI' (length = 56)
6 => string '217 '(length = 3)
7 => string 'string '1 .0' (length = 3)
9 => string 'EC5D4158-7E57-7E57-7E57-48AE80DC8F63' (length = 36)
10 => string '07 / 07/2011 12:49:33 am '(length = 24)
11 => string (Length = 172)
12 => string '00001000000103082037 '(length = 20)
13 => string (Length = 172)
14 => string
and Serialize this:
document is a printed representation of a 12:49:33
To get there, a 7 brings a XML that I must keep on each request.
I hope you can guide me.
Thanks
Hi Andres,
It seems that the WS returns you an object directly so you can use,
Test example
echo $ object-> generarCFDIPruebaResult-> string [0];
Hello Osus,
Incredible!, After spinning both finally worked.
Thank you!
hello friends could help me! I need to consume a web service with symfony 1.4.8 but I followed your suggestions and it does not work.
Well if I can not get the parameters.
Here I posting my code
$ Client = new SoapClient ("http://200.110.68.244/Academico/VerificaUsuarioWebPort?WSDL", array ());
$ Res = $ client-> getVerificaUsuarioWeb ('oobando', '1234567 ');
var_dump ($ res);
Hi Diana,
In the ws you indicate only two methods are defined:
and neither is the evidence getVerificaUsuarioWeb
Osus thanks for answering, then that's problem?
but this method is also created .....
I now look APLIQ this code where no one method call
$ Client = new
var_dump ($ client-> __getFunctions ());
and shows me what sgte page:
array (2) {[0] => string (71) "obtenerResultadoResponse obtenerResultado (obtenerResultado $ parameters)" [1] => string (65) "actualizaClaveResponse actualizaClave (actualizaClave $ parameters)"}
Friend Osus .... thank you very much for your comment helped me a lot
check now well and you had much reason
the method call to q q had was obtenerResultado
posted here let q code now if it works
$ Parameters = array (
'User', 'user',
'Passw', 'key'
);
$ Client = new SoapClient ("http://200.110.68.244/Academico/VerificaUsuarioWebPort?WSDL", array ());
$ Res = $ client-> obtenerResultado ($ parameters);
var_dump ($ res);
Friend Osus .... thank you very much for your comment helped me a lot
check now well and you had much reason
the method call to q q had was obtenerResultado
posted here let q code now if it works
$ Parameters = array (
'User', 'user',
'Passw', 'key'
);
$ Client = new SoapClient ("http://200.110.68.244/Academico/VerificaUsuarioWebPort?WSDL", array ());
$ Res = $ client-> obtenerResultado ($ parameters);
var_dump ($ res);
hello Osus could help me solve the problem I have q .... I followed your instructions and when testing my webservice consumption in php i get it on the screen sgte
object (stdClass) # 47 (1) {["return"] => bool (false)}
would really appreciate it if you could cooperate with me
@ DIBU,
It seems to work right?. I returned False
q single line indicating devuelvla me .... not as I do to q returns TRUE or FALSE
another little question .... array parameters should I call q with the same name have been created in the methods of my webservice or I can call them by another name?
Hello and thanks for the data, that we would we be without people like you do not help, thanks again.
Hello,
I have the question of where does the method (that part is called) response.
For example my main method and the method GetOC brings me the answers is GetOCResult
In the example just call the main method
@ Carlos,
In the example,
$ Result = $ client-> getNoticias ($ parameters);
$ Result contains the response to the method. No method GetOCResult as such.
Make a var_dump ($ result) and see what that returns your method.
Osus Hi, after reading all the comments I see that this issue has not been closed and that you do take the trouble to answer, in advance thank you very much.
I want to consult with you the following problem,
$ Client = new SoapClient ($ service);
$ Result = $ client-> getArticle ("JTA16P1");
var_dump ($ result);
I have results in a NULL and can not be wrong, if the method returns a string.
I verify that the method exists in the WS but I understand that I need to do to properly consume the web service.
Greetings.
It is the result of the Web Service
GetFunctions __ value ()
array (1) {[0] => string (40) "void getArticle ($ strIdArticulo anyType)"}
GetArticle value ()
NULL
Regards
After hours of searching, and found my problem and just need to do the following ini_set ("soap.wsdl_cache_enabled", 0);
Greetings ...
I have a problem I have a wsdl which contains headers and within this is the credentials to consume the sw .. username and password ... my question is how seteo these values from php ..
Thanks in advance ...
Of course other methods have their own parameters .. such as login and password ... that are inside the body ..
Leave a Reply