SYS-CON MEDIA Authors: Elizabeth White, Zakia Bouachraoui, Liz McMillan, Janakiram MSV, Carmen Gonzalez

Related Topics: Microsoft Cloud, Java IoT

Microsoft Cloud: Article

Java & .NET: SOAP Over JMS Interoperability

Exposing a Java Web Service via JMS using Apache Axis 1.4 and consuming it from both Java and .NET clients

Next, we attach the SOAP as a byte array to a message and send it to the queue/topic.

      IBytesMessage message = session.CreateBytesMessage();
      message.Content = bytBody;
      //Give the address of our temporary queue
      // so the service knows where to send the response
      message.NMSReplyTo = queue;
      using (IMessageProducer producer = session.CreateProducer())
      { NmsDestinationAccessor destinationResolver = new NmsDestinationAccessor();
      IDestination destination = destinationResolver.ResolveDestinationName(session, _queueName);
      producer.Send(destination, message);
     }

Now we wait for a response. We set a timeout (as a TimeSpan). Here it's a fixed value of 10 seconds for illustration, but it could easily come from a config file or passed as a property in the ActiveMqWebRequestCreate.

IBytesMessage response = (IBytesMessage)
consumer.Receive(
TimeSpan.FromSeconds(10))
as IBytesMessage;
stream = new MemoryStream();
stream.Write(response.Content, 0, response.Content.Length);

    } } }
    catch (NMSException e)
    { throw (e); }
    finally
    { m_RequestStream.InternalClose(); }

    ActiveMqQueueWebResponse resp = new ActiveMqQueueWebResponse();

Here we set the stream to our own.

    resp.SetDownloadStream(stream);
    return resp;
}

Our ActiveMqWebResponse class inherits System.Net.WebResponse and does little more than provide a setter and override the getter on the response stream, since the stream in the built-in WebResponse is read-only.

public class ActiveMqQueueWebResponse : WebResponse
{
    private Stream m_ResponseStream;
    private long m_lngContentLength;
    ...
    internal void SetDownloadStream(Stream vobjResponseStream)
    { m_ResponseStream = vobjResponseStream;
       m_ResponseStream.Position = 0; // Rewind the stream
       m_lngContentLength = m_ResponseStream.Length;
    }

    public override Stream GetResponseStream()
    { return m_ResponseStream;
} }

ActiveMqWebRequestCreate
ActiveMqWebRequestCreate is a class that is used to create instances of our objects instead of the built-in ones for a particular URI prefix. We'll see how this is used in the client application.

public class ActiveMqQueueWebRequestCreate : IWebRequestCreate
{

This has the same properties that are on the ActiveMqWebRequest so it can set them when it instantiates the requests.

    ...
    public WebRequest Create(System.Uri uri)
    { ActiveMqQueueWebRequest request = new ActiveMqQueueWebRequest(
uri, _queueAddress, _queueName, _username, _password);
       return request;
} }


More Stories By Stanimir Stanev

Stanimir Stanev is a senior consultant at MomentumSI's Enterprise Architecture Solutions practice. He has many years of experience focusing on providing enterprise architecture and strategy expertise to companies looking to migrate to or maximize the advantages of SOA principles.

More Stories By Rob Bartlett

