You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-user@ws.apache.org by "alfredo.s.g_uam_spain" <al...@gmail.com> on 2007/12/11 11:47:56 UTC

RE: AW: axis2 deployment and configuration

Im now trying to do this task and i found out that for sending notifys with
muse is a little more complicated to add the ws-security.
Has someone made it and can give me some guidelines to force muse to use
axis outgoing or to force muse to use ws-security somehow?
for incoming soap messages with ws-security is much easier ¿isnt it?

thanks



Daniel Jemiolo wrote:
> 
> I recall a number of other users having success setting up the WS-Security 
> module in Axis2 (w/ Muse). In fact, I think Matthias (the other 
> participant in this thread) is one of them. I don't think you'll run into 
> any issues, but if you do, please report them so we can fix Muse and allow 
> the WS-Security module to work as expected.
> 
> Dan
> 
-- 
View this message in context: http://www.nabble.com/axis2-deployment-and-configuration-tp9736934p14271129.html
Sent from the Muse User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


RE: AW: axis2 deployment and configuration

Posted by "alfredo.s.g_uam_spain" <al...@gmail.com>.
i have a wsdl of my capability and i've made the server stub from wsdl2java (
muse version ) 
wsdl2java -j2ee axis2 -wsdl myserver.wsdl
then i added code for internal logic like i did in my muse mini server app 
then i've added rampart module to the axis2 web app the wsdl2java generates
and i've added the rampart module ref tag to the axis2.xml.
Also i've added the code from example10 service.xml for adding signing and
encryption.

The main problem is, how do i check my app is working correctly? 
¿how do i change the example10 .jdk keys to a .pem certificate?

thanks a lot




alfredo.s.g_uam_spain wrote:
> 
> Im now trying to do this task and i found out that for sending notifys
> with muse is a little more complicated to add the ws-security.
> Has someone made it and can give me some guidelines to force muse to use
> axis outgoing or to force muse to use ws-security somehow?
> for incoming soap messages with ws-security is much easier ¿isnt it?
> 
> thanks
> 
> 
> 
> Daniel Jemiolo wrote:
>> 
>> I recall a number of other users having success setting up the
>> WS-Security 
>> module in Axis2 (w/ Muse). In fact, I think Matthias (the other 
>> participant in this thread) is one of them. I don't think you'll run into 
>> any issues, but if you do, please report them so we can fix Muse and
>> allow 
>> the WS-Security module to work as expected.
>> 
>> Dan
>> 
> 

-- 
View this message in context: http://www.nabble.com/axis2-deployment-and-configuration-tp9736934p14271839.html
Sent from the Muse User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


Re: AW: AW: axis2 deployment and configuration

Posted by "alfredo.s.g_uam_spain" <al...@gmail.com>.
So i will need to get into the security stuff rampart was going to do for me.
In the notify muse class i'll need to cypher and sign the message on my own.

Finding so many problems to secure a muse ws ¿ there is another
WS-Notificacion java implementation wich could be easier secured ?

Thanks


beil wrote:
> 
> Hi,
> 
> I don't know if there was or is a change in the way Muse send messages
> out? 
> 
> As long as Muse uses http connectors to write outgoing messages, there
> will be no way to use the Rampart module of Axis2. This will be only
> possible if Muse sends the outgoing messages trough Axis2 and uses the
> Axis2 engine.
> 
> To use WSSE in the outgoing direction you have to setup the WSSE header
> yourself and overwrite the Muse classes to allow the addition of the
> header parameter.
> 
> Hopes this helps.
> 
> Matthias
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: alfredo.s.g_uam_spain [mailto:alfredo.salvador@gmail.com] 
> Gesendet: Dienstag, 11. Dezember 2007 11:48
> An: muse-user@ws.apache.org
> Betreff: RE: AW: axis2 deployment and configuration
> 
> 
> Im now trying to do this task and i found out that for sending notifys
> with
> muse is a little more complicated to add the ws-security.
> Has someone made it and can give me some guidelines to force muse to use
> axis outgoing or to force muse to use ws-security somehow?
> for incoming soap messages with ws-security is much easier ¿isnt it?
> 
> thanks
> 
> 
> 
> Daniel Jemiolo wrote:
>> 
>> I recall a number of other users having success setting up the
>> WS-Security 
>> module in Axis2 (w/ Muse). In fact, I think Matthias (the other 
>> participant in this thread) is one of them. I don't think you'll run into 
>> any issues, but if you do, please report them so we can fix Muse and
>> allow 
>> the WS-Security module to work as expected.
>> 
>> Dan
>> 
> -- 
> View this message in context:
> http://www.nabble.com/axis2-deployment-and-configuration-tp9736934p14271129.html
> Sent from the Muse User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/axis2-deployment-and-configuration-tp9736934p14274411.html
Sent from the Muse User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


Re: AW: AW: axis2 deployment and configuration

Posted by "alfredo.s.g_uam_spain" <al...@gmail.com>.
has someone done this yet?



