Hi,

Man, these guys need to beef up their documents :(

I've managed to get their webservice working for grabbing categories, but now I'm trying to get the content for a specific poster (so I can make a "detailed page"), but it never seems to work :/

I'm a bit of a newbie when it comes to SOAP - so I'm posting here, in case I've missed anything stupid :/

The code I have it:

sub SendSOAPDetailedPoster { my $sendxml = qq| <APC_Search_Query> <WebSiteID>$ALLPOSTERSID</WebSiteID> <SearchTerm>5024381</SearchTerm> <LanguageID>3</LanguageID> </APC_Search_Query> |; my $query = <<CONTENT <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" x +mlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schema +s.xmlsoap.org/soap/envelope/"> <soap:Body> <GetProductByProductNumberInformation xmlns="http://Webservice.Allposters.com/APCF.AffiliateWebService/Produ +ctInformationService"> <APCSearchXml> <![CDATA[$sendxml]]> </APCSearchXml> </GetProductInformation> </soap:Body> </soap:Envelope> CONTENT ; print "QUERY: $query"; my $ua = LWP::UserAgent->new(); my $request = HTTP::Request->new(POST => 'http://webservice.allpos +ters.com/ProductInformationService.asmx'); # "http://Webservice.Allposters.com +/APCF.AffiliateWebService/ProductInformationService/GetProductByProdu +ctNumberInformation" $request->header(SOAPAction => '"http://Webservice.Allposters.com/ +APCF.AffiliateWebService/ProductInformationService/GetProductByProduc +tNumberInformation"'); $request->content($query); $request->content_type("text/xml; charset=utf-8"); my $response = $ua->request($request); if ($response->is_success) { my $content = $response->content; $content =~ s/&lt;/</sig; $content =~ s/&gt;/>/sig; my $refs = XMLin($content); my $results = $refs->{"soap:Body"}->{GetProductInformationResp +onse}->{GetProductInformationResult}->{APC_Search_Results}->{Search_R +esult}; #print Dumper($refs->{"soap:Body"}->{GetProductInformationResponse}->{ +GetProductInformationResult}->{APC_Search_Results}); my $products = $results->{Products}->{ProductInformation}; my $per_page = $results->{No_Of_Products_In_Current_Page}; my $num_results = $results->{Total_No_Of_Products}; my $current_page = $results->{Current_PageNumber}; my $num_pages; if ($num_results > 0) { $num_pages = ceil($num_results / $per_page); } else { $num_pages = 0; } $num_results = DatafeedSQL::commify($num_results); use Data::Dumper; print Dumper($products); return ($per_page,$num_results,$current_page,$num_pages,$produ +cts); } else { print "ERROR: " . $response->status_line; } }


Their documents are here:
http://webservice.allposters.com

The bit I'm trying to get working is "Product By Product Number"

Can anyone see my mess up, or point me in the right direction?



I've emailed AllPosters about it, but am not holding up much hope for a reply (took a week for them to reply to my last email :/)

TIA

Andy

In reply to Anyone got the AllPosters SOAP webservice working? by ultranerds

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.