How to consume wsdl SOAP web service from PHP or ajax Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30 pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!JQuery AJAX Consume SOAP Web ServiceHow can I prevent SQL injection in PHP?SOAP or REST for Web Services?How to manage a redirect request after a jQuery Ajax callHow to call a SOAP web service on AndroidPHP: Delete an element from an arrayHow do you parse and process HTML/XML in PHP?How to pass “Null” (a real surname!) to a SOAP web service in ActionScript 3?How does PHP 'foreach' actually work?Compare and contrast REST and SOAP web services?How do I return the response from an asynchronous call?

Why isn't everyone flabbergasted about Bran's "gift"?

Could a cockatrice have parasitic embryos?

How to begin with a paragraph in latex

How was Lagrange appointed professor of mathematics so early?

SQL Server placement of master database files vs resource database files

Is a self contained air-bullet cartridge feasible?

Bright yellow or light yellow?

Determinant of a matrix with 2 equal rows

In search of the origins of term censor, I hit a dead end stuck with the greek term, to censor, λογοκρίνω

Are there existing rules/lore for MTG planeswalkers?

What was Apollo 13's "Little Jolt" after MECO?

Why is water being consumed when my shutoff valve is closed?

Protagonist's race is hidden - should I reveal it?

RIP Packet Format

Does a Draconic Bloodline sorcerer's doubled proficiency bonus for Charisma checks against dragons apply to all dragon types or only the chosen one?

Like totally amazing interchangeable sister outfit accessory swapping or whatever

Simulate round-robin tournament draw

Test if all elements of a Foldable are the same

Why would the Overseers waste their stock of slaves on the Game?

Retract an already submitted Recommendation Letter (written for an undergrad student)

Is there an efficient way for synchronising audio events real-time with LEDs using an MCU?

Why does Java have support for time zone offsets with seconds precision?

Does Prince Arnaud cause someone holding the Princess to lose?

Are these square matrices always diagonalisable?



How to consume wsdl SOAP web service from PHP or ajax



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30 pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!JQuery AJAX Consume SOAP Web ServiceHow can I prevent SQL injection in PHP?SOAP or REST for Web Services?How to manage a redirect request after a jQuery Ajax callHow to call a SOAP web service on AndroidPHP: Delete an element from an arrayHow do you parse and process HTML/XML in PHP?How to pass “Null” (a real surname!) to a SOAP web service in ActionScript 3?How does PHP 'foreach' actually work?Compare and contrast REST and SOAP web services?How do I return the response from an asynchronous call?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








2















I'm trying to consume a SOAP web service from PHP or AJAX, it's suposed that my ws provider allowed my VPS IP, so the web service works from SoapUI, but I need to use the data on my web page (running in my VPS), so I've tryed by using this PHP:



<?php
$wsdl = "https://qws.equifax.cl/osb-efx/equifax/CommercialReportPublicService?wsdl";
$options = array(
'Usuario' => "anUser",
'Clave' => "aPassword",
'Rut' => "someData",
'Dv' => "someMoreData"
);
libxml_disable_entity_loader(false);
$client = new SoapClient($wsdl, $options);
echo '<pre>'.print_r($client,true).'</pre>';
?>


But it throws this error:



enter image description here



The thing is that I'm tring to acces to the method called "obtenerReporteFinal" and I don't know where to specify that and maybe that's the first mistake.



So I've searched for another method to consume a SOAP web service and I've found this post using ajax. Since I have a PHP+JavaScript web page on my VPS, I've tryed with this:



<!DOCTYPE html>
<html>
<head>
</head>
<body>


<input type="button" id="btnQlo" value="Call Web Service" />


<script src="http://code.jquery.com/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
jQuery.support.cors = true;
$(document).on("click","#btnQlo",function()CallService());
);


function CallService()

var webServiceURL = 'https://qws.equifax.cl/osb-efx/equifax/CommercialReportPublicService?wsdl';
var soapMessage = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:com="http://commercialreport.datos.wsecrp01.equifax.cl/">';
soapMessage+='<soapenv:Header/>';
soapMessage+='<soapenv:Body>'
soapMessage+='<com:obtenerReporteFinal>'
soapMessage+='<!--Optional:-->'
soapMessage+='<arg0>'
soapMessage+='<Usuario>anUser</Usuario>'
soapMessage+='<Clave>aPassword</Clave>'
soapMessage+='<Rut>someData</Rut>'
soapMessage+='<Dv>someMoreData</Dv>'
soapMessage+='</arg0>'
soapMessage+='</com:obtenerReporteFinal>'
soapMessage+='</soapenv:Body>'
soapMessage+='</soapenv:Envelope>';

$.ajax(
url: webServiceURL,
type: "POST",
crossDomain : true,
dataType: "xml",
data: soapMessage,
processData: false,
contentType: "text/xml; charset="utf-8"",
success: function(data)
console.log(data);

);

</script>

</body>
</html>


I don't know if I'm now calling the "obtenerReporteFinal" method right, but when I press the button to call the service, it just throws this error: enter image description here



If 'http://localhost' is blocked, how could my web service provider allows it for me?



So, how can I make this work on any of the above cases? I'm really confused since this is the first time I have to consume a SOAP Web Service.



EDIT: should I implement an SSL in my VPS?










share|improve this question
























  • It looks like the URL you are using is not valid/correct. The error says the client could not connect. Once you have the correct URL to use you connect then send a request to the client object you created ($client in your example). You mentioned obtenerReporteFinal so it would be $client->obtenerReporteFinal() with whatever parameters that function requires as an array inside the ().

    – Dave
    Mar 21 at 15:49











  • @Dave thank you for the clarification about the method. The URL works in SoapUI tool so I think it's correct.

    – Roberto Sepúlveda Bravo
    Mar 21 at 15:56











  • Define "works". I should be able to "hit" it with a browser but that fails which is why I made the comment about it not being valid.

    – Dave
    Mar 21 at 15:58











  • @Dave It returns the response If you try from SoapUI with the same URL and the data "Usuario","Clave","Rut","Dv" inside the '<com:obtenerReporteFinal>'.

    – Roberto Sepúlveda Bravo
    Mar 21 at 17:42

















2















I'm trying to consume a SOAP web service from PHP or AJAX, it's suposed that my ws provider allowed my VPS IP, so the web service works from SoapUI, but I need to use the data on my web page (running in my VPS), so I've tryed by using this PHP:



<?php
$wsdl = "https://qws.equifax.cl/osb-efx/equifax/CommercialReportPublicService?wsdl";
$options = array(
'Usuario' => "anUser",
'Clave' => "aPassword",
'Rut' => "someData",
'Dv' => "someMoreData"
);
libxml_disable_entity_loader(false);
$client = new SoapClient($wsdl, $options);
echo '<pre>'.print_r($client,true).'</pre>';
?>


But it throws this error:



enter image description here



The thing is that I'm tring to acces to the method called "obtenerReporteFinal" and I don't know where to specify that and maybe that's the first mistake.



So I've searched for another method to consume a SOAP web service and I've found this post using ajax. Since I have a PHP+JavaScript web page on my VPS, I've tryed with this:



<!DOCTYPE html>
<html>
<head>
</head>
<body>


<input type="button" id="btnQlo" value="Call Web Service" />


<script src="http://code.jquery.com/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
jQuery.support.cors = true;
$(document).on("click","#btnQlo",function()CallService());
);


function CallService()

var webServiceURL = 'https://qws.equifax.cl/osb-efx/equifax/CommercialReportPublicService?wsdl';
var soapMessage = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:com="http://commercialreport.datos.wsecrp01.equifax.cl/">';
soapMessage+='<soapenv:Header/>';
soapMessage+='<soapenv:Body>'
soapMessage+='<com:obtenerReporteFinal>'
soapMessage+='<!--Optional:-->'
soapMessage+='<arg0>'
soapMessage+='<Usuario>anUser</Usuario>'
soapMessage+='<Clave>aPassword</Clave>'
soapMessage+='<Rut>someData</Rut>'
soapMessage+='<Dv>someMoreData</Dv>'
soapMessage+='</arg0>'
soapMessage+='</com:obtenerReporteFinal>'
soapMessage+='</soapenv:Body>'
soapMessage+='</soapenv:Envelope>';

$.ajax(
url: webServiceURL,
type: "POST",
crossDomain : true,
dataType: "xml",
data: soapMessage,
processData: false,
contentType: "text/xml; charset="utf-8"",
success: function(data)
console.log(data);

);

</script>

</body>
</html>


I don't know if I'm now calling the "obtenerReporteFinal" method right, but when I press the button to call the service, it just throws this error: enter image description here



If 'http://localhost' is blocked, how could my web service provider allows it for me?



So, how can I make this work on any of the above cases? I'm really confused since this is the first time I have to consume a SOAP Web Service.



EDIT: should I implement an SSL in my VPS?










share|improve this question
























  • It looks like the URL you are using is not valid/correct. The error says the client could not connect. Once you have the correct URL to use you connect then send a request to the client object you created ($client in your example). You mentioned obtenerReporteFinal so it would be $client->obtenerReporteFinal() with whatever parameters that function requires as an array inside the ().

    – Dave
    Mar 21 at 15:49











  • @Dave thank you for the clarification about the method. The URL works in SoapUI tool so I think it's correct.

    – Roberto Sepúlveda Bravo
    Mar 21 at 15:56











  • Define "works". I should be able to "hit" it with a browser but that fails which is why I made the comment about it not being valid.

    – Dave
    Mar 21 at 15:58











  • @Dave It returns the response If you try from SoapUI with the same URL and the data "Usuario","Clave","Rut","Dv" inside the '<com:obtenerReporteFinal>'.

    – Roberto Sepúlveda Bravo
    Mar 21 at 17:42













2












2








2


1






I'm trying to consume a SOAP web service from PHP or AJAX, it's suposed that my ws provider allowed my VPS IP, so the web service works from SoapUI, but I need to use the data on my web page (running in my VPS), so I've tryed by using this PHP:



<?php
$wsdl = "https://qws.equifax.cl/osb-efx/equifax/CommercialReportPublicService?wsdl";
$options = array(
'Usuario' => "anUser",
'Clave' => "aPassword",
'Rut' => "someData",
'Dv' => "someMoreData"
);
libxml_disable_entity_loader(false);
$client = new SoapClient($wsdl, $options);
echo '<pre>'.print_r($client,true).'</pre>';
?>


But it throws this error:



enter image description here



The thing is that I'm tring to acces to the method called "obtenerReporteFinal" and I don't know where to specify that and maybe that's the first mistake.



So I've searched for another method to consume a SOAP web service and I've found this post using ajax. Since I have a PHP+JavaScript web page on my VPS, I've tryed with this:



<!DOCTYPE html>
<html>
<head>
</head>
<body>


<input type="button" id="btnQlo" value="Call Web Service" />


<script src="http://code.jquery.com/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
jQuery.support.cors = true;
$(document).on("click","#btnQlo",function()CallService());
);


function CallService()

var webServiceURL = 'https://qws.equifax.cl/osb-efx/equifax/CommercialReportPublicService?wsdl';
var soapMessage = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:com="http://commercialreport.datos.wsecrp01.equifax.cl/">';
soapMessage+='<soapenv:Header/>';
soapMessage+='<soapenv:Body>'
soapMessage+='<com:obtenerReporteFinal>'
soapMessage+='<!--Optional:-->'
soapMessage+='<arg0>'
soapMessage+='<Usuario>anUser</Usuario>'
soapMessage+='<Clave>aPassword</Clave>'
soapMessage+='<Rut>someData</Rut>'
soapMessage+='<Dv>someMoreData</Dv>'
soapMessage+='</arg0>'
soapMessage+='</com:obtenerReporteFinal>'
soapMessage+='</soapenv:Body>'
soapMessage+='</soapenv:Envelope>';

$.ajax(
url: webServiceURL,
type: "POST",
crossDomain : true,
dataType: "xml",
data: soapMessage,
processData: false,
contentType: "text/xml; charset="utf-8"",
success: function(data)
console.log(data);

);

</script>

</body>
</html>


I don't know if I'm now calling the "obtenerReporteFinal" method right, but when I press the button to call the service, it just throws this error: enter image description here



If 'http://localhost' is blocked, how could my web service provider allows it for me?



So, how can I make this work on any of the above cases? I'm really confused since this is the first time I have to consume a SOAP Web Service.



EDIT: should I implement an SSL in my VPS?










share|improve this question
















I'm trying to consume a SOAP web service from PHP or AJAX, it's suposed that my ws provider allowed my VPS IP, so the web service works from SoapUI, but I need to use the data on my web page (running in my VPS), so I've tryed by using this PHP:



<?php
$wsdl = "https://qws.equifax.cl/osb-efx/equifax/CommercialReportPublicService?wsdl";
$options = array(
'Usuario' => "anUser",
'Clave' => "aPassword",
'Rut' => "someData",
'Dv' => "someMoreData"
);
libxml_disable_entity_loader(false);
$client = new SoapClient($wsdl, $options);
echo '<pre>'.print_r($client,true).'</pre>';
?>


But it throws this error:



enter image description here



The thing is that I'm tring to acces to the method called "obtenerReporteFinal" and I don't know where to specify that and maybe that's the first mistake.



So I've searched for another method to consume a SOAP web service and I've found this post using ajax. Since I have a PHP+JavaScript web page on my VPS, I've tryed with this:



<!DOCTYPE html>
<html>
<head>
</head>
<body>


<input type="button" id="btnQlo" value="Call Web Service" />


<script src="http://code.jquery.com/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
jQuery.support.cors = true;
$(document).on("click","#btnQlo",function()CallService());
);


function CallService()

var webServiceURL = 'https://qws.equifax.cl/osb-efx/equifax/CommercialReportPublicService?wsdl';
var soapMessage = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:com="http://commercialreport.datos.wsecrp01.equifax.cl/">';
soapMessage+='<soapenv:Header/>';
soapMessage+='<soapenv:Body>'
soapMessage+='<com:obtenerReporteFinal>'
soapMessage+='<!--Optional:-->'
soapMessage+='<arg0>'
soapMessage+='<Usuario>anUser</Usuario>'
soapMessage+='<Clave>aPassword</Clave>'
soapMessage+='<Rut>someData</Rut>'
soapMessage+='<Dv>someMoreData</Dv>'
soapMessage+='</arg0>'
soapMessage+='</com:obtenerReporteFinal>'
soapMessage+='</soapenv:Body>'
soapMessage+='</soapenv:Envelope>';

$.ajax(
url: webServiceURL,
type: "POST",
crossDomain : true,
dataType: "xml",
data: soapMessage,
processData: false,
contentType: "text/xml; charset="utf-8"",
success: function(data)
console.log(data);

);

</script>

</body>
</html>


I don't know if I'm now calling the "obtenerReporteFinal" method right, but when I press the button to call the service, it just throws this error: enter image description here



If 'http://localhost' is blocked, how could my web service provider allows it for me?



So, how can I make this work on any of the above cases? I'm really confused since this is the first time I have to consume a SOAP Web Service.



EDIT: should I implement an SSL in my VPS?







php ajax web-services soap






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 22 at 14:56







Roberto Sepúlveda Bravo

















asked Mar 21 at 14:30









Roberto Sepúlveda BravoRoberto Sepúlveda Bravo

125523




125523












  • It looks like the URL you are using is not valid/correct. The error says the client could not connect. Once you have the correct URL to use you connect then send a request to the client object you created ($client in your example). You mentioned obtenerReporteFinal so it would be $client->obtenerReporteFinal() with whatever parameters that function requires as an array inside the ().

    – Dave
    Mar 21 at 15:49











  • @Dave thank you for the clarification about the method. The URL works in SoapUI tool so I think it's correct.

    – Roberto Sepúlveda Bravo
    Mar 21 at 15:56











  • Define "works". I should be able to "hit" it with a browser but that fails which is why I made the comment about it not being valid.

    – Dave
    Mar 21 at 15:58











  • @Dave It returns the response If you try from SoapUI with the same URL and the data "Usuario","Clave","Rut","Dv" inside the '<com:obtenerReporteFinal>'.

    – Roberto Sepúlveda Bravo
    Mar 21 at 17:42

















  • It looks like the URL you are using is not valid/correct. The error says the client could not connect. Once you have the correct URL to use you connect then send a request to the client object you created ($client in your example). You mentioned obtenerReporteFinal so it would be $client->obtenerReporteFinal() with whatever parameters that function requires as an array inside the ().

    – Dave
    Mar 21 at 15:49











  • @Dave thank you for the clarification about the method. The URL works in SoapUI tool so I think it's correct.

    – Roberto Sepúlveda Bravo
    Mar 21 at 15:56











  • Define "works". I should be able to "hit" it with a browser but that fails which is why I made the comment about it not being valid.

    – Dave
    Mar 21 at 15:58











  • @Dave It returns the response If you try from SoapUI with the same URL and the data "Usuario","Clave","Rut","Dv" inside the '<com:obtenerReporteFinal>'.

    – Roberto Sepúlveda Bravo
    Mar 21 at 17:42
















It looks like the URL you are using is not valid/correct. The error says the client could not connect. Once you have the correct URL to use you connect then send a request to the client object you created ($client in your example). You mentioned obtenerReporteFinal so it would be $client->obtenerReporteFinal() with whatever parameters that function requires as an array inside the ().

– Dave
Mar 21 at 15:49





It looks like the URL you are using is not valid/correct. The error says the client could not connect. Once you have the correct URL to use you connect then send a request to the client object you created ($client in your example). You mentioned obtenerReporteFinal so it would be $client->obtenerReporteFinal() with whatever parameters that function requires as an array inside the ().

– Dave
Mar 21 at 15:49













@Dave thank you for the clarification about the method. The URL works in SoapUI tool so I think it's correct.

– Roberto Sepúlveda Bravo
Mar 21 at 15:56





@Dave thank you for the clarification about the method. The URL works in SoapUI tool so I think it's correct.

– Roberto Sepúlveda Bravo
Mar 21 at 15:56













Define "works". I should be able to "hit" it with a browser but that fails which is why I made the comment about it not being valid.

– Dave
Mar 21 at 15:58





Define "works". I should be able to "hit" it with a browser but that fails which is why I made the comment about it not being valid.

– Dave
Mar 21 at 15:58













@Dave It returns the response If you try from SoapUI with the same URL and the data "Usuario","Clave","Rut","Dv" inside the '<com:obtenerReporteFinal>'.

– Roberto Sepúlveda Bravo
Mar 21 at 17:42





@Dave It returns the response If you try from SoapUI with the same URL and the data "Usuario","Clave","Rut","Dv" inside the '<com:obtenerReporteFinal>'.

– Roberto Sepúlveda Bravo
Mar 21 at 17:42












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55282782%2fhow-to-consume-wsdl-soap-web-service-from-php-or-ajax%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55282782%2fhow-to-consume-wsdl-soap-web-service-from-php-or-ajax%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현