SunQuest
 
           Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old March 17th, 2003, 06:21 PM
benos benos is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 233 benos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Article Dicussion: Hunting the Web Services at Amazon

If you have any questions or comments on this article then please post them here.

This forum post relates to this article

Reply With Quote
  #2  
Old April 5th, 2003, 05:11 PM
aroc725 aroc725 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 6 aroc725 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy can't get the script to work

I can't get the script to work, although I did add code for a Submit button to the search form, and set the form 'action' attribute value to the name of the script. (When I viewed the HTML source for the original version of the script, the 'action' attribute value was just the empty string.)

Reply With Quote
  #3  
Old April 6th, 2003, 11:54 AM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Are you receiving any error messages?! Have you made any other modifications to the code?
__________________
____________________________________________
Developer Shed Weekly Writer | DevArticles Forum Moderator
Build Your Own KlipFolio Klip With PHP
FrankManno.com - Under Construction
Design Interactive Group - Under Construction

Reply With Quote
  #4  
Old April 6th, 2003, 12:55 PM
aroc725 aroc725 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 6 aroc725 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
1) No (I just get the search form page again)
2) No

Reply With Quote
  #5  
Old April 6th, 2003, 01:30 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Can you post the code you're using... It might give others a chance to help out...

Reply With Quote
  #6  
Old April 6th, 2003, 01:43 PM
aroc725 aroc725 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 6 aroc725 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Here's the code:

PHP Code:
<html>
<
head>
<
basefont face="Verdana" size="2">
</
head>
<
body bgcolor="#F0F0F0">
<
table width="100%" cellspacing="1" cellpadding="5">
<
tr>
 <
td bgcolor="Navy"><font color="white" size="-1"><b>Hunting at Amazon</b></font></td>
</
tr>
</
table>
<?
if (!
$_POST['query'])
{
?>
Select a category: 
<form method="post" action="wsDemo.php">
<select name="type" size="5">
 <option value="author">Author</option>
    <option value="artist">Artist</option>
    <option value="actor">Actor</option>
    <option selected value="director">Director</option>
    <option value="manufacturer">Manufacturer</option>
</select>
<BR><BR> Enter a search term:<BR><input type="text" name="query">
<BR><BR><input type="Submit">
</form>
<?
}
else
{
$ServiceType $_POST['type'];
// include class
include("nusoap.php");
// create a instance of the SOAP client object
$soapclient = new soapclient(" [url]http://soap.amazon.com/schemas2/AmazonWebServices.wsdl[/url] "true);
// Create a proxy so that WSDL methods can be accessed directly. We can now invoke the remote method as method of the proxy class, and pass our parameters directly. The proxy objects will handle the details such as matching up parameters values to their names, assigning namespaces and types.
$proxy $soapclient->getProxy();

// at this point you can use the following commented lines of code as check for error.
if ($err $proxy->getError()) {
print 
"ERROR: $err";
}

// set up an array containing input parameters to be
// passed to the remote procedure
// use a switch loop to define the search parameters for each type
switch ($ServiceType)
{
 case 
"author":
  
$mode "books";
  
$MyFunc "AuthorSearchRequest";
  break;
 case 
"artist":
  
$mode "music";
  
$MyFunc "ArtistSearchRequest";
  break;
 case 
"actor":
  
$mode "vhs";
  
$MyFunc "ActorSearchRequest";
  break;
 case 
"director":
  
$mode "vhs";
  
$MyFunc "DirectorSearchRequest";
  break;
 case 
"manufacturer":
  
$mode "electronics";
  
$MyFunc "ManufacturerSearchRequest";
  break;
}
//htmlentities - Convert all applicable characters to HTML entities 
$params = array(
        
$ServiceType         => htmlentities($_POST['query']),    
      
'page'        => 1,
      
'mode'        => $mode,
      
'tag'         => 'Webservice-20',
      
'type'        => 'lite',
      
'devtag'      => 'D8ZC6J75CUFJC' // the token I got from Amazon
);
// invoke the method 
$MyResult $proxy->$MyFunc($params);

/* if you are interested to see the contents of SOAP envelop  that has exchanged, uncomment the following two lines of codes.*/
echo '<xmp>'.$proxy->request.'</xmp>';
echo 
'<xmp>'.$proxy->response.'</xmp>';

// uncomment following lines to view the result
print_r($MyResult);
$MyTotal $MyResult['TotalResults'];
$MyItems $MyResult['Details'];

// format and display the results
?>
Search for <b><? echo $_POST['query']; ?></b> returned <? echo $MyTotal?> matches from Amazon.
<p>
<table width="100%" border="0" cellspacing="5" cellpadding="2">
<?

// parse the $MyItems[] array and extract the necessary information to display 
foreach ($MyItems as $i)
{
?>
<tr>
<td align="center" valign="top" rowspan="3"><a href="<? echo $i['Url']; ?>"><img border="1" src=<? echo $i['ImageUrlSmall']; ?>></a></td>
<td><font size="-1"><b><? echo $i['ProductName']; ?></b> / 
<? 
if (is_array($i['Authors'])) 

 
//Join array elements with a string
 
echo implode(", "$i['Authors']); 

else if (
is_array($i['Artists'])) //Finds whether a variable is an array

 echo 
implode(", "$i['Artists']); 

else if (
$i['Manufacturer']) 

 echo 
$i['Manufacturer']; 
}
?>
</font></td>
</tr>
<tr>
<td align="left" valign="top"><font size="-1">List Price: <? echo $i['ListPrice']; ?> / Our Price: <? echo $i['OurPrice']; ?></font></td>
</tr>
<tr>
<td align="left" valign="top"><font size="-1"><a href="<? echo $i['Url']; ?>">Read more at Amazon</a></font></td>
</tr>
<tr>
<td colspan=2> </td>
</tr>
<?
}
?>
</table>
<?
}
?>
</body>
</html> 

Reply With Quote
  #7  
Old April 13th, 2003, 02:13 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
This is just a wild stab in the dark... I can't see anything in the code that would be causing this behaviour...

But just for the sake of trying, try this:

PHP Code:
<?

if ($_POST['query'] == '')

{

?>


I don't think that would make a difference, but it's worth a try...

Reply With Quote
  #8  
Old April 13th, 2003, 02:36 PM
aroc725 aroc725 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 6 aroc725 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy

Unfortunately, that didn't work either. I guess I should try contacting the author directly.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > Article Dicussion: Hunting the Web Services at Amazon


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway