Catalyst-Controller-SOAP
view release on metacpan or search on metacpan
616263646566676869707172737475767778798081
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
99100101102103104105106107108109110111112113114115116117118119d56ecd9 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.
181920212223242526272829303132333435363738
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
373839404142434445464748495051525354555657Wrapped 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
891011121314151617181920212223242526272829use
MRO::Compat;
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
90919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
$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
431432433434435436437438439440441442443444445446447448449450451
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
533534535536537538539540541542543544545546547548549550551552553new, 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.
sets the port name but also infer which is the style of the binding,
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
__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
585586587588589590591592593594595596597598599600601602603604605=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
12345678910111213
sub
rpc_endpoint :Path(
''
) :ActionClass(
'SOAP::DocumentLiteralWrapped'
) { };
};
1;
__END__
=head1 NAME
lib/Catalyst/Controller/SOAP/RPC.pm view on Meta::CPAN
123456789101112131415161718192021222324252627282930313233
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 )