Hi,
What should I use for proxy() and uri()?
proxy()
Is simply the address of the server to contact that provides the methods. You can use http:, mailto:, even ftp: URLs here.
uri()
Each server can offer many different services through the one proxy() URL. Each service has a unique URI-like identifier, which you specify to SOAP::Lite through the uri() method. If you get caught up in the gripping saga of the SOAP documentation, the 'namespace' corresponds to the uri() method.
SOAP::Lite wants these 2 values.. For example I am able to get the following to work:
use SOAP::Lite;
print SOAP::Lite
-> uri('http://www.soaplite.com/Temperatures')
-> proxy('http://services.soaplite.com/temper.cgi')
-> f2c(32)
-> result;
Thanks,
Chad
answers are in the WSDL
Hi Chad,
We've had success with the SOAP::Lite stubmaker.pl converter which plucks out the correct parameters for each function from the WSDL file found in your SiteCatalyst account.
Your proxy endpoint can be determined from your WSDL file or by calling CompanyGetEndpoint with this generic endpoint:
->proxy('https://api.omniture.com/admin/1.2/')
We use ns() to set namespace parameters rather than uri(). This is the code for that GetEndpoint function as generated by the wsdl converter
Company.GetEndpoint => {
endpoint => 'https://api.omniture.com/admin/1.2/',
soapaction => 'http://www.omniture.com/#Company.GetEndpoint',
namespace => 'http://www.omniture.com/',
parameters => [
SOAP::Data->new(name => 'company', type => 'xsd:string', attr => {}),
],
},
See "SOAP::Schema" and "stubmaker.pl" in the SOAP::Lite docs.
Hope that helps get you on your way!
- David
Is this what stubmaker should create
When running stubmaker on the Omniture WSDL, I get a the file:
OmnitureWebService.pm
inside the file is:
SOAP::Schema=HASH(0x844f130)
thats it! one line. is this correct?
Eg. stubmaker.pl output
No that's not working. It should be functional Perl code. The following command, run in the folder with the named wsdl file:
perl stubmaker.pl 'file:./omniture.wsdl'
should generate an OmnitureWebService.pm file around 60k with content like the following:
package OmnitureWebService;
# Generated by SOAP::Lite (v0.67) for Perl -- soaplite.com
# Copyright (C) 2000-2006 Paul Kulchenko, Byrne Reese
# -- generated at [Wed Dec 17 12:44:45 2008]
# -- generated from file:./omniture.wsdl
my %methods = (
ReportSuite.GetRollups => {
endpoint => 'https://api.omniture.com/admin/1.2/',
soapaction => 'http://www.omniture.com/#ReportSuite.GetRollups',
namespace => 'http://www.omniture.com/',
parameters => [
], # end parameters
}, # end ReportSuite.GetRollups
ReportSuite.GetPaidSearch => {
endpoint => 'https://api.omniture.com/admin/1.2/',
soapaction => 'http://www.omniture.com/#ReportSuite.GetPaidSearch',
namespace => 'http://www.omniture.com/',
parameters => [
SOAP::Data->new(name => 'rsid_list', type => 'tns:string_array', attr => {
}),
], # end parameters
}, # end ReportSuite.GetPaidSearch
.
.
.