I have to consume a webservice , the programmer who created it gave me the endpoint and also the link of the wsdl .
How do I create the client ? Using the wsdl link or the endpoint ?
When I try to connect I have the following return
"Warning: SoapClient::SoapClient(http://mv114.agraria.coop.br:50000/XISOAPAdapter/MessageServlet?channel=:BC_SOAP_CV:CC_SOAP_CV_Sender) [function.SoapClient-SoapClient]: failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized in /srv/www/htdocs/wwwintranet/nusoap_ex/sap_xml.php on line 6 Warning: SoapClient::SoapClient() [function.SoapClient-SoapClient]: I/O warning : failed to load external entity "http://mv114.agraria.coop.br:50000/XISOAPAdapter/MessageServlet?channel=:BC_SOAP_CV:CC_SOAP_CV_Sender" in /srv/www/htdocs/wwwintranet/nusoap_ex/sap_xml.php on line 6 Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://mv114.agraria.coop.br:50000/XISOAPAdapter/MessageServlet?channel=:BC_SOAP_CV:CC_SOAP_CV_Sender' in /srv/www/htdocs/wwwintranet/nusoap_ex/sap_xml.php:6 Stack trace: #0 /srv/www/htdocs/wwwintranet/nusoap_ex/sap_xml.php(6): SoapClient->SoapClient('http://mv114.ag...') #1 {main} thrown in /srv/www/htdocs/wwwintranet/nusoap_ex/sap_xml.php on line 6"
The code:
require_once('nusoap.php');
$client = new SoapClient('http://mv114.agraria.coop.br:50000/XISOAPAdapter/MessageServlet?channel=:BC_SOAP_CV:CC_SOAP_CV_Sender');
//$client = new SoapClient('http: //mv114.agraria.coop.br:50000/dir/wsdl?p=ic/55b6a9155f353207b6e7c92f548bbb98');
$client->setHTTPProxy("http: //wmv114.agraria.coop.br",50000,"WSPO","WAgr9876");
$err = $client->getError();
if ($err){
echo "Error". $err.;
}
else
{
echo "OK!!";
}