→ +trace => [qw(debug)]
→ Download soapdebug.pl
#!/usr/bin/perl -w
use strict;
# -- Nested attributes
use SOAP::Lite
#proxy => ['mailto:reto@example.com',
# smtp => 'localhost',
# From => 'reto@tertius.example.com',
# Subject => 'SOAP message -> ns(urn:foo, urn), prefix=urn'] ,
+trace => [qw(debug)]
# +trace => [qw(transport result parameters debug dispatch trace)]
;
##### GLOBAL
my $NS_PREF = 'urn';
&main();
##############################################
sub main() {
##############################################
my $client = SOAP::Lite
->readable(1)
->uri('urn:catalogue.eshop.ws.crm.example.net')
->proxy('http://localhost:8081/cgi-bin/dummy.cgi', timeout => 1 )
;
# Add namespace
$client->ns('urn:catalogue.eshop.ws.crm.example.net', 'urn');
my $temp_elements;
my @params = ();
# my $method = SOAP::Data->name('AddItemRequest')->attr({
# xmlns => 'urn:catalogue.eshop.ws.crm.example.net'});
$temp_elements = SOAP::Data
->name("$NS_PREF:targetStaging" => 'STAGING')
->type("");
push(@params, $temp_elements);
$temp_elements = SOAP::Data
->name("$NS_PREF:Item" =>
\SOAP::Data->value(
SOAP::Data->name("$NS_PREF:type" => 'ADSL_CF_HARDWARE'),
SOAP::Data->name("$NS_PREF:external_id" => 4711),
SOAP::Data->name("$NS_PREF:category" =>
\SOAP::Data->name("$NS_PREF:name" => 'ADSL_CF'),
),
&createAttribute('ORDERBY', 1),
&createAttribute('LINE_TYPE', 'analog'),
)
)
;
push(@params, $temp_elements);
# my $response = $client->call($method => @params);
my $response = $client->AddItemRequest(@params);
}
#######################################
sub createAttribute($$) {
#######################################
my $key = $_[0] || '';
my $val = $_[1] || '';
my $nspref = $NS_PREF ? "$NS_PREF:attribute" : 'attribute';
SOAP::Data->name($nspref =>
\SOAP::Data->value(
SOAP::Data->name("$NS_PREF:key" => $key),
SOAP::Data->name("$NS_PREF:value" => $val)
)
)
}
__END__
|
|
|