How can I send SOAP XML via Curl and PHP?

Thanx a lot buddy, your code has worked for me. Here is the code: $soap_do = curl_init(); curl_setopt($soap_do, CURLOPT_URL, $url ); curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($soap_do, CURLOPT_TIMEOUT, 10); curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true ); curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($soap_do, CURLOPT_POST, true ); curl_setopt($soap_do, CURLOPT_POSTFIELDS, $post_string); curl_setopt($soap_do, CURLOPT_HTTPHEADER, array(‘Content-Type: text/xml; charset=utf-8’, ‘Content-Length: ‘.strlen($post_string) )); curl_setopt($soap_do, CURLOPT_USERPWD, $user … Read more

How can I use an HTTP proxy for a JAX-WS request without setting a system-wide property?

I recommend using a custom ProxySelector. I had the same problem and it works great and is super flexible. It’s simple too. Here’s my CustomProxySelector: import org.hibernate.validator.util.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.*; import java.util.ArrayList; import java.util.List; import java.util.logging.Logger; /** * So the way a ProxySelector works is that … Read more

How to do a SOAP wsdl web services call from the command line

It’s a standard, ordinary SOAP web service. SSH has nothing to do here. I just called it with curl (one-liner): $ curl -X POST -H “Content-Type: text/xml” \ -H ‘SOAPAction: “http://api.eyeblaster.com/IAuthenticationService/ClientLogin”‘ \ –data-binary @request.xml \ https://sandbox.mediamind.com/Eyeblaster.MediaMind.API/V2/AuthenticationService.svc Where request.xml file has the following contents: <soapenv:Envelope xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:api=”http://api.eyeblaster.com/”> <soapenv:Header/> <soapenv:Body> <api:ClientLogin> <api:username>user</api:username> <api:password>password</api:password> <api:applicationKey>key</api:applicationKey> </api:ClientLogin> </soapenv:Body> </soapenv:Envelope> … Read more

Sending SOAP request using Python Requests

It is indeed possible. Here is an example calling the Weather SOAP Service using plain requests lib: import requests url=”http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL” #headers = {‘content-type’: ‘application/soap+xml’} headers = {‘content-type’: ‘text/xml’} body = “””<?xml version=”1.0″ encoding=”UTF-8″?> <SOAP-ENV:Envelope xmlns:ns0=”http://ws.cdyne.com/WeatherWS/” xmlns:ns1=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:SOAP-ENV=”http://schemas.xmlsoap.org/soap/envelope/”> <SOAP-ENV:Header/> <ns1:Body><ns0:GetWeatherInformation/></ns1:Body> </SOAP-ENV:Envelope>””” response = requests.post(url,data=body,headers=headers) print response.content Some notes: The headers are important. Most SOAP requests … Read more

Could not handle mustUnderstand headers: {http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security. Returning fault

You can try below config that would solve the issue. @Bean public Wss4jSecurityInterceptor securityInterceptor() { Wss4jSecurityInterceptor security = new Wss4jSecurityInterceptor(); security.setValidationActions(“NoSecurity”); security.setValidateRequest(false); security.setValidateResponse(true); return security; } @Override public void addInterceptors(List<EndpointInterceptor> interceptors) { interceptors.add(securityInterceptor()); }

Does WCF support WS-Security with SOAP 1.1?

In order to use WS-Addressing (wsHttpBinding), but with SOAP 1.1 (SOAP 1.2 being the default), you need to define a custom WCF binding (e.g. in config) and use that: <bindings> <customBinding> <binding name=”WsHttpSoap11″ > <textMessageEncoding messageVersion=”Soap11WSAddressing10″ /> <httpTransport/> </binding> </customBinding> </bindings> and then in your endpoint definition, use: <endpoint name=”WsSoap11″ address=”…..” binding=”customBinding” bindingConfiguration=”wsHttpSoap11″ contract=”…..” /> … Read more