PHP call to local .NET web service
I'm doing all of this locally for testing purposes right now. I ran the service project in visual studio and have my local version of the site setup to make the call to the web service but it won't hit it.
Here's the call:
$client = new SoapClient(null, array('location' => "https://localhost:51063/Service1.asmx", 'uri' => 'http://localhost:51063/'));
$client->newMeeting(array('id' => '10000', 'location' => 'test', 'committee' => 'test', 'desc' => 'test', 'date' => '2011-08-01', 'duration' => '180', 'agenda' => '', 'notes' => '', 'agenda' => '', 'notes' => ''));
And using that I get this error:
Uncaught SoapFault
Could not connect to host
Trace in execution order:
Dispatcher→dispatch(null, 'page') on line 98 in C:\xampp\htdocs\narca\admin\index.php
Dispatcher→executeAction('plugin', 'committees', array[1]) on line 162 in C:\xampp\htdocs\narca\frog\Framework.php
PluginController→execute('committees', array[1]) on line 247 in C:\xampp\htdocs\narca\frog\Framework.php
call_user_func_array(array[2], array[0]) on line 84 in C:\xampp\htdocs\narca\frog\app\controllers\PluginController.php
CommitteesController→addevent() on line unknown in unknown
SoapClient→newMeeting(array[8]) on line 429 in C:\xampp\htdocs\narca\frog\plugins\committees\CommitteesController.php
SoapClient→__call('newMeeting', array[1]) on line unknown in unknown
SoapClient→__doRequest('<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:...', 'https://localhost:51063/Service1.asmx', 'http://localhost:51063/#newMeeting', 1, 0) on line unknown in unknown
If I try to call it like this:
$client = new SoapClient("https://localhost:51063/Service1.asmx?WSDL");
I get a different error:
Uncaught SoapFault
SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://97.67.111.2:51063/Service1.asmx?WSDL' : failed to load external entity "http://97.67.111.2:51063/Service1.asmx?WSDL"
Trace in execution order:
Dispatcher→dispatch(null, 'page') on line 98 in /mnt/stor2-wc1-dfw1/410993/410996/lab.narca.org/web/content/admin/index.php
Dispatcher→executeAction('plugin', 'committees', array[1]) on line 162 in /mnt/stor2-wc1-dfw1/410993/410996/lab.narca.org/web/content/frog/Framework.php
PluginController→execute('committees', array[1]) on line 247 in /mnt/stor2-wc1-dfw1/410993/410996/lab.narca.org/web/content/frog/Framework.php
call_user_func_array(array[2], array[0]) on line 84 in /mnt/stor2-wc1-dfw1/410993/410996/lab.narca.org/web/content/frog/app/contr开发者_如何学运维ollers/PluginController.php
CommitteesController→addevent() on line unknown in unknown
SoapClient→SoapClient('http://97.67.111.2:51063/Service1.asmx?WSDL') on line 423 in /mnt/stor2-wc1-dfw1/410993/410996/lab.narca.org/web/content/frog/plugins/committees/CommitteesController.php
Is this setup even possible? Or is there a way I can make the live site hit my local service?
Can you fetch that URL from the server PHP is on, using curl or something similar? Is there a firewall somewhere that blocks those high-numbered-post requests? Your PHP looks fine so I don't think you are doing anything wrong there.
精彩评论