Commit Graph

46 Commits

Author SHA1 Message Date
Leon Breedt
8694a79bb2 default to using UTF-8 as response encoding for SOAP if none is
supplied, but if an encoding is supplied by caller, use that for the
response instead (NAKAMURA Hiroshi)


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1245 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-28 17:55:34 +00:00
Leon Breedt
896fea505b add charset=utf-8 to SOAP response content type, and make base_uri
respect relative_url_root for the endpoint of SOAP messages (Shugo
Maeda). if WSDL was retrieved over HTTPS, use HTTPS in the endpoint
URLs as well.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1244 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-28 01:19:52 +00:00
Leon Breedt
3cf461323c Fix regression where nil values were incorrectly being cast into the
default values for their base types.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1234 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-19 19:00:06 +00:00
Leon Breedt
c11cc309fa add backwards compatibility for the public API change made to #api_methods, as it is
being used in some apps.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1197 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-17 17:20:44 +00:00
Leon Breedt
5feb7e26e8 Send a stripped down message in the text following 500, and leave the detailed
response for the body, or we may generate invalid HTTP responses that causes 404's.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1172 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-16 21:59:55 +00:00
Leon Breedt
7f32666924 Remove a cause of casting failure for XML-RPC by ignoring structure members not
defined in the target type, and perform more sanity checks to make more obvious
what the resolution should be when neglecting to provide a valid signature or
failing to attach an API to a service implementation class.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1171 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-16 19:29:42 +00:00
Leon Breedt
6427133584 support SOAP invocation of layered services in scaffolding too, fix bug when
method takes no parameters


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1098 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-05 22:29:01 +00:00
Leon Breedt
1155ea0aa3 initial go at making :layered dispatching generate WSDL for SOAP, and have
:layered process SOAP method calls correctly as well, may be unstable


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1097 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-05 21:37:48 +00:00
Leon Breedt
97e39fcb64 make XMLRPC::FaultException have a #message, otherwise the thrown exception
is useless in functional test backtraces


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1093 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-05 16:25:47 +00:00
Leon Breedt
9b42cd8cc1 add API::Method#expects_to_hash convenience as well
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1092 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-05 16:00:28 +00:00
Leon Breedt
7a5bac1de0 add API::Method#expects_index_of helper to get the index of
a named parameter


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1091 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-05 15:41:04 +00:00
Leon Breedt
361dcad8fd be explicit about the object to do #instance_eval in for delegated dispatching,
clean up iterations to use #zip (bitsweat), 


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1090 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-05 05:39:45 +00:00
Leon Breedt
d7a7d85dbd * Fix casting of nested members in structured types if we have a signature
type available for it even if they are already of the desired type as
   SOAP/XML-RPC unmarshaling may have gotten it wrong: SOAP likes to always
   use DateTime no matter what, for example, whereas we allow a distinction
   between Date, DateTime and Time in the signature for convenience casting
 * Fix raising of exceptions by test_invoke so functional tests fail properly on exception
   instead of returning the exception object
 * Fix Struct#each_pair to yield the value and not the member type


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1089 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-04 22:58:02 +00:00
Leon Breedt
2cfe309dc4 don't use SyncEnumerator, its far too slow to be used in something frequently called
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1085 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-03 23:12:34 +00:00
Leon Breedt
17e5035bc5 use #rescue_action in WS scaffolding so that exceptions in API methods give a standard Rails
error page on failure


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1076 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-03 05:23:30 +00:00
Leon Breedt
fcfe3febd3 allow selecting the protocol to use when invoking the
scaffolded method. fix bug in walking delegated container
services.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1074 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-03 00:12:11 +00:00
Leon Breedt
353497458b filter out embedded nil values for XML-RPC
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1073 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-02 22:05:16 +00:00
Leon Breedt
aaea48fe98 * collapse 'ws' back into protocols, it just added complexity and indirection, and was hard to extend.
* extract casting into seperate support file
* ensure casting always does the right thing for return values, should fix interoperability issues with Ecto and possibly other XML-RPC clients
* add functional unit tests for scaffolding
* represent signature items with classes instead of symbols/Class objects, much more flexible
* tweak logging to always show casted versions of parameters and return values, if possible.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1072 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-02 21:03:36 +00:00
David Heinemeier Hansson
7c8d2f28e1 Removed broken attempt to DRY module ClassMethod #970
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1069 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-02 09:29:43 +00:00
David Heinemeier Hansson
c788bcb416 Automatically extend the class which gets a module included with the ClassMethods module if it exists #970 [Lucas Carlson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1068 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-02 09:14:19 +00:00
Leon Breedt
0de97c81db display the amount of time taken to invoke a scaffolding request
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1044 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-31 10:47:01 +00:00
Leon Breedt
0f198eb58e remove ActiveRecordSoapMarshallable, can't reproduce the problem it was intended to fix.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1043 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-31 09:12:10 +00:00
Leon Breedt
b94bd32f31 first pass of web service scaffolding. add ability to quickly generate an
action pack request for a protocol, add missing log_error when we fail to parse
protocol messages. add RDoc for scaffolding and functional testing.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1037 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-29 12:31:39 +00:00
Leon Breedt
37270359ac remove wrongheaded uses of "rescue nil" if it will mask a useful exception. also include
the whole backtrace in the 500 error response body if exception reporting is turned on (the default).


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1035 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-29 09:04:31 +00:00
Leon Breedt
b14e5d8334 don't hide exceptions when we fail to parse XML-RPC messages.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1031 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-28 06:55:30 +00:00
Leon Breedt
594063f23c generalize casting code to be used by both SOAP and XML-RPC (previously only XML-RPC). switch
to better model for API methods, and improve the ability to generate protocol requests/response,
will be required by upcoming scaffolding.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1030 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-28 03:20:13 +00:00
Leon Breedt
8032c4ffd4 allow direct dispatching methods to declare their parameters as well, for brevity's sake, it seems
to be counter-intuitive not to do so (closes #939). update gem require versions.
fix unit tests for exception de-shallowing changes.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@992 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-26 00:20:19 +00:00
David Heinemeier Hansson
45137795e8 Fixed that MissingSourceFile's wasn't properly detected in production mode #925 [Nicholas Seckar]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@990 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-25 09:07:01 +00:00
David Heinemeier Hansson
3697df1dd2 Improved error reporting especially around never shallowing exceptions. Debugging helpers should be much easier now #980 [Nicholas Seckar]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@984 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-23 11:48:10 +00:00
David Heinemeier Hansson
daaa5251c9 Fixed documentation and prepared for 0.11.0 release
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@976 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-22 13:09:44 +00:00
Leon Breedt
75c304f82f make the response QName match up with that declared for the message in the
WSDL, to not do so violates the spec. also fixes this error that occurred with
SOAP::WSDLDriverFactory: "RuntimeError: Cannot find {}return as a children of {urn:ServiceName}messageName"


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@920 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-20 07:14:12 +00:00
Leon Breedt
9776bfc8a0 dup the value received from @request, so we modify the copy and not the original,
and avoid frozen errors.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@912 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-15 21:07:48 +00:00
Leon Breedt
4f2f408ba1 allow 0, 1, '0' or '1' to be cast to the appropriate values for boolean
values.

update XML-RPC example to work in :layered mode.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@883 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-10 11:53:29 +00:00
Leon Breedt
4e8ca35def change type of faultCode in marshaled SOAP faults to a QName,
and its value to 'Server' in the SOAP namespace. should fix #804.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@882 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-10 06:29:55 +00:00
Leon Breedt
d43392a50b add action_web_service/test_invoke, will be used by for testing APIs in
a Rails project instance.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@830 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-04 10:07:53 +00:00
Leon Breedt
e834be75bc allow the client to specify options to be passed through to the underlying
SOAP::RPC::Driver. add to RDoc an example of using these options to configure SSL
client-certificate authenticated connections to the server.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@826 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-03 21:30:44 +00:00
Leon Breedt
631340d5d1 make the marshaler use the same set of columns as the code that generates
WSDL, avoids mismatches when there are associations in the AR model class.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@825 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-02 22:55:00 +00:00
Leon Breedt
6b93952ae6 add allow_active_record_expects option to ActionWebService::API::Base,
but set the default to false so people don't use it without thinking about
the consequences.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@815 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-28 22:42:24 +00:00
Leon Breedt
100015cd80 Make all custom types and method calls are declared in the 'urn:ActionWebService'
namespace as a default, fixes SOAP marshaling for .NET, a regression since the merge.

Make array annotation be recursive in WS::Marshaling::SoapMarshaling, this makes
typed arrays buried in nested structures still be annotated correctly.

Support :layered dispatching mode for XML-RPC namespaced method names.

Change WS::ParamInfo.create signature to require type_binding, and update all
uses of this.

Restore #default_api_method functionality, fixes a regression since the merge.

Fix marshalling of ActiveRecord::Base derivatives, fixes a regression since the merge.

This changeset closes #676, #677, and #678.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@811 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-27 21:21:40 +00:00
Leon Breedt
6f5a7b2004 merged the changes for the upcoming 0.6.0:
seperate out protocol marshaling into a small 'ws' library in vendor, so that
AWS itself only does integration with ActionPack, and so we can keep protocol
specific code in AWS proper to a minimum. refactor unit tests to get 95%
code coverage (for a baseline).

be far more relaxed about the types given to us by the remote side, don't do
any poor man's type checking, just try to cast and marshal to the correct types if
possible, and if not, return what they gave us anyway. this should make interoperating
with fuzzy XML-RPC clients easier.

if exception reporting is turned on, do best-effort error responses, so that
we can avoid "Internal protocol error" with no details if there is a bug in
AWS itself.

also perform extensive cleanups on AWS proper.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@800 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-25 23:39:39 +00:00
Leon Breedt
7a5ff308eb handle elapsed times that are nil in #log_response (happens when API method
throws an exception). this fixes exception marshaling so that remote callers get
a proper stack trace.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@798 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-25 02:24:36 +00:00
Leon Breedt
6a7fc51c66 add code coverage testing scripts, remove dead code
detected by said scripts


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@708 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-20 01:07:54 +00:00
Leon Breedt
5f3f44e76f ensure clients can handle APIs with named parameter signatures,
and test for this


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@680 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-19 09:07:35 +00:00
Leon Breedt
418d487020 refactoring:
* move dispatching out of the Container into Dispatcher, it makes more sense
    for Container to only contain the list of web services defined
    in it.

  * collapse Wsdl and ActionController "routers" into
    an ActionController-specific module, no advantage
    to having them seperate as they were quite tightly
    coupled. rename to Dispatcher, to avoi
    confusion with Routing.

  * add a "_thing" suffix to concept-specific filenames. this is so that
    we don't end up with many soap.rb files, for example.

  * remove "virtual invocation" support. adds complexity, and it doesn't
    seem to add any value.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@679 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-19 08:29:42 +00:00
Leon Breedt
ec03a60181 rename entire package to Action Web Service
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@672 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-18 23:55:29 +00:00
David Heinemeier Hansson
7a67d0f617 Renamed Action Service to Action Web Service
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@669 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-18 23:43:09 +00:00