beil wrote:
> 
> Hi,
> 
> I don't know if there was or is a change in the way Muse send messages
> out? 
> 
> As long as Muse uses http connectors to write outgoing messages, there
> will be no way to use the Rampart module of Axis2. This will be only
> possible if Muse sends the outgoing messages trough Axis2 and uses the
> Axis2 engine.
> 
> To use WSSE in the outgoing direction you have to setup the WSSE header
> yourself and overwrite the Muse classes to allow the addition of the
> header parameter.
> 
> Hopes this helps.
> 
> Matthias
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: alfredo.s.g_uam_spain [mailto:alfredo.salvador@gmail.com] 
> Gesendet: Dienstag, 11. Dezember 2007 11:48
> An: muse-user@ws.apache.org
> Betreff: RE: AW: axis2 deployment and configuration
> 
> 
> Im now trying to do this task and i found out that for sending notifys
> with
> muse is a little more complicated to add the ws-security.
> Has someone made it and can give me some guidelines to force muse to use
> axis outgoing or to force muse to use ws-security somehow?
> for incoming soap messages with ws-security is much easier ¿isnt it?
> 
> thanks
> 
> 
> 
> Daniel Jemiolo wrote:
>> 
>> I recall a number of other users having success setting up the
>> WS-Security 
>> module in Axis2 (w/ Muse). In fact, I think Matthias (the other 
>> participant in this thread) is one of them. I don't think you'll run into 
>> any issues, but if you do, please report them so we can fix Muse and
>> allow 
>> the WS-Security module to work as expected.
>> 
>> Dan
>> 
> -- 
> View this message in context:
> http://www.nabble.com/axis2-deployment-and-configuration-tp9736934p14271129.html
> Sent from the Muse User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/axis2-deployment-and-configuration-tp9736934p14295524.html
Sent from the Muse User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


RE: AW: AW: axis2 deployment and configuration

Posted by "alfredo.s.g_uam_spain" <al...@gmail.com>.
If i want to add the axis2 libraries and axiom libraries to my pom.xml i have
to add the following lines or others?

  <dependency>
      <groupId>axiom</groupId>
      <artifactId>axiom-api</artifactId>
      <version>1</version>
      <scope>system</scope>
     
<systemPath>/home/canal/Desktop/axis2-1.2/lib/axiom-api-1.2.4.jar</systemPath>
    </dependency>

I always get a compiler error like this: 

[INFO] [compiler:compile]
[INFO] Compiling 1 source file to
/home/canal/Desktop/muse_code/muse-2.2.0-src/muse-wsa-soap/target/classes
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Compilation failure

/home/canal/Desktop/muse_code/muse-2.2.0-src/muse-wsa-soap/src/org/apache/muse/ws/addressing/soap/SimpleSoapClient.java:[42,27]
package org.apache.axiom.om does not exist



alfredo.s.g_uam_spain wrote:
> 
> 
> Ive been digging into the code and i think SimpleSoapClient.send() is the
> method that does all the http transport. So if i want muse to post the
> messages to AXIS2 instead of directly HTTP i should modify this class. 
> 
> this is in package org.apache.muse.ws.addressing.soap
> 
>   public Element[] send(EndpointReference src, 
>                           EndpointReference dest,
>                           String wsaAction, 
>                           Element[] body, 
>                           Element[] extraHeaders)
>     
> So i need to remove all the code there and do a AXIS2 "send" call
> Following the sample code on rampart it should be something like this: 
> 
> --CODE--
> 
>   public Element[] send(EndpointReference src, 
>                           EndpointReference dest,
>                           String wsaAction, 
>                           Element[] body, 
>                           Element[] extraHeaders)
>     {
>         if (dest == null)
>             throw new
> NullPointerException(_MESSAGES.get("NullDestinationEPR"));
> 
>         if (wsaAction == null)
>             throw new
> NullPointerException(_MESSAGES.get("NullActionURI"));
> 
>         if (body == null)
>             body = _EMPTY_ARRAY;
>         
>         if (extraHeaders == null)
>             extraHeaders = _EMPTY_ARRAY;
>         
>      	ConfigurationContext ctx =
> ConfigurationContextFactory.createConfigurationContextFromFileSystem(REPOPATH,
> REPOPATH + "/conf/axis2.xml");
>         
>         ServiceClient client = new ServiceClient(ctx, null);
>         Options options = new Options();
>         options.setAction(wsaAction);
>         options.setTo(dest);
> 
> 
> 	options.setFrom(src); // is this ok¿?
> 
> 
>         client.setOptions(options);
>         
>         OMElement response = client.sendReceive(body);
>         
>         System.out.println(response);
>       
>     }
> 
> --CODE--
> 
> The problem is i have a "silly and newbie" problem with the maven pom.xml
> file because i dont know how to add the axis2 and axiom libraries i need
> for this to compile... 
> 
> 
> 
> Vinh Nguyen (vinguye2) wrote:
>> 
>> The steps I suggested would allow you to send out WSSE properties using
>> just Muse and no Rampart.  It's probably best that you actually download
>> the Muse source code to see how to customize the code further to fit into
>> your Rampart design.  I don't know much about Rampart, so I don't know
>> how it can be integrated with Muse.
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/axis2-deployment-and-configuration-tp9736934p14434064.html
Sent from the Muse User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


RE: AW: AW: axis2 deployment and configuration

Posted by "alfredo.s.g_uam_spain" <al...@gmail.com>.

Ive been digging into the code and i think SimpleSoapClient.send() is the
method that does all the http transport. So if i want muse to post the
messages to AXIS2 instead of directly HTTP i should modify this class. 

this is in package org.apache.muse.ws.addressing.soap

  public Element[] send(EndpointReference src, 
                          EndpointReference dest,
                          String wsaAction, 
                          Element[] body, 
                          Element[] extraHeaders)
    
So i need to remove all the code there and do a AXIS2 "send" call
Following the sample code on rampart it should be something like this: 

--CODE--

  public Element[] send(EndpointReference src, 
                          EndpointReference dest,
                          String wsaAction, 
                          Element[] body, 
                          Element[] extraHeaders)
    {
        if (dest == null)
            throw new
NullPointerException(_MESSAGES.get("NullDestinationEPR"));

        if (wsaAction == null)
            throw new NullPointerException(_MESSAGES.get("NullActionURI"));

        if (body == null)
            body = _EMPTY_ARRAY;
        
        if (extraHeaders == null)
            extraHeaders = _EMPTY_ARRAY;
        
     	ConfigurationContext ctx =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(REPOPATH,
REPOPATH + "/conf/axis2.xml");
        
        ServiceClient client = new ServiceClient(ctx, null);
        Options options = new Options();
        options.setAction(wsaAction);
        options.setTo(dest);


	options.setFrom(src); // is this ok¿?


        client.setOptions(options);
        
        OMElement response = client.sendReceive(body);
        
        System.out.println(response);
      
    }

--CODE--

The problem is i have a "silly and newbie" problem with the maven pom.xml
file because i dont know how to add the axis2 and axiom libraries i need for
this to compile... 



Vinh Nguyen (vinguye2) wrote:
> 
> The steps I suggested would allow you to send out WSSE properties using
> just Muse and no Rampart.  It's probably best that you actually download
> the Muse source code to see how to customize the code further to fit into
> your Rampart design.  I don't know much about Rampart, so I don't know how
> it can be integrated with Muse.
> 

-- 
View this message in context: http://www.nabble.com/axis2-deployment-and-configuration-tp9736934p14419446.html
Sent from the Muse User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


RE: AW: AW: axis2 deployment and configuration

Posted by "Vinh Nguyen (vinguye2)" <vi...@cisco.com>.
The steps I suggested would allow you to send out WSSE properties using just Muse and no Rampart.  It's probably best that you actually download the Muse source code to see how to customize the code further to fit into your Rampart design.  I don't know much about Rampart, so I don't know how it can be integrated with Muse.


-----Original Message-----
From: alfredo.s.g_uam_spain [mailto:alfredo.salvador@gmail.com] 
Sent: Tuesday, December 18, 2007 1:52 PM
To: muse-user@ws.apache.org
Subject: RE: AW: AW: axis2 deployment and configuration


But rampart does all the wsse header stuff in the moment you send the message so i think its easier because i have to remove things from these methods because i dont want them to do SOAP headers or envelope ( this is done by axis ) or WSSE headers ( this is done by rampart ) In fact i need NotificationConsumerClient.notify(NotificationMessage[]) to get rid off SOAP stuff and directly post to AXIS engine the WSNotification Body with the SOAP:action described in the wsdl 

I am right? 

If i am, ¿ i need to download MUSE source and delete from NotificationConsumerClient the lines that do SOAP stuff and then find the way ( should be easy  ) to give the WS-notification message  to AXIS2 to leave him do all the SOAP and WSSE stuff ?

thanks.



Vinh Nguyen (vinguye2) wrote:
> 
> Hi,
> I'm not familiar with Rampart, but it looks like in your code below, 
> you are starting in the right direction.  The general callflow is:
> 
> NotificationProducer.publish(QName,Element[])
>  > SubscriptionManager.publish(NotificationMessage)
>    > NotificationConsumerClient.notify(NotificationMessage[])
> 
> NotificationProducer.publish() only takes in data that will go into 
> the notification body.  Also, NotificationMessage itself represents 
> the message body, so from your capability classes, currently there's 
> no way to specify custom header properties to send along with the message.
> 
> NotificationConsumerClient.notify() is the key method that constructs 
> the actual XML payload and sends it out.  So you could try to override 
> this method and add your custom WSSE header properties to the payload.
> 
> Overall, I think to include custom header properties in outgoing 
> notification messages, you need to:
> 
> 1) Extend all 3 classes above
> 2) Add additional methods that takes in customer header properties 
> along with the usual body elements.
> 3) Have these classes call each other instead of the default Muse classes.
> 4) Update your new NotificationConsumerClient.notify() method to add 
> the custom header properties to the xml payload.
> 5) From your capabilities, call your custom NotificationProducer.
> 
> -Vinh
> 
> 

