CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Advanced:


New User

Nov 8, 2006, 1:39 AM

Post #1 of 1 (778 views)
SOAP::Lite Can't Post

Hi, I am writing a application using SOAP. I am using SOAP package. I am getting an error code as a response. Can u you help me.

Here is my Code.

print "Hello, World...\n";
use SOAP;
#use SOAP::Lite +trace => 'debug';

my $token = "1f4a71c7c30234affa49bb8a97502f61";


sub ModifyCampaign()
my $referenceNumber = "123";
my $name = "test";
my $description = "this is for testing! Updation succeeded";
my $account = "482067";
my $maxCPC = "0.09";
my $budget = "1000";
my $campaign_id = "485813";
#my $token = '1f4a71c7c30234affa49bb8a97502f61';

my $campaignValues =
'reference_number' => $referenceNumber,
'name' => $name,
'description' => $description,
'account_id' => $account,
'campaign_state' => "On",
'max_cpc' => $maxCPC,
'budget' => $budget,
'campaign_id' => $campaign_id};

# Obtain a reference to the service.
my $service = SOAP::Lite->service('');

# Modify the data for the specified campaign.
my $output = $service->UpdateCampaign($token, SOAP::Data->name(campaign => $campaignValues)->type('CampaignStructs..Campaign'));

# Display the results on screen.
print "Modified an existing campaign with the following information:\n";
print "\nName: ", $output->{'name'};
print "\nDescription: ", $output->{'description'};
print "\nAccount ID: ", $output->{'account_id'};
print "\nCampaign ID: ", $output->{'campaign_id'};
print "\nReference Number: ", $output->{'reference_number'};
print "\nCampaign State: ", $output->{'campaign_state'};
print "\nMaximum CPC: ", $output->{'max_cpc'};
print "\nBudget: ", $output->{'budget'};

While running this code I am getting this error :
This is the response I am getting:

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:typens="" soap:encodingStyle="" xmlns:soap="" xmlns:wsdl="" xmlns:soapenc="" xmlns:xsi="" xmlns:xsd=""><soap:Body><typens:UpdateCampaign><token xsi:type="xsd:string">1f4a71c7c30234affa49bb8a97502f61</token><campaign xsi:nil="true" xsi:type="typens:CampaignStructs..Campaign" /></typens:UpdateCampaign></soap:Body></soap:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
Cache-Control: private
Connection: close
Date: Wed, 08 Nov 2006 08:02:00 GMT
Server: Mongrel
Content-Length: 1264
Content-Length: 1264
Content-Type: text/xml; charset=UTF-8
Client-Date: Wed, 08 Nov 2006 07:02:04 GMT
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /C=US/ST=Arizona/L=Scottsdale/O=Starfield Technologies, Inc./OU= Secure Certification Authority/
Client-SSL-Cert-Subject: / Control Validated/
Client-SSL-Cipher: AES256-SHA
Client-SSL-Warning: Peer certificate not verified
Content-Disposition: inline
Content-Transfer-Encoding: binary
Status: 200 OK

<?xml version="1.0" encoding="UTF-8" ?>
<env:Envelope xmlns:xsd=""
<env:Fault xmlns:n1=""
<faultcode xsi:type="xsd:QName">env:Server</faultcode>
<faultstring xsi:type="xsd:string">undefined method `[]&apos; for nil:NilClass</faultstring>
<faultactor xsi:type="xsd:string">ActionWebService::Protocol::Soap::SoapProtocol</faultactor>
<detail xmlns:n2=""
<cause xmlns:n3=""
<message xsi:type="xsd:string">undefined method `[]&apos; for nil:NilClass</message>
<backtrace xsi:type="n1:Array"
<excn_type_name xsi:type="xsd:string">ActionWebService..ActionWebServiceError</excn_type_name>


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives