Do you know of any free SOAP webservices (for tutorial purpose) [closed]
You can look at this post Public free web services for testing soap client
You can look at this post Public free web services for testing soap client
The first part of the answer by @reta works for me. These are the relevant dependencies from my pom (Java 10): <dependency> <groupId>javax.xml.ws</groupId> <artifactId>jaxws-api</artifactId> <version>2.3.1</version> </dependency> <dependency> <groupId>com.sun.xml.ws</groupId> <artifactId>rt</artifactId> <version>2.3.1</version> </dependency>
Overview SOAP is a messaging protocol and in a nutshell is just another XML language. Its purpose is the data exchange over networks. Its concern is the encapsulation of these data and the rules for transmitting and receiving them. HTTP is an application protocol and SOAP messages are placed as the HTTP payload. Although there … Read more
According to the CXF FAQ: Are JAX-WS client proxies thread safe? Official JAX-WS answer: No. According to the JAX-WS spec, the client proxies are NOT thread safe. To write portable code, you should treat them as non-thread safe and synchronize access or use a pool of instances or similar. CXF answer: CXF proxies are thread … Read more
Have you tried overriding HttpEntityEnclosingRequestBase as follows: import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; import java.net.URI; import org.apache.http.annotation.NotThreadSafe; @NotThreadSafe class HttpDeleteWithBody extends HttpEntityEnclosingRequestBase { public static final String METHOD_NAME = “DELETE”; public String getMethod() { return METHOD_NAME; } public HttpDeleteWithBody(final String uri) { super(); setURI(URI.create(uri)); } public HttpDeleteWithBody(final URI uri) { super(); setURI(uri); } public HttpDeleteWithBody() { super(); } } … Read more
For anyone suffering from the same problem; I’ve found a solution for consuming the web service as a Service Reference (WCF). The BasicHttpBinding.MessageEncoding property needs setting to “Mtom”. Here’s a snippet of the required config setting: <configuration> <system.serviceModel> <bindings> <basicHttpBinding> <binding messageEncoding=”Mtom”> </binding> </basicHttpBinding> </bindings> </system.serviceModel> </configuration> Edit: If you are having the same issue … Read more
This error is probably related to a byte order mark (BOM) prior to the actual XML content. You need to parse the returned String and discard the BOM, so SAXParser can process the document correctly. You will find a possible solution here.
You can achieve that using the BindingProvider interface. JAX-WS custom endpoint /** * The following snippets shows how to set a custom endpoint for a JAX-WS generated WebClient on runtime */ // Get the service and the port SampleService service = new SampleService(); Sample port = service.getESamplePort(); // Use the BindingProvider’s context to set the … Read more
What is the best approach to do this JAVA? I would personally NOT use Axis 2, even for client side development only. Here is why I stay away from it: I don’t like its architecture and hate its counter productive deployment model. I find it to be low quality project. I don’t like its performances … Read more
Java 7 defaults to TLS 1.0, which can cause this error when that protocol is not accepted. I ran into this problem with a Tomcat application and a server that would not accept TLS 1.0 connections any longer. I added -Dhttps.protocols=TLSv1.1,TLSv1.2 to the Java options and that fixed it. (Tomcat was running Java 7.)