--
View this message in context: http://www.nabble.com/axis2-deployment-and-configuration-tp9736934p14406575.html
Sent from the Muse User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


RE: AW: AW: axis2 deployment and configuration

Posted by "alfredo.s.g_uam_spain" <al...@gmail.com>.
But rampart does all the wsse header stuff in the moment you send the message
so i think its easier because i have to remove things from these methods
because i dont want them to do SOAP headers or envelope ( this is done by
axis ) or WSSE headers ( this is done by rampart ) 
In fact i need NotificationConsumerClient.notify(NotificationMessage[]) to
get rid off SOAP stuff and directly post to AXIS engine the WSNotification
Body with the SOAP:action described in the wsdl 

I am right? 

If i am, ¿ i need to download MUSE source and delete from
NotificationConsumerClient the lines that do SOAP stuff and then find the
way ( should be easy  ) to give the WS-notification message  to AXIS2 to
leave him do all the SOAP and WSSE stuff ?

thanks.



Vinh Nguyen (vinguye2) wrote:
> 
> Hi,
> I'm not familiar with Rampart, but it looks like in your code below, you
> are starting in the right direction.  The general callflow is:
> 
> NotificationProducer.publish(QName,Element[])
>  > SubscriptionManager.publish(NotificationMessage)
>    > NotificationConsumerClient.notify(NotificationMessage[])
> 
> NotificationProducer.publish() only takes in data that will go into the
> notification body.  Also, NotificationMessage itself represents the
> message body, so from your capability classes, currently there's no way to
> specify custom header properties to send along with the message.
> 
> NotificationConsumerClient.notify() is the key method that constructs the
> actual XML payload and sends it out.  So you could try to override this
> method and add your custom WSSE header properties to the payload.
> 
> Overall, I think to include custom header properties in outgoing
> notification messages, you need to:
> 
> 1) Extend all 3 classes above
> 2) Add additional methods that takes in customer header properties along
> with the usual body elements.
> 3) Have these classes call each other instead of the default Muse classes.
> 4) Update your new NotificationConsumerClient.notify() method to add the
> custom header properties to the xml payload.
> 5) From your capabilities, call your custom NotificationProducer.
> 
> -Vinh
> 
> 

-- 
View this message in context: http://www.nabble.com/axis2-deployment-and-configuration-tp9736934p14406575.html
Sent from the Muse User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


RE: AW: AW: axis2 deployment and configuration

Posted by "Vinh Nguyen (vinguye2)" <vi...@cisco.com>.
Hi,
I'm not familiar with Rampart, but it looks like in your code below, you are starting in the right direction.  The general callflow is:

NotificationProducer.publish(QName,Element[])
 > SubscriptionManager.publish(NotificationMessage)
   > NotificationConsumerClient.notify(NotificationMessage[])

NotificationProducer.publish() only takes in data that will go into the notification body.  Also, NotificationMessage itself represents the message body, so from your capability classes, currently there's no way to specify custom header properties to send along with the message.

NotificationConsumerClient.notify() is the key method that constructs the actual XML payload and sends it out.  So you could try to override this method and add your custom WSSE header properties to the payload.

Overall, I think to include custom header properties in outgoing notification messages, you need to:

1) Extend all 3 classes above
2) Add additional methods that takes in customer header properties along with the usual body elements.
3) Have these classes call each other instead of the default Muse classes.
4) Update your new NotificationConsumerClient.notify() method to add the custom header properties to the xml payload.
5) From your capabilities, call your custom NotificationProducer.

-Vinh


-----Original Message-----
From: alfredo.s.g_uam_spain [mailto:alfredo.salvador@gmail.com] 
Sent: Tuesday, December 18, 2007 8:57 AM
To: muse-user@ws.apache.org
Subject: Re: AW: AW: axis2 deployment and configuration


I finaly did it, i configured my app to check for security but now i need to work with notificacions in OUTFlow but i cant  do it with muse so i think this could be a way of doing it but dont know if is possible.

Ussing the rampart basic samples ( the 5th ) and my test for my server i did this 

CODE: 

/*
 * Copyright 2004,2005 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.rampart.samples.sample05;

import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.ConfigurationContextFactory;



/*
 * Main.java
 *
 * Created on 13 de diciembre de 2007, 11:55
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */



import javax.xml.namespace.QName;

import org.w3c.dom.Element;

import org.apache.muse.util.xml.XmlUtils;
import org.apache.muse.ws.addressing.soap.SoapFault;
import org.apache.muse.ws.notification.NotificationProducer;
import org.apache.muse.ws.notification.WsnConstants;
import org.apache.muse.ws.notification.*;
import org.apache.muse.ws.resource.impl.AbstractWsResourceCapability;

import java.io.*;
import java.io.IOException;
import java.util.*;
import java.lang.String;

import java.net.InetAddress;
import java.net.URI;
import java.net.UnknownHostException;

