Hello all,
I'm trying to use a modified version of the nuSoap examples to connect to a SOAP server. Based on exhaustive testing, I am 99% sure my code looks right, but for some reason it doesn't look like the array values are being passed.
Can someone please take a gander at the info below and help determine if this is a client (re: my) issue or the destination server?
Thank you so much in advance for any help anyone may be able to provide me!
- John
---------- callQty.php ----------
<?php
session_start();
require_once('lib/nusoap.php');
function callQty()
{
$DeveloperKey = "XXX";
$Password = "12345";
$AccountID = "XXX";
$SKU = $_GET[sku];
$client = new soapclientnusoap('https://api.channeladvisor.com/
ChannelAdvisorAPI/v1/inventoryService.asmx?WSDL', true );
// Error Check
$err = $client->getError();
if ($err)
{
echo 'Constructor error' . $err . '';
}
$headers = '<APICredentials xmlns="http://api.channeladvisor.com/
webservices/">
<DeveloperKey>'.$DeveloperKey.'</DeveloperKey>
<Password>'.$Password.'</Password>
</APICredentials> ';
$arrData = array('accountID'=>$AccountID, 'sku'=>$SKU);
$result = $client->call('GetInventoryQuantity', $arrData, false,
false, $headers);
//Print out the results
if ($client->fault)
{
echo 'Fault';
print_r($result);
echo '';
} else {
$err = $client->getError();
if ($err)
{
echo 'Error' . $err . '';
} else {
echo 'Result';
print_r($result);
echo '';
}
}
echo "<hr>";
echo '<h2>Request</h2>';
echo '<pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</
pre>';
echo '<h2>Response</h2>';
echo '<pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</
pre>';
print_r($result);
echo 'Prove Array Exists: <br />';
print_r($arrData);
}
callQty();
?>
---------- END callQty.php ----------
---------- XML OUTPUT ----------
ResultArray ( [GetInventoryQuantityResult] => Array ( [Status] =>
Failure [MessageCode] => 5 [Message] => No Sku value was specified!
[ResultData] => 0 ) )
Request
POST /ChannelAdvisorAPI/v1/inventoryService.asmx HTTP/1.0
Host: api.channeladvisor.com
User-Agent: NuSOAP/0.7.2 (1.94)
Content-Type: text/xml; charset=UTF-8
SOAPAction: "http://api.channeladvisor.com/webservices/
GetInventoryQuantity"
Content-Length: 633
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://
www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/
encoding/"><SOAP-ENV:Header><APICredentials xmlns="http://
api.channeladvisor.com/webservices/">
<DeveloperKey>XXX</DeveloperKey>
<Password>12345</Password>
</APICredentials> </SOAP-ENV:Header><SOAP-
ENV:Body><GetInventoryQuantity xmlns="http://api.channeladvisor.com/
webservices/"/></SOAP-ENV:Body></SOAP-ENV:Envelope>
Response
HTTP/1.1 200 OK
Date: Mon, 31 Mar 2008 21:27:13 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 539
Set-Cookie: BIGipServerAPI_ChannelAdvisorAPI_v1=2232751276.0.0000;
path=/
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/
XMLSchema"><soap:Body><GetInventoryQuantityResponse xmlns="http://
api.channeladvisor.com/
webservices/"><GetInventoryQuantityResult><Status>Failure</
Status><MessageCode>5</MessageCode><Message>No Sku value was specified!
</Message><ResultData>0</ResultData></GetInventoryQuantityResult></
GetInventoryQuantityResponse></soap:Body></soap:Envelope>
Array ( [GetInventoryQuantityResult] => Array ( [Status] => Failure
[MessageCode] => 5 [Message] => No Sku value was specified!
[ResultData] => 0 ) ) Prove Array Exists:
Array ( [accountID] => XXX [sku] => sp9sodgb6 )
---------- END XML OUTPUT ----------
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace_______________________________________________
Nusoap-general mailing list
Nusoap-general@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/nusoap-general
Thread at a glance:
Previous Message by Date:
click to view message preview
Investor Insight
We told you to watch DnC Multimedia Corporation Today
Huge Volume Spike and Over 20% gains on a ground breaking PR from the company reassured our beliefs in the company
Symbol:DCNM
Just released today
DnC Multimedia Announces Distribution Agreement and $445,000 Purchase Order, read more about it.
Grab this gem while its in cents it wont last there long.
Ride the gains with DCNM DnC Multimedia Corporation Today
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace_______________________________________________
Nusoap-general mailing list
Nusoap-general@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/nusoap-general
Next Message by Date:
click to view message preview
Stock Trader Alert
Gold and Silver prices have been skyrocketing
The recent fall has given you the perfect time to get in and ride gold to $2 for the past week as the undiscovered gem of Gold Production
Now is the time to get in
Symbol : GSML
The move has started and this stock is definately dollar plus bound
This is not a fly by night, Its a real copmpany with real operations in the metals that are everyone's backup plans for the econimic worries
Dont miss out, Get in GSML and make the smart safe profits
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace_______________________________________________
Nusoap-general mailing list
Nusoap-general@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/nusoap-general
Previous Message by Thread:
click to view message preview
Investor Insight
We told you to watch DnC Multimedia Corporation Today
Huge Volume Spike and Over 20% gains on a ground breaking PR from the company reassured our beliefs in the company
Symbol:DCNM
Just released today
DnC Multimedia Announces Distribution Agreement and $445,000 Purchase Order, read more about it.
Grab this gem while its in cents it wont last there long.
Ride the gains with DCNM DnC Multimedia Corporation Today
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace_______________________________________________
Nusoap-general mailing list
Nusoap-general@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/nusoap-general
Next Message by Thread:
click to view message preview
Re: Not Passing Array
On Tue, 2008-04-01 at 09:01 -0500, John Vilsack wrote:
>
> $arrData = array('accountID'=>$AccountID,
> 'sku'=>$SKU);
> $result = $client->call('GetInventoryQuantity',
> $arrData, false,
> false, $headers);
>
I didn't see in your request that the data went. If you haven't already
solved this, have you tried?:
$arrData = array('accountID'=>$AccountID,'sku'=>$SKU);
$result =
$client->call('GetInventoryQuantity',array($arrData),false,false,
$headers);
Also, is the server yours or someone else's?
Larry
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace