Discussion:
Make axis2 deliver non XML messages to service
Swapnesh S Gandhi
2014-07-31 22:01:05 UTC
Permalink
Is it possible to make Axis2 accept non XML messages? I know it can take Rest messages, but I have a requirement to accommodate some older products which won't send a well formed XML message to the services. We are currently using synapse, it acts as proxy in between client and services but we are trying to get away from synapse.

In short I want Axis2 to deliver message to a service whether or not it's Valid according to Axis2.
Martin Gainty
2014-07-31 22:56:53 UTC
Permalink
why would you want SOAP Service such as CXF or AXIS accept request or respond with non-XML?
It is outside the scope of the SOAP Protocol 1.1 and outside the SOAP Protocol 1.2 spec then neither CXF or Axis can support it

Synapse should provide a converter to SOAP1.2
If not we can write them one ...but not for free of course

Saludos,
Martin
________________________


From: ***@jeppesen.com
To: java-***@axis.apache.org
Date: Thu, 31 Jul 2014 16:01:05 -0600
Subject: Make axis2 deliver non XML messages to service

Is it possible to make Axis2 accept non XML messages? I know it can take Rest messages, but I have a requirement to accommodate some older products which won't send a well formed XML message to the services. We are currently using synapse, it acts as proxy in between client and services but we are trying to get away from synapse.In short I want Axis2 to deliver message to a service whether or not it's Valid according to Axis2.
Shameera Rathnayaka
2014-08-01 04:46:57 UTC
Permalink
Hi Swapnesh,

If you explain your requirement bit more we might can propose a proper
solution with Axis2. It seems you can use Axis2 builder formatter approach,
where build get your non XML message and convert it to a well formed XML
message which backend service require. Axis2 has JSON support in this way.
Saying that if there are more detail on exact requirement thenwe can
propose a good solution.

Thanks,
Shameera.
Post by Martin Gainty
why would you want SOAP Service such as CXF or AXIS accept request or respond with non-XML?
It is outside the scope of the SOAP Protocol 1.1 and outside the SOAP
Protocol 1.2 spec then neither CXF or Axis can support it
Synapse should provide a converter to SOAP1.2
If not we can write them one ...but not for free of course
Saludos,
Martin
________________________
------------------------------
Date: Thu, 31 Jul 2014 16:01:05 -0600
Subject: Make axis2 deliver non XML messages to service
Is it possible to make Axis2 accept non XML messages? I know it can take
Rest messages, but I have a requirement to accommodate some older products
which won't send a well formed XML message to the services. We are
currently using synapse, it acts as proxy in between client and services
but we are trying to get away from synapse.
In short I want Axis2 to deliver message to a service whether or not it's
Valid according to Axis2.
--
Best Regards,
Shameera Rathnayaka.

email: shameera AT apache.org , shameerainfo AT gmail.com
Blog : http://shameerarathnayaka.blogspot.com/
Swapnesh S Gandhi
2014-08-01 15:15:39 UTC
Permalink
Hi Shameera and Martin thanks for the responses.

So, the requirement is this- We have some clients which will send XML messages to some endpoints (some of the products don’t even send well-formed xml). We are currently using Synapse as a proxy which converts these messages to Soap and forwards them to those endpoint URLs. We want to get rid of Synapse because it has become too complicated at this point.
So I need axis2 to forward these non XML messages to a service, and then this service will forward the messages to the endpoints. We can have more than one service to balance the load.

Please let me know more about Axis2 builder formatter approach.
I realize that this is not the main purpose of axis2 and even a work around is welcome.

Swpanesh


From: Shameera Rathnayaka [mailto:***@gmail.com]
Sent: Thursday, July 31, 2014 10:47 PM
To: java-***@axis.apache.org
Subject: Re: Make axis2 deliver non XML messages to service

Hi Swapnesh,
If you explain your requirement bit more we might can propose a proper solution with Axis2. It seems you can use Axis2 builder formatter approach, where build get your non XML message and convert it to a well formed XML message which backend service require. Axis2 has JSON support in this way. Saying that if there are more detail on exact requirement thenwe can propose a good solution.
Thanks,
Shameera.

On Fri, Aug 1, 2014 at 4:26 AM, Martin Gainty <***@hotmail.com<mailto:***@hotmail.com>> wrote:
why would you want SOAP Service such as CXF or AXIS accept request or respond with non-XML?
It is outside the scope of the SOAP Protocol 1.1 and outside the SOAP Protocol 1.2 spec then neither CXF or Axis can support it

