How to parse SOAP XML?

One of the simplest ways to handle namespace prefixes is simply to strip them from the XML response before passing it through to simplexml such as below: $your_xml_response=”<Your XML here>”; $clean_xml = str_ireplace([‘SOAP-ENV:’, ‘SOAP:’], ”, $your_xml_response); $xml = simplexml_load_string($clean_xml); This would return the following: SimpleXMLElement Object ( [Body] => SimpleXMLElement Object ( [PaymentNotification] => SimpleXMLElement … Read more

REST API – why use PUT DELETE POST GET?

The idea of REpresentational State Transfer is not about accessing data in the simplest way possible. You suggested using post requests to access JSON, which is a perfectly valid way to access/manipulate data. REST is a methodology for meaningful access of data. When you see a request in REST, it should immediately be apparant what … Read more

SOAP request in PHP with CURL

Tested and working! with https, user & password <?php //Data, connection, auth $dataFromTheForm = $_POST[‘fieldName’]; // request data from the form $soapUrl = “https://connecting.website.com/soap.asmx?op=DoSomething”; // asmx URL of WSDL $soapUser = “username”; // username $soapPassword = “password”; // password // xml post structure $xml_post_string = ‘<?xml version=”1.0″ encoding=”utf-8″?> <soap:Envelope xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:soap=”http://schemas.xmlsoap.org/soap/envelope/”> <soap:Body> <GetItemPrice xmlns=”http://connecting.website.com/WSDL_Service”> … Read more

Working Soap client example

To implement simple SOAP clients in Java, you can use the SAAJ framework (it is shipped with JSE 1.6 and above, but removed again in Java 11): SOAP with Attachments API for Java (SAAJ) is mainly used for dealing directly with SOAP Request/Response messages which happens behind the scenes in any Web Service API. It … Read more

How to make a PHP SOAP call using the SoapClient class

This is what you need to do. I tried to recreate the situation… For this example, I created a .NET sample WebService (WS) with a WebMethod called Function1 expecting the following params: Function1(Contact Contact, string description, int amount) Where Contact is just a model that has getters and setters for id and name like in … Read more

What SOAP client libraries exist for Python, and where is the documentation for them? [closed]

Update (2016): If you only need SOAP client, there is well maintained library called zeep. It supports both Python 2 and 3 🙂 Update: Additionally to what is mentioned above, I will refer to Python WebServices page which is always up-to-date with all actively maintained and recommended modules to SOAP and all other webservice types. … Read more

SAML Assertion in a XML using C#

try following : using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.Xml; using System.Text; using System.Threading.Tasks; using System.Xml; namespace Certificate { class Program { const string FILENAME = @”c:\temp\test.xml”; static void Main(string[] args) { XmlDocument doc = new XmlDocument(); CreateSoap(doc); XmlElement assertion = (XmlElement)(doc.GetElementsByTagName(“saml2:Assertion”)[0]); XmlElement security = (XmlElement)(doc.GetElementsByTagName(“wsse:Security”)[0]); //added 10-20-17 … Read more

SOAP vs REST (differences)

Unfortunately, there are a lot of misinformation and misconceptions around REST. Not only your question and the answer by @cmd reflect those, but most of the questions and answers related to the subject on Stack Overflow. SOAP and REST can’t be compared directly, since the first is a protocol (or at least tries to be) … Read more