Rob Bartlett is a senior consultant at MomentumSI's Software Development Solutions practice. He has over a decade of experience in technical roles, guiding major corporations in the design, implementation, and integration of business solutions.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Latest Stories
Platform-as-a-Service (PaaS) is a technology designed to make DevOps easier and allow developers to focus on application development. The PaaS takes care of provisioning, scaling, HA, and other cloud management aspects. Apache Stratos is a PaaS codebase developed in Apache and designed to create a highly productive developer environment while also supporting powerful deployment options. Integration with the Docker platform, CoreOS Linux distribution, and Kubernetes container management system ...
Because Linkerd is a transparent proxy that runs alongside your application, there are no code changes required. It even comes with Prometheus to store the metrics for you and pre-built Grafana dashboards to show exactly what is important for your services - success rate, latency, and throughput. In this session, we'll explain what Linkerd provides for you, demo the installation of Linkerd on Kubernetes and debug a real world problem. We will also dig into what functionality you can build on ...
In a recent survey, Sumo Logic surveyed 1,500 customers who employ cloud services such as Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP). According to the survey, a quarter of the respondents have already deployed Docker containers and nearly as many (23 percent) are employing the AWS Lambda serverless computing framework. It's clear: serverless is here to stay. The adoption does come with some needed changes, within both application development and operations. Th...
After years of investments and acquisitions, CloudBlue was created with the goal of building the world's only hyperscale digital platform with an increasingly infinite ecosystem and proven go-to-market services. The result? An unmatched platform that helps customers streamline cloud operations, save time and money, and revolutionize their businesses overnight. Today, the platform operates in more than 45 countries and powers more than 200 of the world's largest cloud marketplaces, managing mo...
The standardization of container runtimes and images has sparked the creation of an almost overwhelming number of new open source projects that build on and otherwise work with these specifications. Of course, there's Kubernetes, which orchestrates and manages collections of containers. It was one of the first and best-known examples of projects that make containers truly useful for production use. However, more recently, the container ecosystem has truly exploded. A service mesh like Istio a...
Containerized software is riding a wave of growth, according to latest RightScale survey. At Sematext we see this growth trend via our Docker monitoring adoption and via Sematext Docker Agent popularity on Docker Hub, where it crossed 1M+ pulls line. This rapid rise of containers now makes Docker the top DevOps tool among those included in RightScale survey. Overall Docker adoption surged to 35 percent, while Kubernetes adoption doubled, going from 7% in 2016 to 14% percent.
Technology has changed tremendously in the last 20 years. From onion architectures to APIs to microservices to cloud and containers, the technology artifacts shipped by teams has changed. And that's not all - roles have changed too. Functional silos have been replaced by cross-functional teams, the skill sets people need to have has been redefined and the tools and approaches for how software is developed and delivered has transformed. When we move from highly defined rigid roles and systems to ...
Even if your IT and support staff are well versed in agility and cloud technologies, it can be an uphill battle to establish a DevOps style culture - one where continuous improvement of both products and service delivery is expected and respected and all departments work together throughout a client or service engagement. As a service-oriented provider of cloud and data center technology, Green House Data sought to create more of a culture of innovation and continuous improvement, from our helpd...
Docker and Kubernetes are key elements of modern cloud native deployment automations. After building your microservices, common practice is to create docker images and create YAML files to automate the deployment with Docker and Kubernetes. Writing these YAMLs, Dockerfile descriptors are really painful and error prone.Ballerina is a new cloud-native programing language which understands the architecture around it - the compiler is environment aware of microservices directly deployable into infra...
The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is no time to wait for long development cycles that produce software that is obsolete at launch. DevOps may be disruptive, but it is essential. DevOpsSUMMIT at CloudEXPO expands the DevOps community, enable a wide sharing of knowledge, and educate delegates and technology providers alike.
Public clouds dominate IT conversations but the next phase of cloud evolutions are "multi" hybrid cloud environments. The winners in the cloud services industry will be those organizations that understand how to leverage these technologies as complete service solutions for specific customer verticals. In turn, both business and IT actors throughout the enterprise will need to increase their engagement with multi-cloud deployments today while planning a technology strategy that will constitute a ...
The platform combines the strengths of Singtel's extensive, intelligent network capabilities with Microsoft's cloud expertise to create a unique solution that sets new standards for IoT applications," said Mr Diomedes Kastanis, Head of IoT at Singtel. "Our solution provides speed, transparency and flexibility, paving the way for a more pervasive use of IoT to accelerate enterprises' digitalisation efforts. AI-powered intelligent connectivity over Microsoft Azure will be the fastest connected pat...
While more companies are now leveraging the cloud to increase their level of data protection and management, there are still many wondering “why?” The answer: the cloud actually brings substantial advancements to the data protection and management table that simply aren’t possible without it. The easiest advantage to envision? Unlimited scalability. If a data protection tool is properly designed, the capacity should automatically expand to meet any customer’s needs. The second advantage: the ...
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
As you know, enterprise IT conversation over the past year have often centered upon the open-source Kubernetes container orchestration system. In fact, Kubernetes has emerged as the key technology -- and even primary platform -- of cloud migrations for a wide variety of organizations. Kubernetes is critical to forward-looking enterprises that continue to push their IT infrastructures toward maximum functionality, scalability, and flexibility. As they do so, IT professionals are also embr...