Hey all,
I'm trying to write a script for osCommerce that goes to a company that uses an API with SOAP to receive orders. Only problem is I have no idea how to use soap. I get an error "SOAP-ENV:Server: service 'http://tempuri.org' unknown". I'm guessing that is something to do with the namespace. But what I don't know is if the default namespace in nusoap won't work, what, then, should I be replacing it with? The API techs are no help as they haven't called me back and there is NOTHING in the documentation regarding this.
In case anyone needs it:
<?php
require_once('./nusoap/nusoap.php');
$c = new soapclient('https://api-test.newvinelogistics.com:443/soap/servlet/rpcrouter');
$c->setCredentials('nvltest','Nv1T35t','basic');
$xml = array(
'customerID'=>'1095'
);
echo "<pre>";
print_r($c);
echo "</pre>";
$username = ____;
$password = ____;
$soaphost = 'api-test.newvinelogistics.com';
$rpcrouter = 'soap/servlet/rpcrouter';
$soapurl = "https://$soaphost/$rpcrouter";
$remote_method = 'getOrders';
$service_name = 'urn:OrderStatus';
$input_parameter = 'customerOrderInfo';
$es_method = 'http://xml.apache.org/xml-soap/literalxml';
$es_input = 'http://xml.apache.org/xml-soap/literalxml';
$timeout = '30';
# Set parameters
$parameters = array(
'name'=>$input_parameter,
'value' => $xml,
'type' => 'xds:string',
'encodingStyle' => $es_input
);
$parameters2 = array(
'name' => $remote_method,
'uri' => $service_name,
'encodingStyle' => $es_method
);
$stuff= $c->call($soapurl,
$parameters);
$err = $c->getError();
if ($err)
{
print_r($err);
}
echo "<pre>";
print_r($stuff);
echo "</pre>";
?>
Thanks
Edit TP: Removed your passwords... please repost the schema you get from the server, then we'd might be able to help.
(Edited by Tyberius Prime on 08-29-2007 13:48)
Edit RN: They're for a test server anyway and it's all very public. :-D
(Edited by Red Ninja on 08-29-2007 15:35)