import org.apache.muse.ws.addressing.EndpointReference;
import org.apache.muse.ws.notification.remote.NotificationProducerClient;
import org.apache.muse.ws.notification.impl.SimpleNotificationMessage;
import org.apache.muse.ws.notification.remote.NotificationConsumerClient;



/**
 *
 * @author canal
 */
    
 



public class Client {

static     String PREFIX = "myns";
    static     String NAMESPACE_URI = "http://ws.apache.org/muse/test/wsrf";
    static QName _TOPIC_NAME = new QName(NAMESPACE_URI, "SNMP", PREFIX);


    public static void main(String[] args) throws Exception {
        
	   URI address =
URI.create("http://unet.ii.uam.es:8080/broker_muse_axis_1.2/services/WsResource");
            EndpointReference consumer = new EndpointReference(address);
            
            //
            // null filter == send all messages to consumer
            //

            //org.apache.ws.muse.test.wsrf.WsResourceProxy wsn = new org.apache.ws.muse.test.wsrf.WsResourceProxy(consumer);
            
            NotificationConsumerClient wsn = new NotificationConsumerClient(consumer);
	   //wsn.setTrace(true);

            
        
         QName messageName = new QName("snmp.alfredo", "MyMessage", "msg");
	 String message = "";
         String content = "hola";
	 Element payload = XmlUtils.createElement(messageName, content);

	 SimpleNotificationMessage masaje = new SimpleNotificationMessage();
	 masaje.setTopic(_TOPIC_NAME);
	 masaje.addMessageContent(payload);
         
         System.out.println(masaje.toString());

        // Element [] maaa = new Element[1];
         
         //maaa[0]=masaje.toXML();
         //System.out.println(maaa);
         
         
//	try{
	 // wsn.notify((NotificationMessage)masaje);
          //wsn.notify(maaa);
//	}
//	catch (SoapFault e){ e.printStackTrace();}
  
        
        ConfigurationContext ctx =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(args[1],
args[1] + "/conf/axis2.xml");
        
        ServiceClient client = new ServiceClient(ctx, null);
        Options options = new Options();
       
options.setAction("http://docs.oasis-open.org/wsn/bw-2/NotificationConsumer/NotifyRequest");
        options.setTo(new
EndpointReference("http://unet.ii.uam.es/broker_muse_axis_1.2/services/WsResource"));
        client.setOptions(options);
        
        OMElement response = client.sendReceive((OMElement)masaje.toXML());
        
        System.out.println(response);
        
    }

    
}
// 

but cant get it working


beil wrote:
> 
> Hi,
> 
> I don't know if there was or is a change in the way Muse send messages 
> out?
> 
> As long as Muse uses http connectors to write outgoing messages, there 
> will be no way to use the Rampart module of Axis2. This will be only 
> possible if Muse sends the outgoing messages trough Axis2 and uses the
> Axis2 engine.
> 
> To use WSSE in the outgoing direction you have to setup the WSSE 
> header yourself and overwrite the Muse classes to allow the addition 
> of the header parameter.
> 
> Hopes this helps.
> 
> Matthias
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: alfredo.s.g_uam_spain [mailto:alfredo.salvador@gmail.com]
> Gesendet: Dienstag, 11. Dezember 2007 11:48
> An: muse-user@ws.apache.org
> Betreff: RE: AW: axis2 deployment and configuration
> 
> 
> Im now trying to do this task and i found out that for sending notifys 
> with muse is a little more complicated to add the ws-security.
> Has someone made it and can give me some guidelines to force muse to 
> use axis outgoing or to force muse to use ws-security somehow?
> for incoming soap messages with ws-security is much easier ¿isnt it?
> 
> thanks
> 
> 
> 
> Daniel Jemiolo wrote:
>> 
>> I recall a number of other users having success setting up the 
>> WS-Security module in Axis2 (w/ Muse). In fact, I think Matthias (the 
>> other participant in this thread) is one of them. I don't think 
>> you'll run into any issues, but if you do, please report them so we 
>> can fix Muse and allow the WS-Security module to work as expected.
>> 
>> Dan
>> 
> --
> View this message in context:
> http://www.nabble.com/axis2-deployment-and-configuration-tp9736934p142
> 71129.html Sent from the Muse User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
> 
> 
> 

--
View this message in context: http://www.nabble.com/axis2-deployment-and-configuration-tp9736934p14400893.html
Sent from the Muse User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


Re: AW: AW: axis2 deployment and configuration

Posted by "alfredo.s.g_uam_spain" <al...@gmail.com>.
I finaly did it, i configured my app to check for security but now i need to
work with notificacions in OUTFlow but i cant  do it with muse so i think
this could be a way of doing it but dont know if is possible.

Ussing the rampart basic samples ( the 5th ) and my test for my server i did
this 

CODE: 

/*
 * Copyright 2004,2005 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.rampart.samples.sample05;

import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.ConfigurationContextFactory;



/*
 * Main.java
 *
 * Created on 13 de diciembre de 2007, 11:55
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */



import javax.xml.namespace.QName;

import org.w3c.dom.Element;