Synapse should provide a converter to SOAP1.2
If not we can write them one ...but not for free of course

Saludos,
Martin
________________________

________________________________
From: ***@jeppesen.com<mailto:***@jeppesen.com>
To: java-***@axis.apache.org<mailto:java-***@axis.apache.org>
Date: Thu, 31 Jul 2014 16:01:05 -0600
Subject: Make axis2 deliver non XML messages to service


Is it possible to make Axis2 accept non XML messages? I know it can take Rest messages, but I have a requirement to accommodate some older products which won't send a well formed XML message to the services. We are currently using synapse, it acts as proxy in between client and services but we are trying to get away from synapse.

In short I want Axis2 to deliver message to a service whether or not it's Valid according to Axis2.
--
Best Regards,
Shameera Rathnayaka.

email: shameera AT apache.org<http://apache.org> , shameerainfo AT gmail.com<http://gmail.com>
Blog : http://shameerarathnayaka.blogspot.com/
Shameera Rathnayaka
2014-08-02 05:47:40 UTC
Permalink
Hi Swpanesh,

You can write new builder[1] and Formatter[2] implementations. Builder is
the one who responsible for read the input message body and build the SOAP
envelop. Here you may get non XML message from client, in that case you
need to convert it to expected well formed XML message and build a SOAP
envelop and return. As same as in the response path Formatter is the one
who write to outputstream to the wire, here you can convert the response
again to your non-XML response message and write it to the wire.

You need to register your Builder and Formatter implementation with a
content type in messageBuilders and messageFormatters sections of
axis2.xml.

eg: json Builder -
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/gson/JsonBuilder.java?view=markup
json formatter -
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/gson/JsonFormatter.java?view=markup


[1]
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/builder/Builder.java?view=markup
[2]
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/transport/MessageFormatter.java?view=markup


On Fri, Aug 1, 2014 at 8:45 PM, Swapnesh S Gandhi <
Post by Swapnesh S Gandhi
Hi Shameera and Martin thanks for the responses.
So, the requirement is this- We have some clients which will send XML
messages to some endpoints (some of the products don’t even send
well-formed xml). We are currently using Synapse as a proxy which converts
these messages to Soap and forwards them to those endpoint URLs. We want to
get rid of Synapse because it has become too complicated at this point.
So I need axis2 to forward these non XML messages to a service, and then
this service will forward the messages to the endpoints. We can have more
than one service to balance the load.
Please let me know more about Axis2 builder formatter approach.
I realize that this is not the main purpose of axis2 and even a work around is welcome.
Swpanesh
*Sent:* Thursday, July 31, 2014 10:47 PM
*Subject:* Re: Make axis2 deliver non XML messages to service
Hi Swapnesh,
If you explain your requirement bit more we might can propose a proper
solution with Axis2. It seems you can use Axis2 builder formatter approach,
where build get your non XML message and convert it to a well formed XML
message which backend service require. Axis2 has JSON support in this way.
Saying that if there are more detail on exact requirement thenwe can
propose a good solution.
Thanks,
Shameera.
why would you want SOAP Service such as CXF or AXIS accept request or respond with non-XML?
It is outside the scope of the SOAP Protocol 1.1 and outside the SOAP
Protocol 1.2 spec then neither CXF or Axis can support it
Synapse should provide a converter to SOAP1.2
If not we can write them one ...but not for free of course
Saludos,
Martin
________________________
------------------------------
Date: Thu, 31 Jul 2014 16:01:05 -0600
Subject: Make axis2 deliver non XML messages to service
Is it possible to make Axis2 accept non XML messages? I know it can take
Rest messages, but I have a requirement to accommodate some older products
which won't send a well formed XML message to the services. We are
currently using synapse, it acts as proxy in between client and services
but we are trying to get away from synapse.
In short I want Axis2 to deliver message to a service whether or not it's
Valid according to Axis2.
--
Best Regards,
Shameera Rathnayaka.
email: shameera AT apache.org , shameerainfo AT gmail.com
Blog : http://shameerarathnayaka.blogspot.com/
--
Best Regards,
Shameera Rathnayaka.

email: shameera AT apache.org , shameerainfo AT gmail.com
Blog : http://shameerarathnayaka.blogspot.com/
Nadir Amra
2015-01-22 18:15:51 UTC
Permalink
In SOAP response, is there a way to control the version value

<?xml version="1.0" encoding="UTF-8"?>

That is, I want it to be version="1.1". Is there a way to do that?
Loading...