{
    "content": [
        {
            "type": "text",
            "text": "# SOAP::Lite (perldoc)\n\n**Summary:** SOAP::Lite - Perl's Web Services Toolkit\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **DESCRIPTION** (4 lines)\n- **PERL VERSION WARNING** (11 lines)\n- **OVERVIEW OF CLASSES AND PACKAGES** (70 lines)\n- **METHODS** (416 lines)\n- **WRITING A SOAP CLIENT** (47 lines) — 2 subsections\n  - Example implementations (306 lines)\n  - Differences between the implementations (22 lines)\n- **WRITING A SOAP SERVER** (2 lines)\n- **FEATURES** (355 lines)\n- **SECURITY** (30 lines)\n- **INTEROPERABILITY** (1 lines) — 1 subsections\n  - Microsoft .NET client with SOAP::Lite Server (167 lines)\n- **TROUBLESHOOTING** (118 lines)\n- **PERFORMANCE** (53 lines)\n- **BUGS AND LIMITATIONS** (12 lines)\n- **PLATFORM SPECIFICS** (10 lines)\n- **RELATED MODULES** (1 lines) — 1 subsections\n  - Transport Modules (10 lines)\n- **AVAILABILITY** (8 lines)\n- **ACKNOWLEDGEMENTS** (12 lines)\n- **HACKING** (8 lines)\n- **REPORTING BUGS** (3 lines)\n- **COPYRIGHT** (6 lines)\n- **LICENSE** (7 lines)\n- **AUTHORS** (10 lines)\n\n## Full Content\n\n### NAME\n\nSOAP::Lite - Perl's Web Services Toolkit\n\n### DESCRIPTION\n\nSOAP::Lite is a collection of Perl modules which provides a simple and\nlightweight interface to the Simple Object Access Protocol (SOAP) both\non client and server side.\n\n### PERL VERSION WARNING\n\nAs of version SOAP::Lite version 1.05, no perl versions before 5.8 will\nbe supported.\n\nSOAP::Lite 0.71 will be the last version of SOAP::Lite running on perl\n5.005\n\nFuture versions of SOAP::Lite will require at least perl 5.6.0\n\nIf you have not had the time to upgrade your perl, you should consider\nthis now.\n\n### OVERVIEW OF CLASSES AND PACKAGES\n\nlib/SOAP/Lite.pm\nSOAP::Lite - Main class provides all logic\n\nSOAP::Transport - Transport backend\n\nSOAP::Data - Data objects\n\nSOAP::Header - Header Data Objects\n\nSOAP::Serializer - Serializes data structures to SOAP messages\n\nSOAP::Deserializer - Deserializes SOAP messages into SOAP::SOM\nobjects\n\nSOAP::SOM - SOAP Message objects\n\nSOAP::Constants - Provides access to common constants and defaults\n\nSOAP::Trace - Tracing facilities\n\nSOAP::Schema - Provides access and stub(s) for schema(s)\n\nSOAP::Schema::WSDL - WSDL implementation for SOAP::Schema\n\nSOAP::Server - Handles requests on server side\n\nSOAP::Server::Object - Handles objects-by-reference\n\nSOAP::Fault - Provides support for Faults on server side\n\nSOAP::Utils - A set of private and public utility subroutines\n\nlib/SOAP/Packager.pm\nSOAP::Packager - Provides an abstract class for implementing custom\npackagers.\n\nSOAP::Packager::MIME - Provides MIME support to SOAP::Lite\n\nSOAP::Packager::DIME - Provides DIME support to SOAP::Lite\n\nlib/SOAP/Transport/HTTP.pm\nSOAP::Transport::HTTP::Client - Client interface to HTTP transport\n\nSOAP::Transport::HTTP::Server - Server interface to HTTP transport\n\nSOAP::Transport::HTTP::CGI - CGI implementation of server interface\n\nSOAP::Transport::HTTP::Daemon - Daemon implementation of server\ninterface\n\nSOAP::Transport::HTTP::Apache - modperl implementation of server\ninterface\n\nlib/SOAP/Transport/POP3.pm\nSOAP::Transport::POP3::Server - Server interface to POP3 protocol\n\nlib/SOAP/Transport/MAILTO.pm\nSOAP::Transport::MAILTO::Client - Client interface to SMTP/sendmail\n\nlib/SOAP/Transport/LOCAL.pm\nSOAP::Transport::LOCAL::Client - Client interface to local transport\n\nlib/SOAP/Transport/TCP.pm\nSOAP::Transport::TCP::Server - Server interface to TCP protocol\n\nSOAP::Transport::TCP::Client - Client interface to TCP protocol\n\nlib/SOAP/Transport/IO.pm\nSOAP::Transport::IO::Server - Server interface to IO transport\n\n### METHODS\n\nAll accessor methods return the current value when called with no\narguments, while returning the object reference itself when called with\na new value. This allows the set-attribute calls to be chained together.\n\nnew(optional key/value pairs)\n$client = SOAP::Lite->new(proxy => $endpoint)\n\nConstructor. Many of the accessor methods defined here may be\ninitialized at creation by providing their name as a key, followed\nby the desired value. The example provides the value for the proxy\nelement of the client.\n\ntransport(optional transport object)\n$transp = $client->transport( );\n\nGets or sets the transport object used for sending/receiving SOAP\nmessages.\n\nSee SOAP::Transport for details.\n\nserializer(optional serializer object)\n$serial = $client->serializer( )\n\nGets or sets the serializer object used for creating XML messages.\n\nSee SOAP::Serializer for details.\n\npackager(optional packager object)\n$packager = $client->packager( )\n\nProvides access to the \"SOAP::Packager\" object that the client uses\nto manage the use of attachments. The default packager is a MIME\npackager, but unless you specify parts to send, no MIME formatting\nwill be done.\n\nSee also: SOAP::Packager.\n\nproxy(endpoint, optional extra arguments)\n$client->proxy('http://soap.xml.info/ endPoint');\n\nThe proxy is the server or endpoint to which the client is going to\nconnect. This method allows the setting of the endpoint, along with\nany extra information that the transport object may need when\ncommunicating the request.\n\nThis method is actually an alias to the proxy method of\nSOAP::Transport. It is the same as typing:\n\n$client->transport( )->proxy(...arguments);\n\nExtra parameters can be passed to proxy() - see below.\n\ncompressthreshold\nSee COMPRESSION in HTTP::Transport.\n\nAll initialization options from the underlying transport layer\nThe options for HTTP(S) are the same as for LWP::UserAgent's\nnew() method.\n\nA common option is to create a instance of HTTP::Cookies and\npass it as cookiejar option:\n\nmy $cookiejar = HTTP::Cookies->new()\n$client->proxy('http://www.example.org/webservice',\ncookiejar => $cookiejar,\n);\n\nFor example, if you wish to set the HTTP timeout for a SOAP::Lite\nclient to 5 seconds, use the following code:\n\nmy $soap = SOAP::Lite\n->uri($uri)\n->proxy($proxyUrl, timeout => 5 );\n\nSee LWP::UserAgent.\n\nendpoint(optional new endpoint address)\n$client->endpoint('http://soap.xml.info/ newPoint')\n\nIt may be preferable to set a new endpoint without the additional\nwork of examining the new address for protocol information and\nchecking to ensure the support code is loaded and available. This\nmethod allows the caller to change the endpoint that the client is\ncurrently set to connect to, without reloading the relevant\ntransport code. Note that the proxy method must have been called\nbefore this method is used.\n\nservice(service URL)\n$client->service('http://svc.perl.org/Svc.wsdl');\n\n\"SOAP::Lite\" offers some support for creating method stubs from\nservice descriptions. At present, only WSDL support is in place.\nThis method loads the specified WSDL schema and uses it as the basis\nfor generating stubs.\n\noutputxml(boolean)\n$client->outputxml('true');\n\nWhen set to a true value, the raw XML is returned by the call to a\nremote method.\n\nThe default is to return a SOAP::SOM object (false).\n\nautotype(boolean)\n$client->autotype(0);\n\nThis method is a shortcut for:\n\n$client->serializer->autotype(boolean);\n\nBy default, the serializer tries to automatically deduce types for\nthe data being sent in a message. Setting a false value with this\nmethod disables the behavior.\n\nreadable(boolean)\n$client->readable(1);\n\nThis method is a shortcut for:\n\n$client->serializer->readable(boolean);\n\nWhen this is used to set a true value for this property, the\ngenerated XML sent to the endpoint has extra characters (spaces and\nnew lines) added in to make the XML itself more readable to human\neyes (presumably for debugging). The default is to not send any\nadditional characters.\n\nheaderattr(hash reference of attributes)\n$obj->headerattr({ attr1 => 'value' });\n\nAllows for the setting of arbitrary attributes on the header object.\nKeep in mind the requirement that any attributes not natively known\nto SOAP must be namespace-qualified. If using $session->call\n($method, $callData, $callHeader), SOAP::Lite serializes information\nas\n\n<soap:Envelope>\n<soap:Header>\n<userId>xxxxx</userId>\n<password>yyyyy</password>\n</soap:Header>\n<soap:Body>\n<myMethod xmlns=\"http://www.someuri.com\">\n<foo />\n</myMethod>\n</soap:Body>\n</soap:Envelope>\n\nThe attributes, given to headerattr are placed into the Header as\n\n<soap:Header attr1=\"value\">\n\nbodyattr(hash reference of attributes)\n$obj->bodyattr({ attr1 => 'value' });\n\nAllows for the setting of arbitrary attributes on the body object.\nKeep in mind the requirement that any attributes not natively known\nto SOAP must be namespace-qualified. See headerattr\n\ndefaultns($uri)\nSets the default namespace for the request to the specified uri.\nThis overrides any previous namespace declaration that may have been\nset using a previous call to \"ns()\" or \"defaultns()\". Setting the\ndefault namespace causes elements to be serialized without a\nnamespace prefix, like this:\n\n<soap:Envelope>\n<soap:Body>\n<myMethod xmlns=\"http://www.someuri.com\">\n<foo />\n</myMethod>\n</soap:Body>\n</soap:Envelope>\n\nSome .NET web services have been reported to require this XML\nnamespace idiom.\n\nns($uri,$prefix=undef)\nSets the namespace uri and optionally the namespace prefix for the\nrequest to the specified values. This overrides any previous\nnamespace declaration that may have been set using a previous call\nto \"ns()\" or \"defaultns()\".\n\nIf a prefix is not specified, one will be generated for you\nautomatically. Setting the namespace causes elements to be\nserialized with a declared namespace prefix, like this:\n\n<soap:Envelope>\n<soap:Body>\n<my:myMethod xmlns:my=\"http://www.someuri.com\">\n<my:foo />\n</my:myMethod>\n</soap:Body>\n</soap:Envelope>\n\nuseprefix(boolean)\nDeprecated. Use the \"ns()\" and \"defaultns\" methods described above.\n\nShortcut for \"serializer->useprefix()\". This lets you turn on/off\nthe use of a namespace prefix for the children of the /Envelope/Body\nelement. Default is 'true'.\n\nWhen useprefix is set to 'true', serialized XML will look like\nthis:\n\n<SOAP-ENV:Envelope ...attributes skipped>\n<SOAP-ENV:Body>\n<namesp1:mymethod xmlns:namesp1=\"urn:MyURI\" />\n</SOAP-ENV:Body>\n</SOAP-ENV:Envelope>\n\nWhen useprefix is set to 'false', serialized XML will look like\nthis:\n\n<SOAP-ENV:Envelope ...attributes skipped>\n<SOAP-ENV:Body>\n<mymethod xmlns=\"urn:MyURI\" />\n</SOAP-ENV:Body>\n</SOAP-ENV:Envelope>\n\nSome .NET web services have been reported to require this XML\nnamespace idiom.\n\nsoapversion(optional value)\n$client->soapversion('1.2');\n\nIf no parameter is given, returns the current version of SOAP that\nis being used by the client object to encode requests. If a\nparameter is given, the method attempts to set that as the version\nof SOAP being used.\n\nThe value should be either 1.1 or 1.2.\n\nenvprefix(QName)\n$client->envprefix('env');\n\nThis method is a shortcut for:\n\n$client->serializer->envprefix(QName);\n\nGets or sets the namespace prefix for the SOAP namespace. The\ndefault is SOAP.\n\nThe prefix itself has no meaning, but applications may wish to chose\none explicitly to denote different versions of SOAP or the like.\n\nencprefix(QName)\n$client->encprefix('enc');\n\nThis method is a shortcut for:\n\n$client->serializer->encprefix(QName);\n\nGets or sets the namespace prefix for the encoding rules namespace.\nThe default value is SOAP-ENC.\n\nWhile it may seem to be an unnecessary operation to set a value that\nisn't relevant to the message, such as the namespace labels for the\nenvelope and encoding URNs, the ability to set these labels explicitly\ncan prove to be a great aid in distinguishing and debugging messages on\nthe server side of operations.\n\nencoding(encoding URN)\n$client->encoding($soap12encodingURN);\n\nThis method is a shortcut for:\n\n$client->serializer->encoding(args);\n\nWhere the earlier method dealt with the label used for the\nattributes related to the SOAP encoding scheme, this method actually\nsets the URN to be specified as the encoding scheme for the message.\nThe default is to specify the encoding for SOAP 1.1, so this is\nhandy for applications that need to encode according to SOAP 1.2\nrules.\n\ntypelookup\n$client->typelookup;\n\nThis method is a shortcut for:\n\n$client->serializer->typelookup;\n\nGives the application access to the type-lookup table from the\nserializer object. See the section on SOAP::Serializer.\n\nuri(service specifier)\nDeprecated - the \"uri\" subroutine is deprecated in order to provide\na more intuitive naming scheme for subroutines that set namespaces.\nIn the future, you will be required to use either the \"ns()\" or\n\"defaultns()\" subroutines instead of \"uri()\".\n\n$client->uri($serviceuri);\n\nThis method is a shortcut for:\n\n$client->serializer->uri(service);\n\nThe URI associated with this accessor on a client object is the\nservice-specifier for the request, often encoded for HTTP-based\nrequests as the SOAPAction header. While the names may seem\nconfusing, this method doesn't specify the endpoint itself. In most\ncircumstances, the \"uri\" refers to the namespace used for the\nrequest.\n\nOften times, the value may look like a valid URL. Despite this, it\ndoesn't have to point to an existing resource (and often doesn't).\nThis method sets and retrieves this value from the object. Note that\nno transport code is triggered by this because it has no direct\neffect on the transport of the object.\n\nmultirefinplace(boolean)\n$client->multirefinplace(1);\n\nThis method is a shortcut for:\n\n$client->serializer->multirefinplace(boolean);\n\nControls how the serializer handles values that have multiple\nreferences to them. Recall from previous SOAP chapters that a value\nmay be tagged with an identifier, then referred to in several\nplaces. When this is the case for a value, the serializer defaults\nto putting the data element towards the top of the message, right\nafter the opening tag of the method-specification. It is serialized\nas a standalone entity with an ID that is then referenced at the\nrelevant places later on. If this method is used to set a true\nvalue, the behavior is different. When the multirefinplace attribute\nis true, the data is serialized at the first place that references\nit, rather than as a separate element higher up in the body. This is\nmore compact but may be harder to read or trace in a debugging\nenvironment.\n\nparts( ARRAY )\nUsed to specify an array of MIME::Entity's to be attached to the\ntransmitted SOAP message. Attachments that are returned in a\nresponse can be accessed by \"SOAP::SOM::parts()\".\n\nself\n$ref = SOAP::Lite->self;\n\nReturns an object reference to the default global object the\n\"SOAP::Lite\" package maintains. This is the object that processes\nmany of the arguments when provided on the use line.\n\nThe following method isn't an accessor style of method but neither does\nit fit with the group that immediately follows it:\n\ncall(arguments)\n$client->call($method => @arguments);\n\nAs has been illustrated in previous chapters, the \"SOAP::Lite\"\nclient objects can manage remote calls with auto-dispatching using\nsome of Perl's more elaborate features. call is used when the\napplication wants a greater degree of control over the details of\nthe call itself. The method may be built up from a SOAP::Data\nobject, so as to allow full control over the namespace associated\nwith the tag, as well as other attributes like encoding. This is\nalso important for calling methods that contain characters not\nallowable in Perl function names, such as A.B.C.\n\nThe next four methods used in the \"SOAP::Lite\" class are geared towards\nhandling the types of events than can occur during the message\nlifecycle. Each of these sets up a callback for the event in question:\n\nonaction(callback)\n$client->onaction(sub { qq(\"$[0]\") });\n\nTriggered when the transport object sets up the SOAPAction header\nfor an HTTP-based call. The default is to set the header to the\nstring, uri#method, in which URI is the value set by the uri method\ndescribed earlier, and method is the name of the method being\ncalled. When called, the routine referenced (or the closure, if\nspecified as in the example) is given two arguments, uri and method,\nin that order.\n\n.NET web services usually expect \"/\" as separator for \"uri\" and\n\"method\". To change SOAP::Lite's behaviour to use uri/method as\nSOAPAction header, use the following code:\n\n$client->onaction( sub { join '/', @ } );\n\nonfault(callback)\n$client->onfault(sub { popupdialog($[1]) });\n\nTriggered when a method call results in a fault response from the\nserver. When it is called, the argument list is first the client\nobject itself, followed by the object that encapsulates the fault.\nIn the example, the fault object is passed (without the client\nobject) to a hypothetical GUI function that presents an error dialog\nwith the text of fault extracted from the object (which is covered\nshortly under the SOAP::SOM methods).\n\nonnonserialized(callback)\n$client->onnonserialized(sub { die \"$[0]?!?\" });\n\nOccasionally, the serializer may be given data it can't turn into\nSOAP-savvy XML; for example, if a program bug results in a code\nreference or something similar being passed in as a parameter to\nmethod call. When that happens, this callback is activated, with one\nargument. That argument is the data item that could not be\nunderstood. It will be the only argument. If the routine returns,\nthe return value is pasted into the message as the serialization.\nGenerally, an error is in order, and this callback allows for\ncontrol over signaling that error.\n\nondebug(callback)\n$client->ondebug(sub { print @ });\n\nDeprecated. Use the global +debug and +trace facilities described in\nSOAP::Trace\n\nNote that this method will not work as expected: Instead of\naffecting the debugging behaviour of the object called on, it will\nglobally affect the debugging behaviour for all objects of that\nclass.\n\n### WRITING A SOAP CLIENT\n\nThis chapter guides you to writing a SOAP client by example.\n\nThe SOAP service to be accessed is a simple variation of the well-known\nhello world program. It accepts two parameters, a name and a given name,\nand returns \"Hello $givenname $name\".\n\nWe will use \"Martin Kutter\" as the name for the call, so all variants\nwill print the following message on success:\n\nHello Martin Kutter!\n\nSOAP message styles\nThere are three common (and one less common) variants of SOAP messages.\n\nThese address the message style (positional parameters vs. specified\nmessage documents) and encoding (as-is vs. typed).\n\nThe different message styles are:\n\n*   rpc/encoded\n\nTyped, positional parameters. Widely used in scripting languages.\nThe type of the arguments is included in the message. Arrays and the\nlike may be encoded using SOAP encoding rules (or others).\n\n*   rpc/literal\n\nAs-is, positional parameters. The type of arguments is defined by\nsome pre-exchanged interface definition.\n\n*   document/encoded\n\nSpecified message with typed elements. Rarely used.\n\n*   document/literal\n\nSpecified message with as-is elements. The message specification and\nelement types are defined by some pre-exchanged interface\ndefinition.\n\nAs of 2008, document/literal has become the predominant SOAP message\nvariant. rpc/literal and rpc/encoded are still in use, mainly with\nscripting languages, while document/encoded is hardly used at all.\n\nYou will see clients for the rpc/encoded and document/literal SOAP\nvariants in this section.\n\n#### Example implementations\n\nRPC/ENCODED\nRpc/encoded is most popular with scripting languages like perl, php and\npython without the use of a WSDL. Usual method descriptions look like\nthis:\n\nMethod: sayHello(string, string)\nParameters:\nname: string\ngivenName: string\n\nSuch a description usually means that you can call a method named\n\"sayHello\" with two positional parameters, \"name\" and \"givenName\", which\nboth are strings.\n\nThe message corresponding to this description looks somewhat like this:\n\n<sayHello xmlns=\"urn:HelloWorld\">\n<s-gensym01 xsi:type=\"xsd:string\">Kutter</s-gensym01>\n<s-gensym02 xsi:type=\"xsd:string\">Martin</s-gensym02>\n</sayHello>\n\nAny XML tag names may be used instead of the \"s-gensym01\" stuff -\nparameters are positional, the tag names have no meaning.\n\nA client producing such a call is implemented like this:\n\nuse SOAP::Lite;\nmy $soap = SOAP::Lite->new( proxy => 'http://localhost:81/soap-wsdl-test/helloworld.pl');\n$soap->defaultns('urn:HelloWorld');\nmy $som = $soap->call('sayHello', 'Kutter', 'Martin');\ndie $som->faultstring if ($som->fault);\nprint $som->result, \"\\n\";\n\nYou can of course use a one-liner, too...\n\nSometimes, rpc/encoded interfaces are described with WSDL definitions. A\nWSDL accepting \"named\" parameters with rpc/encoded looks like this:\n\n<definitions xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\"\nxmlns:s=\"http://www.w3.org/2001/XMLSchema\"\nxmlns:s0=\"urn:HelloWorld\"\ntargetNamespace=\"urn:HelloWorld\"\nxmlns=\"http://schemas.xmlsoap.org/wsdl/\">\n<types>\n<s:schema targetNamespace=\"urn:HelloWorld\">\n</s:schema>\n</types>\n<message name=\"sayHello\">\n<part name=\"name\" type=\"s:string\" />\n<part name=\"givenName\" type=\"s:string\" />\n</message>\n<message name=\"sayHelloResponse\">\n<part name=\"sayHelloResult\" type=\"s:string\" />\n</message>\n\n<portType name=\"Service1Soap\">\n<operation name=\"sayHello\">\n<input message=\"s0:sayHello\" />\n<output message=\"s0:sayHelloResponse\" />\n</operation>\n</portType>\n\n<binding name=\"Service1Soap\" type=\"s0:Service1Soap\">\n<soap:binding transport=\"http://schemas.xmlsoap.org/soap/http\"\nstyle=\"rpc\" />\n<operation name=\"sayHello\">\n<soap:operation soapAction=\"urn:HelloWorld#sayHello\"/>\n<input>\n<soap:body use=\"encoded\"\nencodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"/>\n</input>\n<output>\n<soap:body use=\"encoded\"\nencodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"/>\n</output>\n</operation>\n</binding>\n<service name=\"HelloWorld\">\n<port name=\"HelloWorldSoap\" binding=\"s0:Service1Soap\">\n<soap:address location=\"http://localhost:81/soap-wsdl-test/helloworld.pl\" />\n</port>\n</service>\n</definitions>\n\nThe message corresponding to this schema looks like this:\n\n<sayHello xmlns=\"urn:HelloWorld\">\n<name xsi:type=\"xsd:string\">Kutter</name>\n<givenName xsi:type=\"xsd:string\">Martin</givenName>\n</sayHello>\n\nA web service client using this schema looks like this:\n\nuse SOAP::Lite;\nmy $soap = SOAP::Lite->service(\"file:sayhellorpcenc.wsdl\");\neval { my $result = $soap->sayHello('Kutter', 'Martin'); };\nif ($@) {\ndie $@;\n}\nprint $som->result();\n\nYou may of course also use the following one-liner:\n\nperl -MSOAP::Lite -e 'print SOAP::Lite->service(\"file:sayhellorpcenc.wsdl\")\\\n->sayHello('Kutter', 'Martin'), \"\\n\";'\n\nA web service client (without a service description) looks like this.\n\nuse SOAP::Lite;\nmy $soap = SOAP::Lite->new( proxy => 'http://localhost:81/soap-wsdl-test/helloworld.pl');\n$soap->defaultns('urn:HelloWorld');\nmy $som = $soap->call('sayHello',\nSOAP::Data->name('name')->value('Kutter'),\nSOAP::Data->name('givenName')->value('Martin')\n);\ndie $som->faultstring if ($som->fault);\nprint $som->result, \"\\n\";\n\nRPC/LITERAL\nSOAP web services using the document/literal message encoding are\nusually described by some Web Service Definition. Our web service has\nthe following WSDL description:\n\n<definitions xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\"\nxmlns:s=\"http://www.w3.org/2001/XMLSchema\"\nxmlns:s0=\"urn:HelloWorld\"\ntargetNamespace=\"urn:HelloWorld\"\nxmlns=\"http://schemas.xmlsoap.org/wsdl/\">\n<types>\n<s:schema targetNamespace=\"urn:HelloWorld\">\n<s:complexType name=\"sayHello\">\n<s:sequence>\n<s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"name\"\ntype=\"s:string\" />\n<s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"givenName\"\ntype=\"s:string\" nillable=\"1\" />\n</s:sequence>\n</s:complexType>\n\n<s:complexType name=\"sayHelloResponse\">\n<s:sequence>\n<s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"sayHelloResult\"\ntype=\"s:string\" />\n</s:sequence>\n</s:complexType>\n</s:schema>\n</types>\n<message name=\"sayHello\">\n<part name=\"parameters\" type=\"s0:sayHello\" />\n</message>\n<message name=\"sayHelloResponse\">\n<part name=\"parameters\" type=\"s0:sayHelloResponse\" />\n</message>\n\n<portType name=\"Service1Soap\">\n<operation name=\"sayHello\">\n<input message=\"s0:sayHello\" />\n<output message=\"s0:sayHelloResponse\" />\n</operation>\n</portType>\n\n<binding name=\"Service1Soap\" type=\"s0:Service1Soap\">\n<soap:binding transport=\"http://schemas.xmlsoap.org/soap/http\"\nstyle=\"rpc\" />\n<operation name=\"sayHello\">\n<soap:operation soapAction=\"urn:HelloWorld#sayHello\"/>\n<input>\n<soap:body use=\"literal\" namespace=\"urn:HelloWorld\"/>\n</input>\n<output>\n<soap:body use=\"literal\" namespace=\"urn:HelloWorld\"/>\n</output>\n</operation>\n</binding>\n<service name=\"HelloWorld\">\n<port name=\"HelloWorldSoap\" binding=\"s0:Service1Soap\">\n<soap:address location=\"http://localhost:80//helloworld.pl\" />\n</port>\n</service>\n</definitions>\n\nThe XML message (inside the SOAP Envelope) look like this:\n\n<ns0:sayHello xmlns:ns0=\"urn:HelloWorld\">\n<parameters>\n<name>Kutter</name>\n<givenName>Martin</givenName>\n</parameters>\n</ns0:sayHello>\n\n<sayHelloResponse xmlns:ns0=\"urn:HelloWorld\">\n<parameters>\n<sayHelloResult>Hello Martin Kutter!</sayHelloResult>\n</parameters>\n</sayHelloResponse>\n\nThis is the SOAP::Lite implementation for the web service client:\n\nuse SOAP::Lite +trace;\nmy $soap = SOAP::Lite->new( proxy => 'http://localhost:80/helloworld.pl');\n\n$soap->onaction( sub { \"urn:HelloWorld#sayHello\" });\n$soap->autotype(0)->readable(1);\n$soap->defaultns('urn:HelloWorld');\n\nmy $som = $soap->call('sayHello', SOAP::Data->name('parameters')->value(\n\\SOAP::Data->value([\nSOAP::Data->name('name')->value( 'Kutter' ),\nSOAP::Data->name('givenName')->value('Martin'),\n]))\n);\n\ndie $som->fault->{ faultstring } if ($som->fault);\nprint $som->result, \"\\n\";\n\nDOCUMENT/LITERAL\nSOAP web services using the document/literal message encoding are\nusually described by some Web Service Definition. Our web service has\nthe following WSDL description:\n\n<definitions xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\"\nxmlns:s=\"http://www.w3.org/2001/XMLSchema\"\nxmlns:s0=\"urn:HelloWorld\"\ntargetNamespace=\"urn:HelloWorld\"\nxmlns=\"http://schemas.xmlsoap.org/wsdl/\">\n<types>\n<s:schema targetNamespace=\"urn:HelloWorld\">\n<s:element name=\"sayHello\">\n<s:complexType>\n<s:sequence>\n<s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"name\" type=\"s:string\" />\n<s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"givenName\" type=\"s:string\" nillable=\"1\" />\n</s:sequence>\n</s:complexType>\n</s:element>\n\n<s:element name=\"sayHelloResponse\">\n<s:complexType>\n<s:sequence>\n<s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"sayHelloResult\" type=\"s:string\" />\n</s:sequence>\n</s:complexType>\n</s:element>\n</types>\n<message name=\"sayHelloSoapIn\">\n<part name=\"parameters\" element=\"s0:sayHello\" />\n</message>\n<message name=\"sayHelloSoapOut\">\n<part name=\"parameters\" element=\"s0:sayHelloResponse\" />\n</message>\n\n<portType name=\"Service1Soap\">\n<operation name=\"sayHello\">\n<input message=\"s0:sayHelloSoapIn\" />\n<output message=\"s0:sayHelloSoapOut\" />\n</operation>\n</portType>\n\n<binding name=\"Service1Soap\" type=\"s0:Service1Soap\">\n<soap:binding transport=\"http://schemas.xmlsoap.org/soap/http\"\nstyle=\"document\" />\n<operation name=\"sayHello\">\n<soap:operation soapAction=\"urn:HelloWorld#sayHello\"/>\n<input>\n<soap:body use=\"literal\" />\n</input>\n<output>\n<soap:body use=\"literal\" />\n</output>\n</operation>\n</binding>\n<service name=\"HelloWorld\">\n<port name=\"HelloWorldSoap\" binding=\"s0:Service1Soap\">\n<soap:address location=\"http://localhost:80//helloworld.pl\" />\n</port>\n</service>\n</definitions>\n\nThe XML message (inside the SOAP Envelope) look like this:\n\n<sayHello xmlns=\"urn:HelloWorld\">\n<name>Kutter</name>\n<givenName>Martin</givenName>\n</sayHello>\n\n<sayHelloResponse>\n<sayHelloResult>Hello Martin Kutter!</sayHelloResult>\n</sayHelloResponse>\n\nYou can call this web service with the following client code:\n\nuse SOAP::Lite;\nmy $soap = SOAP::Lite->new( proxy => 'http://localhost:80/helloworld.pl');\n\n$soap->onaction( sub { \"urn:HelloWorld#sayHello\" });\n$soap->autotype(0);\n$soap->defaultns('urn:HelloWorld');\n\nmy $som = $soap->call(\"sayHello\",\nSOAP::Data->name('name')->value( 'Kutter' ),\nSOAP::Data->name('givenName')->value('Martin'),\n);\n\ndie $som->fault->{ faultstring } if ($som->fault);\nprint $som->result, \"\\n\";\n\n#### Differences between the implementations\n\nYou may have noticed that there's little difference between the\nrpc/encoded, rpc/literal and the document/literal example's\nimplementation. In fact, from SOAP::Lite's point of view, the only\ndifferences between rpc/literal and document/literal that parameters are\nalways named.\n\nIn our example, the rpc/encoded variant already used named parameters\n(by using two messages), so there's no difference at all.\n\nYou may have noticed the somewhat strange idiom for passing a list of\nnamed parameters in the rpc/literal example:\n\nmy $som = $soap->call('sayHello', SOAP::Data->name('parameters')->value(\n\\SOAP::Data->value([\nSOAP::Data->name('name')->value( 'Kutter' ),\nSOAP::Data->name('givenName')->value('Martin'),\n]))\n);\n\nWhile SOAP::Data provides full control over the XML generated, passing\nhash-like structures require additional coding.\n\n### WRITING A SOAP SERVER\n\nSee SOAP::Server, or SOAP::Transport.\n\n### FEATURES\n\nATTACHMENTS\n\"SOAP::Lite\" features support for the SOAP with Attachments\nspecification. Currently, SOAP::Lite only supports MIME based\nattachments. DIME based attachments are yet to be fully functional.\n\nEXAMPLES\nClient sending an attachment\n\"SOAP::Lite\" clients can specify attachments to be sent along with a\nrequest by using the \"SOAP::Lite::parts()\" method, which takes as an\nargument an ARRAY of \"MIME::Entity\"'s.\n\nuse SOAP::Lite;\nuse MIME::Entity;\nmy $ent = build MIME::Entity\nType        => \"image/gif\",\nEncoding    => \"base64\",\nPath        => \"somefile.gif\",\nFilename    => \"saveme.gif\",\nDisposition => \"attachment\";\nmy $som = SOAP::Lite\n->uri($SOMENAMESPACE)\n->parts([ $ent ])\n->proxy($SOMEHOST)\n->somemethod(SOAP::Data->name(\"foo\" => \"bar\"));\n\nClient retrieving an attachment\nA client accessing attachments that were returned in a response by using\nthe \"SOAP::SOM::parts()\" accessor.\n\nuse SOAP::Lite;\nuse MIME::Entity;\nmy $soap = SOAP::Lite\n->uri($NS)\n->proxy($HOST);\nmy $som = $soap->foo();\nforeach my $part (${$som->parts}) {\nprint $part->stringify;\n}\n\nServer receiving an attachment\nServers, like clients, use the SOAP::SOM module to access attachments\ntransmitted to it.\n\npackage Attachment;\nuse SOAP::Lite;\nuse MIME::Entity;\nuse strict;\nuse vars qw(@ISA);\n@ISA = qw(SOAP::Server::Parameters);\nsub someMethod {\nmy $self = shift;\nmy $envelope = pop;\nforeach my $part (@{$envelope->parts}) {\nprint \"AttachmentService: attachment found! (\".ref($part).\")\\n\";\n}\n# do something\n}\n\nServer responding with an attachment\nServers wishing to return an attachment to the calling client need only\nreturn \"MIME::Entity\" objects along with SOAP::Data elements, or any\nother data intended for the response.\n\npackage Attachment;\nuse SOAP::Lite;\nuse MIME::Entity;\nuse strict;\nuse vars qw(@ISA);\n@ISA = qw(SOAP::Server::Parameters);\nsub someMethod {\nmy $self = shift;\nmy $envelope = pop;\nmy $ent = build MIME::Entity\n'Id'          => \"<1234>\",\n'Type'        => \"text/xml\",\n'Path'        => \"some.xml\",\n'Filename'    => \"some.xml\",\n'Disposition' => \"attachment\";\nreturn SOAP::Data->name(\"foo\" => \"blah blah blah\"),$ent;\n}\n\nDEFAULT SETTINGS\nThough this feature looks similar to autodispatch they have (almost)\nnothing in common. This capability allows you specify default settings\nso that all objects created after that will be initialized with the\nproper default settings.\n\nIf you wish to provide common \"proxy()\" or \"uri()\" settings for all\n\"SOAP::Lite\" objects in your application you may do:\n\nuse SOAP::Lite\nproxy => 'http://localhost/cgi-bin/soap.cgi',\nuri => 'http://my.own.com/My/Examples';\n\nmy $soap1 = new SOAP::Lite; # will get the same proxy()/uri() as above\nprint $soap1->getStateName(1)->result;\n\nmy $soap2 = SOAP::Lite->new; # same thing as above\nprint $soap2->getStateName(2)->result;\n\n# or you may override any settings you want\nmy $soap3 = SOAP::Lite->proxy('http://localhost/');\nprint $soap3->getStateName(1)->result;\n\nAny \"SOAP::Lite\" properties can be propagated this way. Changes in\nobject copies will not affect global settings and you may still change\nglobal settings with \"SOAP::Lite->self\" call which returns reference to\nglobal object. Provided parameter will update this object and you can\neven set it to \"undef\":\n\nSOAP::Lite->self(undef);\n\nThe \"use SOAP::Lite\" syntax also lets you specify default event handlers\nfor your code. If you have different SOAP objects and want to share the\nsame \"onaction()\" (or \"onfault()\" for that matter) handler. You can\nspecify \"onaction()\" during initialization for every object, but you\nmay also do:\n\nuse SOAP::Lite\nonaction => sub {sprintf '%s#%s', @};\n\nand this handler will be the default handler for all your SOAP objects.\nYou can override it if you specify a handler for a particular object.\nSee t/*.t for example of onfault() handler.\n\nBe warned, that since \"use ...\" is executed at compile time all \"use\"\nstatements will be executed before script execution that can make\nunexpected results. Consider code:\n\nuse SOAP::Lite proxy => 'http://localhost/';\nprint SOAP::Lite->getStateName(1)->result;\n\nuse SOAP::Lite proxy => 'http://localhost/cgi-bin/soap.cgi';\nprint SOAP::Lite->getStateName(1)->result;\n\nBoth SOAP calls will go to 'http://localhost/cgi-bin/soap.cgi'. If you\nwant to execute \"use\" at run-time, put it in \"eval\":\n\neval \"use SOAP::Lite proxy => 'http://localhost/cgi-bin/soap.cgi'; 1\" or die;\n\nOr alternatively,\n\nSOAP::Lite->self->proxy('http://localhost/cgi-bin/soap.cgi');\n\nSETTING MAXIMUM MESSAGE SIZE\nOne feature of \"SOAP::Lite\" is the ability to control the maximum size\nof a message a SOAP::Lite server will be allowed to process. To control\nthis feature simply define $SOAP::Constants::MAXCONTENTSIZE in your\ncode like so:\n\nuse SOAP::Transport::HTTP;\nuse MIME::Entity;\n$SOAP::Constants::MAXCONTENTSIZE = 10000;\nSOAP::Transport::HTTP::CGI\n->dispatchto('TemperatureService')\n->handle;\n\nIN/OUT, OUT PARAMETERS AND AUTOBINDING\n\"SOAP::Lite\" gives you access to all parameters (both in/out and out)\nand also does some additional work for you. Lets consider following\nexample:\n\n<mehodResponse>\n<res1>name1</res1>\n<res2>name2</res2>\n<res3>name3</res3>\n</mehodResponse>\n\nIn that case:\n\n$result = $r->result; # gives you 'name1'\n$paramout1 = $r->paramsout;      # gives you 'name2', because of scalar context\n$paramout1 = ($r->paramsout)[0]; # gives you 'name2' also\n$paramout2 = ($r->paramsout)[1]; # gives you 'name3'\n\nor\n\n@paramsout = $r->paramsout; # gives you ARRAY of out parameters\n$paramout1 = $paramsout[0]; # gives you 'res2', same as ($r->paramsout)[0]\n$paramout2 = $paramsout[1]; # gives you 'res3', same as ($r->paramsout)[1]\n\nGenerally, if server returns \"return (1,2,3)\" you will get 1 as the\nresult and 2 and 3 as out parameters.\n\nIf the server returns \"return [1,2,3]\" you will get an ARRAY reference\nfrom \"result()\" and \"undef\" from \"paramsout()\".\n\nResults can be arbitrary complex: they can be an array references, they\ncan be objects, they can be anything and still be returned by \"result()\"\n. If only one parameter is returned, \"paramsout()\" will return \"undef\".\n\nFurthermore, if you have in your output parameters a parameter with the\nsame signature (name+type) as in the input parameters this parameter\nwill be mapped into your input automatically. For example:\n\nServer Code:\n\nsub mymethod {\nshift; # object/class reference\nmy $param1 = shift;\nmy $param2 = SOAP::Data->name('myparam' => shift() * 2);\nreturn $param1, $param2;\n}\n\nClient Code:\n\n$a = 10;\n$b = SOAP::Data->name('myparam' => 12);\n$result = $soap->mymethod($a, $b);\n\nAfter that, \"$result == 10 and $b->value == 24\"! Magic? Sort of.\n\nAutobinding gives it to you. That will work with objects also with one\ndifference: you do not need to worry about the name and the type of\nobject parameter. Consider the \"PingPong\" example\n(examples/My/PingPong.pm and examples/pingpong.pl):\n\nServer Code:\n\npackage My::PingPong;\n\nsub new {\nmy $self = shift;\nmy $class = ref($self) || $self;\nbless {num=>shift} => $class;\n}\n\nsub next {\nmy $self = shift;\n$self->{num}++;\n}\n\nClient Code:\n\nuse SOAP::Lite +autodispatch =>\nuri => 'urn:',\nproxy => 'http://localhost/';\n\nmy $p = My::PingPong->new(10); # $p->{num} is 10 now, real object returned\nprint $p->next, \"\\n\";          # $p->{num} is 11 now!, object autobinded\n\nSTATIC AND DYNAMIC SERVICE DEPLOYMENT\nLet us scrutinize the deployment process. When designing your SOAP\nserver you can consider two kind of deployment: static and dynamic. For\nboth, static and dynamic, you should specify \"MODULE\", \"MODULE::method\",\n\"method\" or \"PATH/\" when creating \"use\"ing the SOAP::Lite module. The\ndifference between static and dynamic deployment is that in case of\n'dynamic', any module which is not present will be loaded on demand. See\nthe \"SECURITY\" section for detailed description.\n\nWhen statically deploying a SOAP Server, you need to know all modules\nhandling SOAP requests before.\n\nDynamic deployment allows extending your SOAP Server's interface by just\ninstalling another module into the dispatchto path (see below).\n\nSTATIC DEPLOYMENT EXAMPLE\nuse SOAP::Transport::HTTP;\nuse My::Examples;           # module is preloaded\n\nSOAP::Transport::HTTP::CGI\n# deployed module should be present here or client will get\n# 'access denied'\n-> dispatchto('My::Examples')\n-> handle;\n\nFor static deployment you should specify the MODULE name directly.\n\nYou should also use static binding when you have several different\nclasses in one file and want to make them available for SOAP calls.\n\nDYNAMIC DEPLOYMENT EXAMPLE\nuse SOAP::Transport::HTTP;\n# name is unknown, module will be loaded on demand\n\nSOAP::Transport::HTTP::CGI\n# deployed module should be present here or client will get 'access denied'\n-> dispatchto('/Your/Path/To/Deployed/Modules', 'My::Examples')\n-> handle;\n\nFor dynamic deployment you can specify the name either directly (in that\ncase it will be \"require\"d without any restriction) or indirectly, with\na PATH. In that case, the ONLY path that will be available will be the\nPATH given to the dispatchto() method). For information how to handle\nthis situation see \"SECURITY\" section.\n\nSUMMARY\ndispatchto(\n# dynamic dispatch that allows access to ALL modules in specified directory\nPATH/TO/MODULES\n# 1. specifies directory\n# -- AND --\n# 2. gives access to ALL modules in this directory without limits\n\n# static dispatch that allows access to ALL methods in particular MODULE\nMODULE\n#  1. gives access to particular module (all available methods)\n#  PREREQUISITES:\n#    module should be loaded manually (for example with 'use ...')\n#    -- OR --\n#    you can still specify it in PATH/TO/MODULES\n\n# static dispatch that allows access to particular method ONLY\nMODULE::method\n# same as MODULE, but gives access to ONLY particular method,\n# so there is not much sense to use both MODULE and MODULE::method\n# for the same MODULE\n);\n\nIn addition to this \"SOAP::Lite\" also supports an experimental syntax\nthat allows you to bind a specific URL or SOAPAction to a CLASS/MODULE\nor object.\n\nFor example:\n\ndispatchwith({\nURI => MODULE,        # 'http://www.soaplite.com/' => 'My::Class',\nSOAPAction => MODULE, # 'http://www.soaplite.com/method' => 'Another::Class',\nURI => object,        # 'http://www.soaplite.com/obj' => My::Class->new,\n})\n\n\"URI\" is checked before \"SOAPAction\". You may use both the\n\"dispatchto()\" and \"dispatchwith()\" methods in the same server, but\nnote that \"dispatchwith()\" has a higher order of precedence.\n\"dispatchto()\" will be checked only after \"URI\" and \"SOAPAction\" has\nbeen checked.\n\nSee also: EXAMPLE APACHE::REGISTRY USAGE, \"SECURITY\"\n\nCOMPRESSION\n\"SOAP::Lite\" provides you option to enable transparent compression over\nthe wire. Compression can be enabled by specifying a threshold value (in\nthe form of kilobytes) for compression on both the client and server\nsides:\n\n*Note: Compression currently only works for HTTP based servers and\nclients.*\n\nClient Code\n\nprint SOAP::Lite\n->uri('http://localhost/My/Parameters')\n->proxy('http://localhost/', options => {compressthreshold => 10000})\n->echo(1 x 10000)\n->result;\n\nServer Code\n\nmy $server = SOAP::Transport::HTTP::CGI\n->dispatchto('My::Parameters')\n->options({compressthreshold => 10000})\n->handle;\n\nFor more information see COMPRESSION in HTTP::Transport.\n\n### SECURITY\n\nFor security reasons, the existing path for Perl modules (@INC) will be\ndisabled once you have chosen dynamic deployment and specified your own\n\"PATH/\". If you wish to access other modules in your included package\nyou have several options:\n\n1   Switch to static linking:\n\nuse MODULE;\n$server->dispatchto('MODULE');\n\nWhich can also be useful when you want to import something specific\nfrom the deployed modules:\n\nuse MODULE qw(importlist);\n\n2   Change \"use\" to \"require\". The path is only unavailable during the\ninitialization phase. It is available once more during execution.\nTherefore, if you utilize \"require\" somewhere in your package, it\nwill work.\n\n3   Wrap \"use\" in an \"eval\" block:\n\neval 'use MODULE qw(importlist)'; die if $@;\n\n4   Set your include path in your package and then specify \"use\". Don't\nforget to put @INC in a \"BEGIN{}\" block or it won't work. For\nexample,\n\nBEGIN { @INC = qw(mydirectory); use MODULE }\n\n### INTEROPERABILITY\n\n#### Microsoft .NET client with SOAP::Lite Server\n\nIn order to use a .NET client with a SOAP::Lite server, be sure you use\nfully qualified names for your return values. For example:\n\nreturn SOAP::Data->name('myname')\n->type('string')\n->uri($MYNAMESPACE)\n->value($output);\n\nIn addition see comment about default encoding in .NET Web Services\nbelow.\n\nSOAP::Lite client with a .NET server\nIf experiencing problems when using a SOAP::Lite client to call a .NET\nWeb service, it is recommended you check, or adhere to all of the\nfollowing recommendations:\n\nDeclare a proper soapAction in your call\nFor example, use \"onaction( sub {\n'http://www.myuri.com/WebService.aspx#someMethod'; } )\".\n\nDisable charset definition in Content-type header\nSome users have said that Microsoft .NET prefers the value of the\nContent-type header to be a mimetype exclusively, but SOAP::Lite\nspecifies a character set in addition to the mimetype. This results\nin an error similar to:\n\nServer found request content type to be 'text/xml; charset=utf-8',\nbut expected 'text/xml'\n\nTo turn off this behavior specify use the following code:\n\nuse SOAP::Lite;\n$SOAP::Constants::DONOTUSECHARSET = 1;\n# The rest of your code\n\nUse fully qualified name for method parameters\nFor example, the following code is preferred:\n\nSOAP::Data->name(Query  => 'biztalk')\n->uri('http://tempuri.org/')\n\nAs opposed to:\n\nSOAP::Data->name('Query'  => 'biztalk')\n\nPlace method in default namespace\nFor example, the following code is preferred:\n\nmy $method = SOAP::Data->name('add')\n->attr({xmlns => 'http://tempuri.org/'});\nmy @rc = $soap->call($method => @parms)->result;\n\nAs opposed to:\n\nmy @rc = $soap->call(add => @parms)->result;\n# -- OR --\nmy @rc = $soap->add(@parms)->result;\n\nDisable use of explicit namespace prefixes\nSome user's have reported that .NET will simply not parse messages\nthat use namespace prefixes on anything but SOAP elements\nthemselves. For example, the following XML would not be parsed:\n\n<SOAP-ENV:Envelope ...attributes skipped>\n<SOAP-ENV:Body>\n<namesp1:mymethod xmlns:namesp1=\"urn:MyURI\" />\n</SOAP-ENV:Body>\n</SOAP-ENV:Envelope>\n\nSOAP::Lite allows users to disable the use of explicit namespaces\nthrough the \"useprefix()\" method. For example, the following code:\n\n$som = SOAP::Lite->uri('urn:MyURI')\n->proxy($HOST)\n->useprefix(0)\n->myMethod();\n\nWill result in the following XML, which is more palatable by .NET:\n\n<SOAP-ENV:Envelope ...attributes skipped>\n<SOAP-ENV:Body>\n<mymethod xmlns=\"urn:MyURI\" />\n</SOAP-ENV:Body>\n</SOAP-ENV:Envelope>\n\nModify your .NET server, if possible\nStefan Pharies <stefanph@microsoft.com>:\n\nSOAP::Lite uses the SOAP encoding (section 5 of the soap 1.1 spec),\nand the default for .NET Web Services is to use a literal encoding.\nSo elements in the request are unqualified, but your service expects\nthem to be qualified. .Net Web Services has a way for you to change\nthe expected message format, which should allow you to get your\ninterop working. At the top of your class in the asmx, add this\nattribute (for Beta 1):\n\n[SoapService(Style=SoapServiceStyle.RPC)]\n\nAnother source said it might be this attribute (for Beta 2):\n\n[SoapRpcService]\n\nFull Web Service text may look like:\n\n<%@ WebService Language=\"C#\" Class=\"Test\" %>\nusing System;\nusing System.Web.Services;\nusing System.Xml.Serialization;\n\n[SoapService(Style=SoapServiceStyle.RPC)]\npublic class Test : WebService {\n[WebMethod]\npublic int add(int a, int b) {\nreturn a + b;\n}\n}\n\nAnother example from Kirill Gavrylyuk <kirillg@microsoft.com>:\n\n\"You can insert [SoapRpcService()] attribute either on your class or\non operation level\".\n\n<%@ WebService Language=CS class=\"DataType.StringTest\"%>\n\nnamespace DataType {\n\nusing System;\nusing System.Web.Services;\nusing System.Web.Services.Protocols;\nusing System.Web.Services.Description;\n\n[SoapRpcService()]\npublic class StringTest: WebService {\n[WebMethod]\n[SoapRpcMethod()]\npublic string RetString(string x) {\nreturn(x);\n}\n}\n}\n\nExample from Yann Christensen <yannc@microsoft.com>:\n\nusing System;\nusing System.Web.Services;\nusing System.Web.Services.Protocols;\n\nnamespace Currency {\n[WebService(Namespace=\"http://www.yourdomain.com/example\")]\n[SoapRpcService]\npublic class Exchange {\n[WebMethod]\npublic double getRate(String country, String country2) {\nreturn 122.69;\n}\n}\n}\n\nSpecial thanks goes to the following people for providing the above\ndescription and details on .NET interoperability issues:\n\nPetr Janata <petr.janata@i.cz>,\n\nStefan Pharies <stefanph@microsoft.com>,\n\nBrian Jepson <bjepson@jepstone.net>, and others\n\n### TROUBLESHOOTING\n\nSOAP::Lite serializes \"18373\" as an integer, but I want it to be a\nstring!\nSOAP::Lite guesses datatypes from the content provided, using a set\nof common-sense rules. These rules are not 100% reliable, though\nthey fit for most data.\n\nYou may force the type by passing a SOAP::Data object with a type\nspecified:\n\nmy $proxy = SOAP::Lite->proxy('http://www.example.org/soapservice');\nmy $som = $proxy->myMethod(\nSOAP::Data->name('foo')->value(12345)->type('string')\n);\n\nYou may also change the precedence of the type-guessing rules. Note\nthat this means fiddling with SOAP::Lite's internals - this may not\nwork as expected in future versions.\n\nThe example above forces everything to be encoded as string (this is\nbecause the string test is normally last and always returns true):\n\nmy @list = qw(-1 45 foo bar 3838);\nmy $proxy = SOAP::Lite->uri($uri)->proxy($proxyUrl);\nmy $lookup = $proxy->serializer->typelookup;\n$lookup->{string}->[0] = 0;\n$proxy->serializer->typelookup($lookup);\n$proxy->myMethod(\\@list);\n\nSee SOAP::Serializer for more details.\n\n\"+autodispatch\" doesn't work in Perl 5.8\nThere is a bug in Perl 5.8's \"UNIVERSAL::AUTOLOAD\" functionality\nthat prevents the \"+autodispatch\" functionality from working\nproperly. The workaround is to use \"dispatchfrom\" instead. Where\nyou might normally do something like this:\n\nuse Some::Module;\nuse SOAP::Lite +autodispatch =>\nuri => 'urn:Foo'\nproxy => 'http://...';\n\nYou would do something like this:\n\nuse SOAP::Lite dispatchfrom(Some::Module) =>\nuri => 'urn:Foo'\nproxy => 'http://...';\n\nProblems using SOAP::Lite's COM Interface\n\nCan't call method \"server\" on undefined value\nYou probably did not register Lite.dll using \"regsvr32 Lite.dll\"\n\nFailed to load PerlCtrl Runtime\nIt is likely that you have install Perl in two different\nlocations and the location of ActiveState's Perl is not the\nfirst instance of Perl specified in your PATH. To rectify,\nrename the directory in which the non-ActiveState Perl is\ninstalled, or be sure the path to ActiveState's Perl is\nspecified prior to any other instance of Perl in your PATH.\n\nDynamic libraries are not found\nIf you are using the Apache web server, and you are seeing something\nlike the following in your webserver log file:\n\nCan't load '/usr/local/lib/perl5/siteperl/.../XML/Parser/Expat/Expat.so'\nfor module XML::Parser::Expat: dynamic linker: /usr/local/bin/perl:\nlibexpat.so.0 is NEEDED, but object does not exist at\n/usr/local/lib/perl5/.../DynaLoader.pm line 200.\n\nThen try placing the following into your httpd.conf file and see if\nit fixes your problem.\n\n<IfModule modenv.c>\nPassEnv LDLIBRARYPATH\n</IfModule>\n\nSOAP client reports \"500 unexpected EOF before status line seen\nSee \"Apache is crashing with segfaults\"\n\nApache is crashing with segfaults\nUsing \"SOAP::Lite\" (or XML::Parser::Expat) in combination with\nmodperl causes random segmentation faults in httpd processes. To\nfix, try configuring Apache with the following:\n\nRULEEXPAT=no\n\nIf you are using Apache 1.3.20 and later, try configuring Apache\nwith the following option:\n\n./configure --disable-rule=EXPAT\n\nSee http://archive.covalent.net/modperl/2000/04/0185.xml for more\ndetails and lot of thanks to Robert Barta <rho@bigpond.net.au> for\nexplaining this weird behavior.\n\nIf this doesn't address the problem, you may wish to try\n\"-Uusemymalloc\", or a similar option in order to instruct Perl to\nuse the system's own \"malloc\".\n\nThanks to Tim Bunce <Tim.Bunce@pobox.com>.\n\nCGI scripts do not work under Microsoft Internet Information Server\n(IIS)\nCGI scripts may not work under IIS unless scripts use the \".pl\"\nextension, opposed to \".cgi\".\n\nJava SAX parser unable to parse message composed by SOAP::Lite\nIn some cases SOAP messages created by \"SOAP::Lite\" may not be\nparsed properly by a SAX2/Java XML parser. This is due to a known\nbug in \"org.xml.sax.helpers.ParserAdapter\". This bug manifests\nitself when an attribute in an XML element occurs prior to the XML\nnamespace declaration on which it depends. However, according to the\nXML specification, the order of these attributes is not significant.\n\nhttp://www.megginson.com/SAX/index.html\n\nThanks to Steve Alpert (SteveAlpert@idx.com) for pointing on it.\n\n### PERFORMANCE\n\nProcessing of XML encoded fragments\n\"SOAP::Lite\" is based on XML::Parser which is basically wrapper\naround James Clark's expat parser. Expat's behavior for parsing XML\nencoded string can affect processing messages that have lot of\nencoded entities, like XML fragments, encoded as strings. Providing\nlow-level details, parser will call char() callback for every\nportion of processed stream, but individually for every processed\nentity or newline. It can lead to lot of calls and additional memory\nmanager expenses even for small messages. By contrast, XML messages\nwhich are encoded as base64Binary, don't have this problem and\ndifference in processing time can be significant. For XML encoded\nstring that has about 20 lines and 30 tags, number of call could be\nabout 100 instead of one for the same string encoded as\nbase64Binary.\n\nSince it is parser's feature there is NO fix for this behavior (let\nme know if you find one), especially because you need to parse\nmessage you already got (and you cannot control content of this\nmessage), however, if your are in charge for both ends of processing\nyou can switch encoding to base64 on sender's side. It will\ndefinitely work with SOAP::Lite and it may work with other\ntoolkits/implementations also, but obviously I cannot guarantee\nthat.\n\nIf you want to encode specific string as base64, just do\n\"SOAP::Data->type(base64 => $string)\" either on client or on server\nside. If you want change behavior for specific instance of\nSOAP::Lite, you may subclass \"SOAP::Serializer\", override\n\"asstring()\" method that is responsible for string encoding (take a\nlook into \"asbase64Binary()\") and specify new serializer class for\nyour SOAP::Lite object with:\n\nmy $soap = new SOAP::Lite\nserializer => My::Serializer->new,\n..... other parameters\n\nor on server side:\n\nmy $server = new SOAP::Transport::HTTP::Daemon # or any other server\nserializer => My::Serializer->new,\n..... other parameters\n\nIf you want to change this behavior for all instances of SOAP::Lite,\njust substitute \"asstring()\" method with \"asbase64Binary()\"\nsomewhere in your code after \"use SOAP::Lite\" and before actual\nprocessing/sending:\n\n*SOAP::Serializer::asstring = \\&SOAP::XMLSchema2001::Serializer::asbase64Binary;\n\nBe warned that last two methods will affect all strings and convert\nthem into base64 encoded. It doesn't make any difference for\nSOAP::Lite, but it may make a difference for other toolkits.\n\n### BUGS AND LIMITATIONS\n\n*   No support for multidimensional, partially transmitted and sparse\narrays (however arrays of arrays are supported, as well as any other\ndata structures, and you can add your own implementation with\nSOAP::Data).\n\n*   Limited support for WSDL schema.\n\n*   XML::Parser::Lite relies on Unicode support in Perl and doesn't do\nentity decoding.\n\n*   Limited support for mustUnderstand and Actor attributes.\n\n### PLATFORM SPECIFICS\n\nMacOS\nInformation about XML::Parser for MacPerl could be found here:\n\nhttp://bumppo.net/lists/macperl-modules/1999/07/msg00047.html\n\nCompiled XML::Parser for MacOS could be found here:\n\nhttp://www.perl.com/CPAN-local/authors/id/A/AS/ASANDSTRM/XML-Parser-\n2.27-bin-1-MacOS.tgz\n\n### RELATED MODULES\n\n#### Transport Modules\n\nSOAP::Lite allows one to add support for additional transport protocols,\nor server handlers, via separate modules implementing the\nSOAP::Transport::* interface. The following modules are available from\nCPAN:\n\n*   SOAP-Transport-HTTP-Nginx\n\nSOAP::Transport::HTTP::Nginx provides a transport module for nginx\n(<http://nginx.net/>)\n\n### AVAILABILITY\n\nYou can download the latest version SOAP::Lite for Unix or SOAP::Lite\nfor Win32 from the following sources:\n\n* CPAN:                http://search.cpan.org/search?dist=SOAP-Lite\n\nYou are welcome to send e-mail to the maintainers of SOAP::Lite with\nyour comments, suggestions, bug reports and complaints.\n\n### ACKNOWLEDGEMENTS\n\nSpecial thanks to Randy J. Ray, author of *Programming Web Services with\nPerl*, who has contributed greatly to the documentation effort of\nSOAP::Lite.\n\nSpecial thanks to O'Reilly publishing which has graciously allowed\nSOAP::Lite to republish and redistribute the SOAP::Lite reference manual\nfound in Appendix B of *Programming Web Services with Perl*.\n\nAnd special gratitude to all the developers who have contributed\npatches, ideas, time, energy, and help in a million different forms to\nthe development of this software.\n\n### HACKING\n\nLatest development takes place on GitHub.com. Come on by and fork it.\n\ngit@github.com:redhotpenguin/perl-soaplite.git\n\nAlso see the HACKING file.\n\nActively recruiting maintainers for this module. Come and get it on!\n\n### REPORTING BUGS\n\nPlease use rt.cpan.org or github to report bugs. Pull requests are\npreferred.\n\n### COPYRIGHT\n\nCopyright (C) 2000-2007 Paul Kulchenko. All rights reserved.\n\nCopyright (C) 2007-2008 Martin Kutter\n\nCopyright (C) 2013 Fred Moyer\n\n### LICENSE\n\nThis library is free software; you can redistribute it and/or modify it\nunder the same terms as Perl itself.\n\nThis text and all associated documentation for this library is made\navailable under the Creative Commons Attribution-NoDerivs 2.0 license.\nhttp://creativecommons.org/licenses/by-nd/2.0/\n\n### AUTHORS\n\nPaul Kulchenko (paulclinger@yahoo.com)\n\nRandy J. Ray (rjray@blackperl.com)\n\nByrne Reese (byrne@majordojo.com)\n\nMartin Kutter (martin.kutter@fen-net.de)\n\nFred Moyer (fred@redhotpenguin.com)\n\n"
        }
    ],
    "structuredContent": {
        "command": "SOAP::Lite",
        "section": "",
        "mode": "perldoc",
        "summary": "SOAP::Lite - Perl's Web Services Toolkit",
        "synopsis": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "PERL VERSION WARNING",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "OVERVIEW OF CLASSES AND PACKAGES",
                "lines": 70,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 416,
                "subsections": []
            },
            {
                "name": "WRITING A SOAP CLIENT",
                "lines": 47,
                "subsections": [
                    {
                        "name": "Example implementations",
                        "lines": 306
                    },
                    {
                        "name": "Differences between the implementations",
                        "lines": 22
                    }
                ]
            },
            {
                "name": "WRITING A SOAP SERVER",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "FEATURES",
                "lines": 355,
                "subsections": []
            },
            {
                "name": "SECURITY",
                "lines": 30,
                "subsections": []
            },
            {
                "name": "INTEROPERABILITY",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Microsoft .NET client with SOAP::Lite Server",
                        "lines": 167
                    }
                ]
            },
            {
                "name": "TROUBLESHOOTING",
                "lines": 118,
                "subsections": []
            },
            {
                "name": "PERFORMANCE",
                "lines": 53,
                "subsections": []
            },
            {
                "name": "BUGS AND LIMITATIONS",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "PLATFORM SPECIFICS",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "RELATED MODULES",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Transport Modules",
                        "lines": 10
                    }
                ]
            },
            {
                "name": "AVAILABILITY",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "ACKNOWLEDGEMENTS",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "HACKING",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 10,
                "subsections": []
            }
        ]
    }
}