import org.apache.muse.util.xml.XmlUtils;
import org.apache.muse.ws.addressing.soap.SoapFault;
import org.apache.muse.ws.notification.NotificationProducer;
import org.apache.muse.ws.notification.WsnConstants;
import org.apache.muse.ws.notification.*;
import org.apache.muse.ws.resource.impl.AbstractWsResourceCapability;

import java.io.*;
import java.io.IOException;
import java.util.*;
import java.lang.String;

import java.net.InetAddress;
import java.net.URI;
import java.net.UnknownHostException;

import org.apache.muse.ws.addressing.EndpointReference;
import org.apache.muse.ws.notification.remote.NotificationProducerClient;
import org.apache.muse.ws.notification.impl.SimpleNotificationMessage;
import org.apache.muse.ws.notification.remote.NotificationConsumerClient;



/**
 *
 * @author canal
 */
    
 



public class Client {

static     String PREFIX = "myns";
    static     String NAMESPACE_URI = "http://ws.apache.org/muse/test/wsrf";
    static QName _TOPIC_NAME = new QName(NAMESPACE_URI, "SNMP", PREFIX);


    public static void main(String[] args) throws Exception {
        
	   URI address =
URI.create("http://unet.ii.uam.es:8080/broker_muse_axis_1.2/services/WsResource");
            EndpointReference consumer = new EndpointReference(address);
            
            //
            // null filter == send all messages to consumer
            //

            //org.apache.ws.muse.test.wsrf.WsResourceProxy wsn = new
org.apache.ws.muse.test.wsrf.WsResourceProxy(consumer);
            
            NotificationConsumerClient wsn = new
NotificationConsumerClient(consumer);
	   //wsn.setTrace(true);

            
        
         QName messageName = new QName("snmp.alfredo", "MyMessage", "msg");
	 String message = "";
         String content = "hola";
	 Element payload = XmlUtils.createElement(messageName, content);

	 SimpleNotificationMessage masaje = new SimpleNotificationMessage();
	 masaje.setTopic(_TOPIC_NAME);
	 masaje.addMessageContent(payload);
         
         System.out.println(masaje.toString());

        // Element [] maaa = new Element[1];
         
         //maaa[0]=masaje.toXML();
         //System.out.println(maaa);
         
         
//	try{
	 // wsn.notify((NotificationMessage)masaje);
          //wsn.notify(maaa);
//	}
//	catch (SoapFault e){ e.printStackTrace();}
  
        
        ConfigurationContext ctx =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(args[1],
args[1] + "/conf/axis2.xml");
        
        ServiceClient client = new ServiceClient(ctx, null);
        Options options = new Options();
       
options.setAction("http://docs.oasis-open.org/wsn/bw-2/NotificationConsumer/NotifyRequest");
        options.setTo(new
EndpointReference("http://unet.ii.uam.es/broker_muse_axis_1.2/services/WsResource"));
        client.setOptions(options);
        
        OMElement response = client.sendReceive((OMElement)masaje.toXML());
        
        System.out.println(response);
        
    }

    
}
// 

but cant get it working


beil wrote:
> 
> Hi,
> 
> I don't know if there was or is a change in the way Muse send messages
> out? 
> 
> As long as Muse uses http connectors to write outgoing messages, there
> will be no way to use the Rampart module of Axis2. This will be only
> possible if Muse sends the outgoing messages trough Axis2 and uses the
> Axis2 engine.
> 
> To use WSSE in the outgoing direction you have to setup the WSSE header
> yourself and overwrite the Muse classes to allow the addition of the
> header parameter.
> 
> Hopes this helps.
> 
> Matthias
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: alfredo.s.g_uam_spain [mailto:alfredo.salvador@gmail.com] 
> Gesendet: Dienstag, 11. Dezember 2007 11:48
> An: muse-user@ws.apache.org
> Betreff: RE: AW: axis2 deployment and configuration
> 
> 
> Im now trying to do this task and i found out that for sending notifys
> with
> muse is a little more complicated to add the ws-security.
> Has someone made it and can give me some guidelines to force muse to use
> axis outgoing or to force muse to use ws-security somehow?
> for incoming soap messages with ws-security is much easier ¿isnt it?
> 
> thanks
> 
> 
> 
> Daniel Jemiolo wrote:
>> 
>> I recall a number of other users having success setting up the
>> WS-Security 
>> module in Axis2 (w/ Muse). In fact, I think Matthias (the other 
>> participant in this thread) is one of them. I don't think you'll run into 
>> any issues, but if you do, please report them so we can fix Muse and
>> allow 
>> the WS-Security module to work as expected.
>> 
>> Dan
>> 
> -- 
> View this message in context:
> http://www.nabble.com/axis2-deployment-and-configuration-tp9736934p14271129.html
> Sent from the Muse User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/axis2-deployment-and-configuration-tp9736934p14400893.html
Sent from the Muse User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


Re: AW: AW: axis2 deployment and configuration

Posted by "alfredo.s.g_uam_spain" <al...@gmail.com>.
I have double checked it and the problem is in the 
client.sendreceive(payload ) call
Payload is created ok so its a problem inside axis? 



