Hi Fabio,


AFAIK, API doesn't support custom JMS properties and you don't have an easy 
solution for now.



I would suggest you follow the steps below:

- Create your custom sender (e.g. CustomJmsSender) by copying JMSSender coming 
with Axis2.
Note that you should use "org.apache.axis2.transport.jms" as package name. 
Since createJMSMessage() is private, we cannot just extend JMSSender and 
override the method.
- Add following lines just before "return message;" statement of 
createJMSMessage ().


   message.setStringProperty("Content_Type", "application/xml; 
charset=\"utf-8\"  ");

   message.setStringProperty("Mime_Version", "1.0");

-   In axis2.xml, replace transport sender definition 
"org.apache.axis2.transport.jms.JMSSender" with 
"org.apache.axis2.transport.jms.CustomJmsSender"

Don't forget that it is in your responsibility to keep this class compatible 
with the new Axis2 releases ;)

Regards,

Ali Sadik Kumlali


----- Original Message ----

From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>

To: [email protected]

Sent: Thursday, February 8, 2007 11:14:08 AM

Subject: soap over jms



soap over jms           Hi all,  

I am new to Axis2 and to axis in general. 

  I need to create an Axis2 client starting from the WSDL provided by the 
server.  

I have gone through changing the axis2.xml file with the filowing information: 

  <transportReceiver name="jms" 
class="org.apache.axis2.transport.jms.JMSListener">  

    <parameter name="TibcoQueueConnectionFactory" locked="false">  

            <parameter name="java.naming.factory.initial" 
locked="false">com.tibco.tibjms.naming.TibjmsInitialContextFactory</parameter>

              <parameter name="java.naming.provider.url" 
locked="false">tibjmsnaming://localhost:7222</parameter>  

            <parameter name="transport.jms.ConnectionFactoryJNDIName" 
locked="false">QueueConnectionFactory</parameter>  

    </parameter>  

</transportReceiver> 

  <transportSender name="jms" 
class="org.apache.axis2.transport.jms.JMSSender"/> 

  and after that I have used the wsdl2java tool to generate the java stub. I 
have then created a simple client that was using this stub:

   

public class testAxis2JMS {  

        /**  

         * @param args  

         */  

        public static void main(String[] args) {  

                // TODO Auto-generated method stub  

        try{  

                String endpointURL = "jms:/TCM.INTEGRAT.REQ.ADDRESS?"  

                + 
"transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory"  

                + "&java.naming.factory.initial="   

                  + "com.tibco.tibjms.naming.TibjmsInitialContextFactory"  

                + "&java.naming.provider.url=tibjmsnaming://localhost:7222"  

                + "&java.naming.security.principal=user"  

                + "&java.naming.security.credentials=password";           

                  

                IntfTestWSfromXSDProcessServiceStub stub =   

                        new IntfTestWSfromXSDProcessServiceStub(endpointURL);  

                Indirizzo ind = new Indirizzo();  

                ind.setCitta("Rome");  

                ind.setNumero(2);  

                ind.setVia("blabla");  

                  

                Output out = stub.TestWSfromXSDProcessOp(ind);  

                System.out.println("Code : " + out.getCode());  

                System.out.println("Me : " + out.getMsg());  

        } catch(Exception e){  

            e.printStackTrace();  

            System.out.println("\n\n\n");  

        } 

          }  

} 

  Now when I send the request to the jms server the message is successfully 
sent. The problem is that the web service that I am calling needs to have some 
more information on the JMS header sent from my client to the jms server.

 

 The jms message sent look like this:

 $Header:  

JMSMessageID=ID:EMS-SERVER.8A445C9FBB14:3  

JMSTimestamp=Wed Feb 07 17:18:09 CET 2007  

JMSDestination=Queue[TCM.INTEGRAT.REQ.ADDRESS]  

JMSDeliveryMode=PERSISTENT  

JMSCorrelationID=null  

JMSType=null  

JMSReplyTo=Queue[$TMP$.EMS-SERVER.8A445C9FBB14.3]  

JMSPriority=4  

$Properties:  

SOAPAction="test/Axis2"  

$Body:  

<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";><soapenv:Header 
/><soapenv:Body><ns1:Indirizzo 
xmlns:ns1="http://www.tibco.com/schemas/eChannel/Schema.xsd";><ns1:citta>Rome</ns1:citta><ns1:via>blabla</ns1:via><ns1:numero>2</ns1:numero></ns1:Indirizzo></soapenv:Body></soapenv:Envelope>

  The problem is that it should look like this: 

  $Header:  

JMSMessageID=ID:EMS-SERVER.8A445C9FBB184:8  

JMSTimestamp=Thu Feb 08 10:09:16 CET 2007  

JMSDestination=Queue[TCM.INTEGRAT.REQ.ADDRESS]  

JMSDeliveryMode=PERSISTENT  

JMSCorrelationID=null  

JMSType=null  

JMSReplyTo=Queue[$TMP$.EMS-SERVER.8A445C9FBB185.7]  

JMSPriority=4  

$Properties:  

Content_Type=application/xml; charset="utf-8"  

Mime_Version=1.0  

SoapAction="test/Axis2"  

$Body:  

<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";><soapenv:Header 
/><soapenv:Body><ns1:Indirizzo 
xmlns:ns1="http://www.tibco.com/schemas/eChannel/Schema.xsd";><ns1:citta>Rome</ns1:citta><ns1:via>blabla</ns1:via><ns1:numero>2</ns1:numero></ns1:Indirizzo></soapenv:Body></soapenv:Envelope>

  There are this two properties in the jms message header (Content_Type and 
Mime_Version) that I need to add in order to make the Web Servixce server work.

  Is it possible to do anything like this form the client side?   

I have tried to check withtin the Axis2 Api but i did not successfully find a 
way to add this information.  

  Is there anyone that can help me? 

  Thanks a lot in advance. 

  Cheers,

 Fabio 

  









 
____________________________________________________________________________________
Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to