XML-Compile-SOAP

 view release on metacpan or  search on metacpan

ChangeLog  view on Meta::CPAN

	- soaphttp: do not reuse HTTP::Request object; we need fresh
	  headers. rt.cpan.org#88019 [Bret Lambert]

	Improvements:
	- use ::Cache::addPrefixes()
	- one set of operations should not include ops with the same name:
	  tell user to be more specific when sets overlap.
	- clean error when ::WSDL11::compileCalls() would select overlapping
	  operation names
	- remove trick to first generate body and the headers.
	- example of changing ::WSDL::endPoint, with help of [Bret]
	- ::WSDL::compileCall() now also works with an operation by name,
	  not only as object.

version 2.37: Tue Jul  9 17:53:13 CEST 2013

	Fixes:
	- wsdl: compileClient now also respects declare(OPERATION)
	- wsdl: SOAP12 operations became SOAP11 ports

	Improvements:

examples/salesforce/sf-info.pl  view on Meta::CPAN

my $login = $ret->{parameters}{result};
my $sh = { sessionId => $login->{sessionId} };

## Information/debugging utilities
#$ws->printIndex; exit;
#print $ws->explain('login', PERL => 'INPUT', recurse => 1); #exit;
#print $ws->explain('logout', PERL => 'INPUT', recurse => 1); exit;
#print $ws->explain('describeSObject', PERL => 'INPUT', recurse => 1); exit;

## Compile all other calls
$ws->compileCalls(endpoint => $login->{serverUrl});

## Best to wrap each of the calls in a convenient function/method, to
## provide an abstract interface to the main program.
my ($ret2, $trace2) = $ws->call(
     'getServerTimestamp'
#    'describeGlobal'
#    'describeSObject', parameters => {sObjectType => 'Account'}
#    'describeSObject', parameters => {sObjectType => 'Machine__c'}
   , SessionHeader => $sh
   );

lib/XML/Compile/SOAP/Operation.pm  view on Meta::CPAN

sub init($)
{   my ($self, $args) = @_;
    $self->{kind} = $args->{kind} or panic;
    $self->{name} = $args->{name} or panic;
    $self->{schemas} = $args->{schemas} or panic;
    $self->_server_type($args->{server_type});

    $self->{transport} = $args->{transport};
    $self->{action}    = $args->{action};

    my $ep = $args->{endpoints} || [];
    my @ep = ref $ep eq 'ARRAY' ? @$ep : $ep;
    $self->{endpoints} = \@ep;

    # undocumented, because not for end-user
    if(my $binding = $args->{binding})  { $self->{bindname} = $binding->{name} }
    if(my $service = $args->{service})  { $self->{servname} = $service->{name} }
    if(my $port    = $args->{serv_port}){ $self->{portname} = $port->{name} }
    if(my $port_type= $args->{portType}){ $self->{porttypename} = $port_type->{name} }

    $self;
}

lib/XML/Compile/SOAP11/Operation.pm  view on Meta::CPAN


sub _fromWSDL11(@)
{   my ($class, %args) = @_;

    # Extract the SOAP11 specific information from a WSDL11 file.  There are
    # half a zillion parameters.
    my ($p_op, $b_op, $wsdl)
      = @args{ qw/port_op bind_op wsdl/ };

    $args{schemas}   = $wsdl;
    $args{endpoints} = $args{serv_port}{soap_address}{location};

    my $sop = $b_op->{soap_operation}     || {};
    $args{action}  ||= $sop->{soapAction};

    my $sb = $args{binding}{soap_binding} || {};
    $args{transport} = $sb->{transport}   || 'HTTP';
    $args{style}     = $sb->{style}       || 'document';

    $args{input_def} = $class->_msg_parts($wsdl, $args{name}, $args{style}
      , $p_op->{wsdl_input}, $b_op->{wsdl_input});

lib/XML/Compile/SOAP11/Operation.pod  view on Meta::CPAN

=over 4

=item XML::Compile::SOAP11::Operation-E<gt>B<new>(%options)

C<input_def>, C<output_def> and C<fault_def> are HASHes which contain
the input and output message header, body and fault-header definitions
in WSDL1.1 style.

 -Option     --Defined in                   --Default
  action       XML::Compile::SOAP::Operation  undef
  endpoints    XML::Compile::SOAP::Operation  []
  fault_def                                   <undef>
  input_def                                   <undef>
  kind         XML::Compile::SOAP::Operation  <required>
  name         XML::Compile::SOAP::Operation  <required>
  output_def                                  <undef>
  schemas      XML::Compile::SOAP::Operation  <required>
  server_type  XML::Compile::SOAP::Operation  undef
  style                                       'document'
  transport    XML::Compile::SOAP::Operation  'HTTP'

=over 2

=item action => STRING

=item endpoints => ADDRESS|ARRAY

=item fault_def => HASH

=item input_def => HASH

=item kind => 'one-way'|...

=item name => STRING

=item output_def => HASH

lib/XML/Compile/Transport/SOAPHTTP.pm  view on Meta::CPAN

    my $charset  = $self->charset;
    my $ua       = $self->userAgent;

    # Prepare header
    my $header   = $args->{header}   || HTTP::Headers->new;
    $self->headerAddVersions($header);

	# There is probably never a real HTTP server on the other side, but
    # HTTP/1.1 requires this.
	$header->header(Host => $1)
        if +($args->{endpoint} // '') =~ m!^\w+\://([^/:]+)!;

    my $content_type;
    if($version eq 'SOAP11')
    {   $mime  ||= 'text/xml';
        $content_type = qq{$mime; charset=$charset};
    }
    elsif($version eq 'SOAP12')
    {   $mime  ||= 'application/soap+xml';
        my $sa   = defined $action ? qq{; action="$action"} : '';
        $content_type = qq{$mime; charset=$charset$sa};

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.280 second using v1.00-cache-2.02-grep-82fe00e-cpan-1925d2aa809 )