{"id":19601262,"url":"https://github.com/refinitiv/libvmod-soap","last_synced_at":"2025-08-13T19:17:36.415Z","repository":{"id":39801334,"uuid":"80854201","full_name":"Refinitiv/libvmod-soap","owner":"Refinitiv","description":"VMOD Varnish SOAP module. Read SOAP messages in HTTP requests body and expose fields in VCL.","archived":false,"fork":false,"pushed_at":"2023-06-29T14:06:22.000Z","size":133,"stargazers_count":2,"open_issues_count":3,"forks_count":5,"subscribers_count":98,"default_branch":"master","last_synced_at":"2025-04-05T01:32:24.317Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Refinitiv.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-03T17:54:32.000Z","updated_at":"2023-12-28T09:18:19.000Z","dependencies_parsed_at":"2022-07-07T21:24:32.321Z","dependency_job_id":null,"html_url":"https://github.com/Refinitiv/libvmod-soap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Refinitiv%2Flibvmod-soap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Refinitiv%2Flibvmod-soap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Refinitiv%2Flibvmod-soap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Refinitiv%2Flibvmod-soap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Refinitiv","download_url":"https://codeload.github.com/Refinitiv/libvmod-soap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251171752,"owners_count":21547155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T09:17:45.730Z","updated_at":"2025-04-27T16:32:32.625Z","avatar_url":"https://github.com/Refinitiv.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"libvmod-soap [![Build Status](https://travis-ci.org/Refinitiv/libvmod-soap.svg?branch=master)](https://travis-ci.org/Refinitiv/libvmod-soap)\n=============\n\n\nSOAP VMOD compatible with Varnish 4 and 5.\n\n``libvmod-soap`` reads SOAP XML basic elements in HTTP request body (by using ``action``, ``uri``, and/or  ``xpath``). It allows users to use VCL with these SOAP values.\nThe ``action`` is the application-specific operation. It is defined as the first element in the ``\u003cBody\u003e`` Node.\n\nUsage and Examples\n=============\nFor a given SOAP XML message stored in Request's body :\n```xml\nPOST /webservice HTTP/1.1\nHost: soapservices.com\nContent-Type: text/xml; charset=utf-8\n\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cEnvelope xmlns=\"http://schemas.xmlsoap.org/soap/envelope/\"\u003e\u003cBody\u003e\n\u003cauth:Login xmlns:auth=\"http://your/namespace/uri/auth\"\u003e\n    \u003cauth:Username\u003eJohnDoe\u003c/auth:Username\u003e\n    \u003cauth:Password\u003efoobar\u003c/auth:Password\u003e\n\u003c/auth:Login\u003e\n\u003c/Body\u003e\u003c/Envelope\u003e}\n```\n\nSelect backend accordingly to the value of SOAP action:\n```vcl\nimport soap;\nsub vcl_recv {\n    if(soap.action() == \"Login\") {\n        set req.backend_hint = soap_login;\n    }\n}\n```\n\nVerify action namespace:\n```vcl\nimport soap;\nsub vcl_recv {\n    if(soap.action_namespace() !~ \"^http://your/namespace/uri/\") {\n        return (soap.synth(400, \"Bad SOAP namespace\"));\n    }\n}\n```\n\nSearch XPath values and put it into HTTP headers\n```vcl\nimport soap;\nsub vcl_init {\n        soap.add_namespace(\"a\", \"http://your/namespace/uri/auth\");\n}\nsub vcl_recv {\n        set req.http.user-id = soap.xpath_body(\"a:Login/a:User\");\n        set req.http.user-pwd = soap.xpath_body(\"a:Login/a:Password\");\n}\n```\n\nLooking for more ? See other examples on https://github.com/Refinitiv/libvmod-soap/tree/master/src/tests. \n\nVMOD Interface\n=============\n\n```\nis_valid()\n```\nReturns TRUE if the request body is a valid SOAP message.\n\n```\naction()\n```\nReturns name of SOAP body's action\n\n```\naction_namespace()\n```\nReturns namespace of SOAP body's action\n\n```\nadd_namespace(prefix, uri)\n```\nAdd namespace \"prefix/uri\" into known namespaces.\nSee also `xpath_header` and `xpath_body`.\n\n```\nxpath_header(xpath_pattern):\n```\nReturns xpath value in SOAP Header.\nIt uses the namespace table (see `add_namespace`).\n\n```\nxpath_body(xpath_pattern)\n```\nReturns xpath value in SOAP Body.\nIt uses the namespace table (see `add_namespace`).\n\n\n```\nVOID synthetic(faultcode, faultmessage)\n```\nCreates a SOAP synthetic response's body containing SOAP FaultCode and \nFaultMessage. Note that FaultMessage contains any internal errors found.\nFormat of the response depends of the SOAP version of the request (either 1.1 or 1.2).\n\n\nDevelopment\n=============\n\nIf you have installed Varnish to a non-standard directory, call\n``autogen.sh`` and ``configure`` with ``PKG_CONFIG_PATH`` pointing to\nthe appropriate path. For example, when varnishd configure was called\nwith ``--prefix=$PREFIX``, use\n\n```shell\nexport PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig\n```\n\n\nCopyright\n=============\nThis document is licensed under BSD-2-Clause license. See LICENSE for details.\n\nThe code was opened by (c) Refinitiv (previously Thomson Reuters).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefinitiv%2Flibvmod-soap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frefinitiv%2Flibvmod-soap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefinitiv%2Flibvmod-soap/lists"}