| 1 | # ====================================================================== | ||
| 2 | # | ||
| 3 | # Copyright (C) 2000-2004 Paul Kulchenko (paulclinger@yahoo.com) | ||
| 4 | # | ||
| 5 | # SOAP::Lite is free software; you can redistribute it | ||
| 6 | # and/or modify it under the same terms as Perl itself. | ||
| 7 | # | ||
| 8 | # ====================================================================== | ||
| 9 | package SOAP::Constants; | ||
| 10 | 44 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 44 | ▶ | use SOAP::Lite; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | 44 | our $VERSION = '1.27'; # VERSION | |
| 14 | |||
| 15 | 44 | ▶ | use constant URI_1999_SCHEMA_XSD => "http://www.w3.org/1999/XMLSchema"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | 44 | ▶ | use constant URI_1999_SCHEMA_XSI => "http://www.w3.org/1999/XMLSchema-instance"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | 44 | ▶ | use constant URI_2000_SCHEMA_XSD => "http://www.w3.org/2000/10/XMLSchema"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | 44 | ▶ | use constant URI_2000_SCHEMA_XSI => "http://www.w3.org/2000/10/XMLSchema-instance"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | 44 | ▶ | use constant URI_2001_SCHEMA_XSD => "http://www.w3.org/2001/XMLSchema"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 20 | 44 | ▶ | use constant URI_2001_SCHEMA_XSI => "http://www.w3.org/2001/XMLSchema-instance"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | 44 | ▶ | use constant URI_LITERAL_ENC => ""; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 22 | 44 | ▶ | use constant URI_SOAP11_ENC => "http://schemas.xmlsoap.org/soap/encoding/"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 23 | 44 | ▶ | use constant URI_SOAP11_ENV => "http://schemas.xmlsoap.org/soap/envelope/"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 24 | 44 | ▶ | use constant URI_SOAP11_NEXT_ACTOR => "http://schemas.xmlsoap.org/soap/actor/next"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 25 | 44 | ▶ | use constant URI_SOAP12_ENC => "http://www.w3.org/2003/05/soap-encoding"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 26 | 44 | ▶ | use constant URI_SOAP12_ENV => "http://www.w3.org/2003/05/soap-envelope"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 27 | 44 | ▶ | use constant URI_SOAP12_NOENC => "http://www.w3.org/2003/05/soap-envelope/encoding/none"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 28 | 44 | ▶ | use constant URI_SOAP12_NEXT_ACTOR => "http://www.w3.org/2003/05/soap-envelope/role/next"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 29 | |||
| 30 | 44 | ▶ | use vars qw($NSMASK $ELMASK); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 31 | |||
| 32 | 44 | $NSMASK = '[a-zA-Z_:][\w.\-:]*'; | |
| 33 | 44 | $ELMASK = '^(?![xX][mM][lL])[a-zA-Z_][\w.\-]*$'; | |
| 34 | |||
| 35 | 44 | ▶ | use vars qw($NEXT_ACTOR $NS_ENV $NS_ENC $NS_APS |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 36 | $FAULT_CLIENT $FAULT_SERVER $FAULT_VERSION_MISMATCH | ||
| 37 | $HTTP_ON_FAULT_CODE $HTTP_ON_SUCCESS_CODE $FAULT_MUST_UNDERSTAND | ||
| 38 | $NS_XSI_ALL $NS_XSI_NILS %XML_SCHEMAS $DEFAULT_XML_SCHEMA | ||
| 39 | $DEFAULT_HTTP_CONTENT_TYPE | ||
| 40 | $SOAP_VERSION %SOAP_VERSIONS $WRONG_VERSION | ||
| 41 | $NS_SL_HEADER $NS_SL_PERLTYPE $PREFIX_ENV $PREFIX_ENC | ||
| 42 | $DO_NOT_USE_XML_PARSER $DO_NOT_CHECK_MUSTUNDERSTAND | ||
| 43 | $DO_NOT_USE_CHARSET $DO_NOT_PROCESS_XML_IN_MIME | ||
| 44 | $DO_NOT_USE_LWP_LENGTH_HACK $DO_NOT_CHECK_CONTENT_TYPE | ||
| 45 | $MAX_CONTENT_SIZE $PATCH_HTTP_KEEPALIVE $DEFAULT_PACKAGER | ||
| 46 | @SUPPORTED_ENCODING_STYLES $OBJS_BY_REF_KEEPALIVE | ||
| 47 | $DEFAULT_CACHE_TTL | ||
| 48 | %XML_SCHEMA_OF | ||
| 49 | $HAS_ENCODE | ||
| 50 | 44 | ); | |
| 51 | |||
| 52 | 44 | $FAULT_CLIENT = 'Client'; | |
| 53 | 44 | $FAULT_SERVER = 'Server'; | |
| 54 | 44 | $FAULT_VERSION_MISMATCH = 'VersionMismatch'; | |
| 55 | 44 | $FAULT_MUST_UNDERSTAND = 'MustUnderstand'; | |
| 56 | |||
| 57 | 44 | $HTTP_ON_SUCCESS_CODE = 200; # OK | |
| 58 | 44 | $HTTP_ON_FAULT_CODE = 500; # INTERNAL_SERVER_ERROR | |
| 59 | |||
| 60 | 44 | @SUPPORTED_ENCODING_STYLES = ( URI_LITERAL_ENC,URI_SOAP11_ENC,URI_SOAP12_ENC,URI_SOAP12_NOENC ); | |
| 61 | |||
| 62 | 44 | $WRONG_VERSION = 'Wrong SOAP version specified.'; | |
| 63 | |||
| 64 | 44 | $SOAP_VERSION = '1.1'; | |
| 65 | 44 | %SOAP_VERSIONS = ( | |
| 66 | 1.1 => { | ||
| 67 | NEXT_ACTOR => URI_SOAP11_NEXT_ACTOR, | ||
| 68 | NS_ENV => URI_SOAP11_ENV, | ||
| 69 | NS_ENC => URI_SOAP11_ENC, | ||
| 70 | DEFAULT_XML_SCHEMA => URI_2001_SCHEMA_XSD, | ||
| 71 | DEFAULT_HTTP_CONTENT_TYPE => 'text/xml', | ||
| 72 | }, | ||
| 73 | 1.2 => { | ||
| 74 | NEXT_ACTOR => URI_SOAP12_NEXT_ACTOR, | ||
| 75 | NS_ENV => URI_SOAP12_ENV, | ||
| 76 | NS_ENC => URI_SOAP12_ENC, | ||
| 77 | DEFAULT_XML_SCHEMA => URI_2001_SCHEMA_XSD, | ||
| 78 | DEFAULT_HTTP_CONTENT_TYPE => 'application/soap+xml', | ||
| 79 | }, | ||
| 80 | ); | ||
| 81 | |||
| 82 | # schema namespaces | ||
| 83 | 44 | %XML_SCHEMAS = ( # The '()' is necessary to put constants in SCALAR form | |
| 84 | URI_1999_SCHEMA_XSD() => 'SOAP::XMLSchema1999', | ||
| 85 | URI_2001_SCHEMA_XSD() => 'SOAP::XMLSchema2001', | ||
| 86 | URI_SOAP11_ENC() => 'SOAP::XMLSchemaSOAP1_1', | ||
| 87 | URI_SOAP12_ENC() => 'SOAP::XMLSchemaSOAP1_2', | ||
| 88 | ); | ||
| 89 | |||
| 90 | # schema namespaces | ||
| 91 | 44 | %XML_SCHEMA_OF = ( # The '()' is necessary to put constants in SCALAR form | |
| 92 | URI_1999_SCHEMA_XSD() => 'XMLSchema1999', | ||
| 93 | URI_2001_SCHEMA_XSD() => 'XMLSchema2001', | ||
| 94 | URI_SOAP11_ENC() => 'XMLSchemaSOAP1_1', | ||
| 95 | URI_SOAP12_ENC() => 'XMLSchemaSOAP1_2', | ||
| 96 | ); | ||
| 97 | |||
| 98 | |||
| 99 | 44 | $NS_XSI_ALL = join join('|', map {"$_-instance"} grep {/XMLSchema/} keys %XML_SCHEMAS), '(?:', ')'; | |
| 100 | 88 | $NS_XSI_NILS = join join('|', map { my $class = $XML_SCHEMAS{$_} . '::Serializer'; "\{($_)-instance\}" . $class->nilValue | |
| 101 | 44 | } grep {/XMLSchema/} keys %XML_SCHEMAS), | |
| 102 | '(?:', ')'; | ||
| 103 | |||
| 104 | # ApacheSOAP namespaces | ||
| 105 | 44 | $NS_APS = 'http://xml.apache.org/xml-soap'; | |
| 106 | |||
| 107 | # SOAP::Lite namespace | ||
| 108 | 44 | $NS_SL_HEADER = 'http://namespaces.soaplite.com/header'; | |
| 109 | 44 | $NS_SL_PERLTYPE = 'http://namespaces.soaplite.com/perl'; | |
| 110 | |||
| 111 | # default prefixes | ||
| 112 | 44 | $PREFIX_ENV = 'soap'; | |
| 113 | 44 | $PREFIX_ENC = 'soapenc'; | |
| 114 | |||
| 115 | # others | ||
| 116 | 44 | $DO_NOT_USE_XML_PARSER = 0; | |
| 117 | 44 | $DO_NOT_CHECK_MUSTUNDERSTAND = 0; | |
| 118 | 44 | $DO_NOT_USE_CHARSET = 0; | |
| 119 | 44 | $DO_NOT_PROCESS_XML_IN_MIME = 0; | |
| 120 | 44 | $DO_NOT_USE_LWP_LENGTH_HACK = 0; | |
| 121 | 44 | $DO_NOT_CHECK_CONTENT_TYPE = 0; | |
| 122 | 44 | $PATCH_HTTP_KEEPALIVE = 1; | |
| 123 | 44 | $OBJS_BY_REF_KEEPALIVE = 600; # seconds | |
| 124 | |||
| 125 | # TODO - use default packager constant somewhere | ||
| 126 | 44 | $DEFAULT_PACKAGER = "SOAP::Packager::MIME"; | |
| 127 | 44 | $DEFAULT_CACHE_TTL = 0; | |
| 128 | |||
| 129 | 44 | $HAS_ENCODE = eval "require Encode; 1"; | |
| 130 | |||
| 131 | 44 | 1; | |
| 132 | |||
| 133 | __END__ | ||