Catalyst-Controller-SOAP

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
  d56ecd9 drew <drew@4ad37cd2-5fec-0310-835f-b3785c72a374> Get XML string before parsing so we can see invalid xml
  a7f8827 drew <drew@4ad37cd2-5fec-0310-835f-b3785c72a374> Added logging of incoming and outgoing XML messages.
  741103b ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] Now generates SOAP1.1 fault messages. It was generating SOAP1.2 even in the SOAP1.1 namespace.
  dc7ce6f ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] forces "elements_qualified" on the schema writer.
  a854165 drew <drew@4ad37cd2-5fec-0310-835f-b3785c72a374> Added documentation about using Catalyst::Test and WSDL files.
  f85886c drew <drew@4ad37cd2-5fec-0310-835f-b3785c72a374> Fixed bracing style
  4d99cad drew <drew@4ad37cd2-5fec-0310-835f-b3785c72a374> - Fixed example for xml_compile options - Added debug information
  e60cf77 ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] The test failures are from a bad make dist... Will upload again, with a sane make dist now. Increasing version to 0.8
  528ac0f ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] Updating MANIFEST
  2073b9c ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] Refactoring the documentation to give preference to the WSDL usage...
  243513e ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] FINALLY!!! Automatic RPC endpoint working...
  7d8b2f5 ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] config usage cleanup.
  4f1f017 ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] config usage cleanup.
  4fcdc1c ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] Support for the WSDLPort attribute... Still some things to clear...
  91eb3ee ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] Setting VERSION to 0.6
releases/0.8 -- Fri, 4 Apr 2008 11:15:37 +0000
releases/0.7 -- Fri, 4 Apr 2008 11:15:37 +0000
releases/0.6 -- Fri, 4 Apr 2008 11:15:37 +0000
  2fdc200 drew <drew@4ad37cd2-5fec-0310-835f-b3785c72a374> Fix misspelling in method call when adding additional wsdl files
  101ca53 drew <drew@4ad37cd2-5fec-0310-835f-b3785c72a374> Added support for passing options to $wsdl->schemas->compile().
  a336967 ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] Saving some changelog

Changes  view on Meta::CPAN

99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
d56ecd9 drew <drew@4ad37cd2-5fec-0310-835f-b3785c72a374> Get XML string before parsing so we can see invalid xml
a7f8827 drew <drew@4ad37cd2-5fec-0310-835f-b3785c72a374> Added logging of incoming and outgoing XML messages.
741103b ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] Now generates SOAP1.1 fault messages. It was generating SOAP1.2 even in the SOAP1.1 namespace.
dc7ce6f ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] forces "elements_qualified" on the schema writer.
a854165 drew <drew@4ad37cd2-5fec-0310-835f-b3785c72a374> Added documentation about using Catalyst::Test and WSDL files.
f85886c drew <drew@4ad37cd2-5fec-0310-835f-b3785c72a374> Fixed bracing style
4d99cad drew <drew@4ad37cd2-5fec-0310-835f-b3785c72a374> - Fixed example for xml_compile options - Added debug information
e60cf77 ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] The test failures are from a bad make dist... Will upload again, with a sane make dist now. Increasing version to 0.8
528ac0f ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] Updating MANIFEST
2073b9c ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] Refactoring the documentation to give preference to the WSDL usage...
243513e ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] FINALLY!!! Automatic RPC endpoint working...
7d8b2f5 ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] config usage cleanup.
4f1f017 ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] config usage cleanup.
4fcdc1c ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] Support for the WSDLPort attribute... Still some things to clear...
91eb3ee ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] Setting VERSION to 0.6
2fdc200 drew <drew@4ad37cd2-5fec-0310-835f-b3785c72a374> Fix misspelling in method call when adding additional wsdl files
101ca53 drew <drew@4ad37cd2-5fec-0310-835f-b3785c72a374> Added support for passing options to $wsdl->schemas->compile().
a336967 ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] Saving some changelog
c6bffbf ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] Tests for Document/Literal-Wrapped working. Supports several wsdls and schemas in the config.
b74be6b ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] Document/Literal-Wrapped support (with a big ONLY FOR COMPATIBILTY REASONS disclaimer)... Test is still failing as the SOAPAction header seems to be lost in the test...
bbd7bf0 ruoso <ruoso@4ad37cd2-5fec-0310-835f-b3785c72a374> [C-C-SOAP] Better support for RPC messages, tests including an example of a RPC-Literal service, exception catching generating a SOAP Fault.

README  view on Meta::CPAN

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
            my ( $self, $c, $xml) = @_;
            my $name = $xml->findValue('some xpath expression');
        }
 
        # avaiable as "/example/world" in document context. The entire body
        # is delivered to the method as a XML::LibXML object.
        sub world : SOAP('DocumentLiteral') {
            my ($self, $c, $doc) = @_;
        }
 
        # this is the endpoint from where the RPC operations will be
        # dispatched. This code won't be executed at all.
        sub index : SOAP('RPCEndpoint') {}
 
ABSTACT
    Implements SOAP serving support in Catalyst.
 
DESCRIPTION
    SOAP Controller for Catalyst which we tried to make compatible with the
    way Catalyst works with URLS.It is important to notice that this
    controller declares by default an index operation which will dispatch

lib/Catalyst/Action/SOAP/DocumentLiteralWrapped.pm  view on Meta::CPAN

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Wrapped SOAP ActionClass
 
=head1 SYNOPSIS
 
 # in the controller
 
 __PACKAGE__->{config}{soap_action_prefix} = 'http://foo/bar/';
 
 use base 'Catalyst::Controller::SOAP::DocumentLiteralWrapped';
 # or
 sub endpoint : Local ActionClass(SOAP::DocumentLiteralWrapped) { }
 
=head1 DESCRIPTION
 
Microsoft has defined a pseudo-standard for SOAP usage called
Document/Literal Wrapped. This standard is a deviation of both the
Document/Literal and of the RPC/Literal usages.
 
A Document/Literal service is supposed to have one operation per bind,
as it's not techically possible to dispatch on the content of the
Body. In fact, as the Body is used as "literal" the dispatching should

lib/Catalyst/Controller/SOAP.pm  view on Meta::CPAN

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use mro 'c3';
use Encode;
 
 
our $VERSION = '1.25';
 
__PACKAGE__->mk_accessors (qw(wsdl wsdlobj decoders encoders ports
     wsdlservice xml_compile soap_action_prefix rpc_endpoint_paths
     doclitwrapped_endpoint_paths));
 