alfredo.s.g_uam_spain wrote:
> 
> Finally I did overwrite the class send from SimpleSoapClient but i get an
> error when runing the code: 
> 
>  [java] Exception in thread "main" java.lang.NullPointerException
>      [java]     at
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:290)
>      [java]     at
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:254)
>      [java]     at
> org.apache.muse.ws.notification.remote.NotificationConsumerClient.notify(NotificationConsumerClient.java:99)
>      [java]     at
> org.apache.muse.ws.notification.remote.NotificationConsumerClient.notify(NotificationConsumerClient.java:83)
>      [java]     at org.apache.rampart.samples.sample05.Client.main(Unknown
> Source)
> 
> I think its from the 	     	ConfigurationContext ctx =
> ConfigurationContextFactory.createConfigurationContextFromFileSystem(REPOPATH,REPOPATH+"/conf 
> 
> I need to send the message through axis and this is the way the rampart
> examples do it but there is other way to do it without asking for the
> repopath? is this well done??
> 
> CODE ::
> 
> if(REPOPATH.equals(""))
> 		{				
> 			System.out.println(" repository path?? \n");
> 			try{
> 				BufferedReader bf = new BufferedReader (new
> InputStreamReader(System.in));
> 				REPOPATH = bf.readLine();
> 			} catch (IOException e){ return null;}
> 	
> 		}
> 
> 		
> 	     	ConfigurationContext ctx =
> ConfigurationContextFactory.createConfigurationContextFromFileSystem(REPOPATH,REPOPATH+"/conf/axis2.xml");
> 	        
> 	        ServiceClient client = new ServiceClient(ctx, null);
> 	        Options options = new Options();
> 	        options.setAction(wsaAction);
> 
> 		org.apache.axis2.addressing.EndpointReference destination = new
> org.apache.axis2.addressing.EndpointReference(dest.toString());
> 		org.apache.axis2.addressing.EndpointReference source = new
> org.apache.axis2.addressing.EndpointReference(dest.toString());
> 
> 	        options.setTo(destination);
> 		options.setFrom(source);
> 
> 	        client.setOptions(options);
> 	       
> 		
> 
> 		OMElement payload;
> 
> 		try{
> 			payload = XMLUtils.toOM(body[0]);
> 		}
> 		catch (Exception e ) { return null; } 
> 	     	devolver[0]=(Element)client.sendReceive(payload);
> 
> 
> 
> 
> 
> beil wrote:
>> 
>> Hi,
>> 
>> I don't know if there was or is a change in the way Muse send messages
>> out? 
>> 
>> As long as Muse uses http connectors to write outgoing messages, there
>> will be no way to use the Rampart module of Axis2. This will be only
>> possible if Muse sends the outgoing messages trough Axis2 and uses the
>> Axis2 engine.
>> 
>> To use WSSE in the outgoing direction you have to setup the WSSE header
>> yourself and overwrite the Muse classes to allow the addition of the
>> header parameter.
>> 
>> Hopes this helps.
>> 
>> Matthias
>> 
>> 
>> -----Ursprüngliche Nachricht-----
>> Von: alfredo.s.g_uam_spain [mailto:alfredo.salvador@gmail.com] 
>> Gesendet: Dienstag, 11. Dezember 2007 11:48
>> An: muse-user@ws.apache.org
>> Betreff: RE: AW: axis2 deployment and configuration
>> 
>> 
>> Im now trying to do this task and i found out that for sending notifys
>> with
>> muse is a little more complicated to add the ws-security.
>> Has someone made it and can give me some guidelines to force muse to use
>> axis outgoing or to force muse to use ws-security somehow?
>> for incoming soap messages with ws-security is much easier ¿isnt it?
>> 
>> thanks
>> 
>> 
>> 
>> Daniel Jemiolo wrote:
>>> 
>>> I recall a number of other users having success setting up the
>>> WS-Security 
>>> module in Axis2 (w/ Muse). In fact, I think Matthias (the other 
>>> participant in this thread) is one of them. I don't think you'll run
>>> into 
>>> any issues, but if you do, please report them so we can fix Muse and
>>> allow 
>>> the WS-Security module to work as expected.
>>> 
>>> Dan
>>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/axis2-deployment-and-configuration-tp9736934p14271129.html
>> Sent from the Muse User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: muse-user-help@ws.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: muse-user-help@ws.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/axis2-deployment-and-configuration-tp9736934p14575921.html
Sent from the Muse User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


Re: AW: AW: axis2 deployment and configuration

Posted by "alfredo.s.g_uam_spain" <al...@gmail.com>.
Finally I did overwrite the class send from SimpleSoapClient but i get an
error when runing the code: 

 [java] Exception in thread "main" java.lang.NullPointerException
     [java]     at
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:290)
     [java]     at
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:254)
     [java]     at
org.apache.muse.ws.notification.remote.NotificationConsumerClient.notify(NotificationConsumerClient.java:99)
     [java]     at
org.apache.muse.ws.notification.remote.NotificationConsumerClient.notify(NotificationConsumerClient.java:83)
     [java]     at org.apache.rampart.samples.sample05.Client.main(Unknown
Source)

I think its from the 	     	ConfigurationContext ctx =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(REPOPATH,REPOPATH+"/conf 

I need to send the message through axis and this is the way the rampart
examples do it but there is other way to do it without asking for the
repopath? is this well done??

CODE ::

if(REPOPATH.equals(""))
		{				
			System.out.println(" repository path?? \n");
			try{
				BufferedReader bf = new BufferedReader (new
InputStreamReader(System.in));
				REPOPATH = bf.readLine();
			} catch (IOException e){ return null;}
	
		}

		
	     	ConfigurationContext ctx =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(REPOPATH,REPOPATH+"/conf/axis2.xml");
	        
	        ServiceClient client = new ServiceClient(ctx, null);
	        Options options = new Options();
	        options.setAction(wsaAction);

		org.apache.axis2.addressing.EndpointReference destination = new
org.apache.axis2.addressing.EndpointReference(dest.toString());
		org.apache.axis2.addressing.EndpointReference source = new
org.apache.axis2.addressing.EndpointReference(dest.toString());

	        options.setTo(destination);
		options.setFrom(source);

	        client.setOptions(options);
	       
		

		OMElement payload;

		try{
			payload = XMLUtils.toOM(body[0]);
		}
		catch (Exception e ) { return null; } 
	     	devolver[0]=(Element)client.sendReceive(payload);





beil wrote:
> 
> Hi,
> 
> I don't know if there was or is a change in the way Muse send messages
> out? 
> 
> As long as Muse uses http connectors to write outgoing messages, there
> will be no way to use the Rampart module of Axis2. This will be only
> possible if Muse sends the outgoing messages trough Axis2 and uses the
> Axis2 engine.
> 
> To use WSSE in the outgoing direction you have to setup the WSSE header
> yourself and overwrite the Muse classes to allow the addition of the
> header parameter.
> 
> Hopes this helps.
> 
> Matthias
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: alfredo.s.g_uam_spain [mailto:alfredo.salvador@gmail.com] 
> Gesendet: Dienstag, 11. Dezember 2007 11:48
> An: muse-user@ws.apache.org
> Betreff: RE: AW: axis2 deployment and configuration
> 
> 
> Im now trying to do this task and i found out that for sending notifys
> with
> muse is a little more complicated to add the ws-security.
> Has someone made it and can give me some guidelines to force muse to use
> axis outgoing or to force muse to use ws-security somehow?
> for incoming soap messages with ws-security is much easier ¿isnt it?
> 
> thanks
> 
> 
> 
> Daniel Jemiolo wrote:
>> 
>> I recall a number of other users having success setting up the
>> WS-Security 
>> module in Axis2 (w/ Muse). In fact, I think Matthias (the other 
>> participant in this thread) is one of them. I don't think you'll run into 
>> any issues, but if you do, please report them so we can fix Muse and
>> allow 
>> the WS-Security module to work as expected.
>> 
>> Dan
>> 
> -- 
> View this message in context:
> http://www.nabble.com/axis2-deployment-and-configuration-tp9736934p14271129.html
> Sent from the Muse User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/axis2-deployment-and-configuration-tp9736934p14575602.html
Sent from the Muse User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


AW: AW: axis2 deployment and configuration

Posted by "Beil, Matthias" <Be...@ascom-ac.de>.
Hi,

I don't know if there was or is a change in the way Muse send messages out? 

As long as Muse uses http connectors to write outgoing messages, there will be no way to use the Rampart module of Axis2. This will be only possible if Muse sends the outgoing messages trough Axis2 and uses the Axis2 engine.

To use WSSE in the outgoing direction you have to setup the WSSE header yourself and overwrite the Muse classes to allow the addition of the header parameter.

Hopes this helps.

Matthias


-----Ursprüngliche Nachricht-----
Von: alfredo.s.g_uam_spain [mailto:alfredo.salvador@gmail.com] 
Gesendet: Dienstag, 11. Dezember 2007 11:48
An: muse-user@ws.apache.org
Betreff: RE: AW: axis2 deployment and configuration


Im now trying to do this task and i found out that for sending notifys with
muse is a little more complicated to add the ws-security.
Has someone made it and can give me some guidelines to force muse to use
axis outgoing or to force muse to use ws-security somehow?
for incoming soap messages with ws-security is much easier ¿isnt it?

thanks



Daniel Jemiolo wrote:
> 
> I recall a number of other users having success setting up the WS-Security 
> module in Axis2 (w/ Muse). In fact, I think Matthias (the other 
> participant in this thread) is one of them. I don't think you'll run into 
> any issues, but if you do, please report them so we can fix Muse and allow 
> the WS-Security module to work as expected.
> 
> Dan
> 
-- 
View this message in context: http://www.nabble.com/axis2-deployment-and-configuration-tp9736934p14271129.html
Sent from the Muse User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org