SOAP API & Postman

I have some recent experience with REST API's but recently found out the APIs I am needing to use for a project are SOAP not REST. This is very new to me. The developer of the APIs put a postman collection together and sent them over. I can execute the APIs in postman but I need to be able to run the APIs outside of postman and in other environments like Watson.

I'm having problems finding informative material on how to use SOAP APIs in R.
If anyone has any advice or suggestions I would appreciate it.
Below is a JSON file extract from the Postman application.

Am I able to run SOAP using httr like I would if it were REST?

"info": {
	"_postman_id": "39505a21-b11a-43ff-af13-ff163f717df6",
	"name": "Super BizUpdate",
	"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
	{
		"name": "Get Orphans - Prod",
		"request": {
			"auth": {
				"type": "basic",
				"basic": [
					{
						"key": "password",
						"value": "password_masked",
						"type": "string"
					},
					{
						"key": "username",
						"value": "username_masked",
						"type": "string"
					},
					{
						"key": "saveHelperData",
						"type": "any"
					},
					{
						"key": "showPassword",
						"value": false,
						"type": "boolean"
					}
				]
			},
			"method": "POST",
			"header": [
				{
					"key": "Content-Type",
					"value": "application/soap+xml"
				}
			],
			"body": {
				"mode": "raw",
				"raw": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns1=\"http://www.company_name.com/bizconnect/SBU\">\n<SOAP-ENV:Body>\n    <ns1:GetSBUApplicationData>\n        <ns1:Subscriber>\n            <ns1:SubCode>123456</ns1:SubCode>\n        </ns1:Subscriber>\n        <ns1:UserID>INTUSER1A</ns1:UserID>\n        <ns1:ReferenceID>A</ns1:ReferenceID>\n        <ns1:ResponseVersion>010</ns1:ResponseVersion>\n        <ns1:Application>\n            <ns1:Id>G020H</ns1:Id>\n            <ns1:Name/>\n            <ns1:Key>\n                <ns1:Field>\n                    <ns1:Id>00030001</ns1:Id>\n                    <ns1:Name/>\n                    <ns1:Value>0900979490</ns1:Value>\n                </ns1:Field>\n                <ns1:Field>\n                    <ns1:Id>00920018</ns1:Id>\n                    <ns1:Name/>\n                    <ns1:Value>Home Depot Inc</ns1:Value>\n                </ns1:Field>\n                <ns1:Field>\n                    <ns1:Id>00900081</ns1:Id>\n                    <ns1:Name/>\n                    <ns1:Value>N</ns1:Value>\n                </ns1:Field>\n                <ns1:Field>\n                    <ns1:Id>00920033</ns1:Id>\n                    <ns1:Name/>\n                    <ns1:Value>GA</ns1:Value>\n                </ns1:Field>\n                <ns1:Field>\n                    <ns1:Id>00920121</ns1:Id>\n                    <ns1:Name/>\n                    <ns1:Value>USA</ns1:Value>\n                </ns1:Field>\n                <ns1:Criteria>\n                    <ns1:Field>\n                        <ns1:Id>00920109</ns1:Id>\n                        <ns1:Name/>\n                        <ns1:Value>1</ns1:Value>\n                    </ns1:Field>\n                    <ns1:ComparisonOperator>GE</ns1:ComparisonOperator>\n                    <ns1:Value/>\n                    <ns1:LogicalOperator>AND</ns1:LogicalOperator>\n                </ns1:Criteria>\n                <ns1:Criteria>\n                    <ns1:Field>\n                        <ns1:Id>00920110</ns1:Id>\n                        <ns1:Name/>\n                        <ns1:Value>5</ns1:Value>\n                    </ns1:Field>\n                    <ns1:ComparisonOperator>LE</ns1:ComparisonOperator>\n                    <ns1:Value/>\n                    <ns1:LogicalOperator>AND</ns1:LogicalOperator>\n                </ns1:Criteria>\n            </ns1:Key>\n        </ns1:Application>\n    </ns1:GetSBUApplicationData>\n</SOAP-ENV:Body>\n</SOAP-ENV:Envelope>"
			},
			"url": {
				"raw": "https://ss1.company_name.com/bizconnect/SBU/service",
				"protocol": "https",
				"host": [
					"ss1",
					"company_name",
					"com"
				],
				"path": [
					"bizconnect",
					"SBU",
					"service"
				]
			}
		},
		"response": []
	}

I think this is possible, but you would have to create the body yourself as a xml. (xml2 :package: could help).

There is also curl :package: at low level that would definitely work I think.

Also, as alternative wrapper to curl there is the crul :package: that also should work.

I think SOAP API your describe is just a POST using http, with the body as XML.

Sorry but you'll have to try, I don't have any example. Look a POST option in httr to provide a raw body.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.