How can I use async/await to call a webservice?

Assuming that loginAsync returns void, and loginCmpleted event fires when login is done, this is called the Event-based Asynchronous Pattern, or EAP. To convert EAP to await/async, consult Tasks and the Event-based Asynchronous Pattern. In particular, you’ll want to make use of the TaskCompletionSource to convert the event-based model to a Task-based model. Once you’ve … Read more

Migration JAXWS application from Java 8 to Java 11

Note sure about sprint boot, but to get JAXWS working in Java 11, I used <profiles> <!– add back the jaxws SOAP dependendies which were removed in JDK11 –> <profile> <id>jdk11</id> <activation> <jdk>[11,)</jdk> </activation> <!– tested working with OpenJDK 11.0.8 –> <dependencies> <dependency> <groupId>com.sun.xml.ws</groupId> <artifactId>jaxws-rt</artifactId> <version>2.3.3</version> <type>pom</type> </dependency> <dependency> <groupId>com.sun.xml.ws</groupId> <artifactId>rt</artifactId> <version>2.3.3</version> </dependency> </dependencies> </profile> … Read more

Capturing SOAP requests to an ASP.NET ASMX web service

You can also implement by placing the code in Global.asax.cs protected void Application_BeginRequest(object sender, EventArgs e) { // Create byte array to hold request bytes byte[] inputStream = new byte[HttpContext.Current.Request.ContentLength]; // Read entire request inputstream HttpContext.Current.Request.InputStream.Read(inputStream, 0, inputStream.Length); //Set stream back to beginning HttpContext.Current.Request.InputStream.Position = 0; //Get XML request string requestString = ASCIIEncoding.ASCII.GetString(inputStream); } I … Read more

How can the error ‘Client found response content type of ‘text/html’.. be interpreted

This is happening because there is an unhandled exception in your Web service, and the .NET runtime is spitting out its HTML yellow screen of death server error/exception dump page, instead of XML. Since the consumer of your Web service was expecting a text/xml header and instead got text/html, it throws that error. You should … Read more

Why does a SOAP message have to be sent over HTTP?

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