sub __init_wsdlobj {
    my ($self, $c) = @_;
 
    my $wsdlfile = $self->wsdl;
 
    if ($wsdlfile) {
        if (!$self->wsdlobj) {
            my $schema;
            if (ref $wsdlfile eq 'HASH') {

lib/Catalyst/Controller/SOAP.pm  view on Meta::CPAN

90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
    $c->log->debug("WSDLPort: [$name] [$value] [$path] [$style] [$use]")
      if $c->debug;
 
    if ($style eq 'Document' && !$wrapped) {
        return
          (
           Path => $path,
           $self->_parse_SOAP_attr($c, $name, $style.$use)
          );
    } elsif ($style eq 'Document' && $wrapped) {
        $self->doclitwrapped_endpoint_paths([]) unless $self->doclitwrapped_endpoint_paths;
        $path =~ s/\/$//;
        push @{$self->doclitwrapped_endpoint_paths}, $path
          unless grep { $_ eq $path }
            @{$self->doclitwrapped_endpoint_paths};
        return
          (
           $self->_parse_SOAP_attr($c, $name, $style.$use)
          );
    } else {
        $self->rpc_endpoint_paths([]) unless $self->rpc_endpoint_paths;
        $path =~ s/\/$//;
        push @{$self->rpc_endpoint_paths}, $path
          unless grep { $_ eq $path }
            @{$self->rpc_endpoint_paths};
        return
          (
           $self->_parse_SOAP_attr($c, $name, $style.$use),
          );
    }
}
 
sub _parse_WSDLPortWrapped_attr {
    my ($self, $c, $name, $value) = @_;
    my %attrs = $self->_parse_WSDLPort_attr($c, $name, $value, 'wrapped');
    delete $attrs{Path};
    return %attrs;
}
 
# Let's create the rpc_endpoint action.
sub register_actions {
    my $self = shift;
    my ($c) = @_;
    $self->SUPER::register_actions(@_);
 
    if ($self->rpc_endpoint_paths) {
        my $namespace = $self->action_namespace($c);
        my $action = $self->create_action
          (
           name => '___base_rpc_endpoint',
           code => sub {  },
           reverse => ($namespace ? $namespace.'/' : '') . '___base_rpc_endpoint',
           namespace => $namespace,
           class => (ref $self || $self),
           attributes => { ActionClass => [ 'Catalyst::Action::SOAP::RPCEndpoint' ],
                           Path => $self->rpc_endpoint_paths }
          );
        $c->dispatcher->register($c, $action);
    }
 
    if ($self->doclitwrapped_endpoint_paths) {
        my $namespace = $self->action_namespace($c);
        my $action = $self->create_action
          (
           name => '___base_doclitwrapped_endpoint',
           code => sub {  },
           reverse => ($namespace ? $namespace.'/' : '') . '___base_doclitwrapped_endpoint',
           namespace => $namespace,
           class => (ref $self || $self),
           attributes => { ActionClass => [ 'Catalyst::Action::SOAP::DocumentLiteralWrapped' ],
                           Path => $self->doclitwrapped_endpoint_paths }
          );
        $c->dispatcher->register($c, $action);
    }
 
}
 
sub _parse_SOAP_attr {
    my ($self, $c, $name, $value) = @_;
 
    my $wsdlfile     = $self->wsdl;

lib/Catalyst/Controller/SOAP.pm  view on Meta::CPAN

431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
        my ($self, $c, $xml) = @_;
    }
 
    # avaiable as "/example/get" in HTTP get context.
    # the get attributes will be available as any other
    # get operation in Catalyst.
    sub get :Local SOAP('HTTPGet')  {
        my ($self, $c) = @_;
    }
 
    # this is the endpoint from where the RPC operations will be
    # dispatched. This code won't be executed at all.
    # See Catalyst::Controller::SOAP::RPC.
    sub index :Local SOAP('RPCEndpoint') {}
 
 
=head1 ABSTACT
 
Implements SOAP serving support in Catalyst.
 
=head1 DESCRIPTION

lib/Catalyst/Controller/SOAP.pm  view on Meta::CPAN

533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
new, and the others will be the argument to subsequent addWsdl calls.
If $wsdl is a hashref, the "wsdl" key will be handled like above and
the "schema" key will be used to importDefinitions. If the content of
the schema key is an arrayref, it will result in several calls to
importDefinition.
 
When using WSDL, you can use the WSDLPort attribute, that not only
sets the port name but also infer which is the style of the binding,
the use of the input body and also declares the Path for the operation
according to the 'location' attribute in the WSDL file. For RPC
operations, the endpoint action will be created dinamically also in
the path defined by the WSDL file.
 
This is the most convenient way of defining a SOAP service, which, in
the end, will require you to have it as simple as:
 
  use base 'https://metacpan.org/pod/Catalyst::Controller::SOAP">Catalyst::Controller::SOAP';
  __PACKAGE__->config->{wsdl} = 't/hello4.wsdl';
   
  # in this case, the input has two parts, named 'who' and 'greeting'

lib/Catalyst/Controller/SOAP.pm  view on Meta::CPAN

585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
=head1 Support for Document/Literal-Wrapped
 
Please make sure you read the documentation at
L<Catalyst::Action::SOAP::DocumentLiteralWrapped> before using this
feature.
 
The support for Document/Literal-Wrapped works by faking RPC style
even when the WSDL says the service is in the "Document" mode. The
parameter used for the actual dispatch is the soapAction attribute.
 
In practice, the endpoint of the action is an empty action that will
redirect the request to the actual action based on the name of the
soapAction. It uses the soap_action_prefix controller configuration
variable to extract the name of the action.
 
There is an important restriction in that fact. The name of the
operation in the WSDL must match the suffix of the soapAction
attribute.
 
If you have a Document/Literal-Wrapped WSDL and rewriting it as
RPC/Literal is not an option, take the following steps:

lib/Catalyst/Controller/SOAP/DocumentLiteralWrapped.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
  use strict;
  use base 'https://metacpan.org/pod/Catalyst::Controller::SOAP">Catalyst::Controller::SOAP';
  sub rpc_endpoint :Path('') :ActionClass('SOAP::DocumentLiteralWrapped') { };
 
 
};
 
1;
 
__END__
 
=head1 NAME

lib/Catalyst/Controller/SOAP/RPC.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
  use strict;
  use base 'https://metacpan.org/pod/Catalyst::Controller::SOAP">Catalyst::Controller::SOAP';
  sub rpc_endpoint :Path('') :ActionClass('SOAP::RPCEndpoint') {};
};
 
1;
 
__END__
 
=head1 NAME
 
Catalyst::Controller::SOAP::RPC - Helper controller for SOAP
 
=head1 SYNOPSIS
 
 use base 'Catalyst::Controller::SOAP::RPC';
 
=head1 DESCRIPTION
 
This is a direct subclass of Catalyst::Controller::SOAP that
predefines a rpc_endpoint method which is dispatched in the URI of the
controller as the RPC endpoint. It's simply inteded to save you the
job of defining that in each SOAP RPC controller you implement,
considering that is the standard behaviour.
 
=head1 TODO
 
Well, here? nothing, all the work is done in the superclass.
 
=head1 AUTHOR
 
Daniel Ruoso <daniel@ruoso.com>



( run in 0.982 second using v1.01-cache-2.11-cpan-49f99fa48dc )