PHP Web Host - Quality Web Hosting For All PHP Applications $35/month $250/year (Unlimited) - $25/month - 200,000 impressions - Your Ad Could be Here - Click For Details
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
xfsunolesphp
Regular
Regular


Joined: Aug 23, 2003
Posts: 77

PostPosted: Fri Jun 11, 2004 9:51 pm Reply with quote Back to top

I need help to rewrite perl to php. I need somebody to do it. it will be next modules, it use SOAP+ PHP, XML.
View user's profile Send private message
stephen2417
Worker
Worker


Joined: Jan 18, 2004
Posts: 244
Location: Bristolville, OH

PostPosted: Sun Jun 13, 2004 4:44 am Reply with quote Back to top

This might not be a bad place to start...
Only registered users can see links on this board!
Get registered or login to the forums!
Very Happy
View user's profile Send private message Visit poster's website
xfsunolesphp
Regular
Regular


Joined: Aug 23, 2003
Posts: 77

PostPosted: Mon Jun 14, 2004 11:40 am Reply with quote Back to top

Code:

#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request;
use XML::Parser;

print SendSOAPAllPosters('
<APC_Search_Query>
  <WebSiteID>177783</WebSiteID>
  <PageNumber>1</PageNumber>
  <ProductsPerPage>15</ProductsPerPage>
  <CategoryID>101</CategoryID>
  <SearchText>Matrix</SearchText>
  <SortOrder>R</SortOrder>
  <MinWidth>5</MinWidth>
  <MaxWidth>30</MaxWidth>
  <MinHeight>10</MinHeight>
  <MaxHeight>60</MaxHeight>
  <MinPrice></MinPrice>
  <MaxPrice>50</MaxPrice>
</APC_Search_Query>
');

sub SendSOAPAllPosters {
my $sendxml = shift;
my $result = '';
 my $content = <<CONTENT
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetProductInformation xmlns="http://Webservice.Allposters.com/APCF.AffiliateWebService/ProductInformationService">
<APCSearchXml>
<![CDATA[$sendxml]]>
 </APCSearchXml>
</GetProductInformation>
</soap:Body>
</soap:Envelope>
CONTENT ;

$ua = LWP::UserAgent->new();
$request = HTTP::Request->new(POST => 'http://webservice.allposters.com/ProductInformationService.asmx');
$request->header(SOAPAction => '"http://Webservice.Allposters.com/APCF.AffiliateWebService/ProductInformationService/GetProductInformation"'); $request->content($content); $request->content_type("text/xml; charset=utf-8"); $response = $ua->request($request); if ($response->is_success) {
my $responeXml = $response->content;
my $xmlp = new XML::Parser(Handlers => {
Start => \&StartGetProductInformationResponse,
End => \&EndGetProductInformationResponse,
Char => \&CharGetProductInformationResponse },
'Non-Expat-Options' => {
xmlResult => \$result}
);
eval {$xmlp->parse($responeXml)
};

if ($@) { $result = ''; } } else { print "bad\n"; } return $result; }

sub StartGetProductInformationResponse {
my $e = shift;
${$e->{'Non-Expat-Options'}{'xmlResult'}} = '';
my $tag = shift;

if ($tag eq 'GetProductInformationResult') {
$e->{'Non-Expat-Options'}{'GetProductInformationResult'} = 1; } }
sub CharGetProductInformationResponse { my $e = shift; my $val = shift; if ($e->{'Non-Expat-Options'}{'GetProductInformationResult'}) { ${$e->{'Non-Expat-Options'}{'xmlResult'}} .= $val; } }

 sub EndGetProductInformationResponse
{ my $e = shift; my $tag = shift;

if ($tag eq 'GetProductInformationResult') {
$e->{'Non-Expat-Options'}{'GetProductInformationResult'} = 0;
}
}
 1;

i need help to convert this to php
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum