Re: scope=transportsession, new SessionContext instance for each request

2008-03-20 Thread Kevin TierOne
Good question.  Looks like the problem was on the client side.  I was
using the following to setup the client:

Options options = new Options();
options.setAction(command);
options.setTo(new EndpointReference(endpoint));
serviceClient.setOptions(options);


Adding the setMangedSession() call as follows fixes the problem.

Options options = new Options();
options.setAction(command);
options.setTo(new EndpointReference(endpoint));
options.setManageSession(true);
serviceClient.setOptions(options);

Thanks again!

On Thu, Mar 20, 2008 at 12:43 PM, Deepal jayasinghe <[EMAIL PROTECTED]> wrote:
> Hi Kevin ,
>  Do you sure you send the correct cookies
>
>  Thank you!
>  -Deepal
>
>
> > Hello,
>  >
>  > I am trying to work out a very simple example with
>  > scope=transportsession.  The purpose of this exercise is to save an
>  > attribute on the session for use when the server receives several
>  > requests from the same client.
>  >
>  > The following code returns a different SessionContext instance every
>  > time the service is called.  Thus when I use session.getProperty(),
>  > null is always returned even if I have called setProperty() in a
>  > previous request.
>  >
>  > public class EchoMessageReceiverInOut extends
>  > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver{
>  >
>  >
>  > private static final String ATTR_KEY="CUSTOM_ATTRIBUTE";
>  > public void
>  > invokeBusinessLogic(org.apache.axis2.context.MessageContext
>  > msgContext, org.apache.axis2.context.MessageContext newMsgContext)
>  > throws org.apache.axis2.AxisFault{
>  >
>  > try {
>  >
>  > SessionContext sessionContext = msgContext.getSessionContext();
>  >
>  > String id=null;
>  > if (sessionContext!=null)
>  > {
>  >   id=(String)sessionContext.getProperty(ATTR_KEY);
>  >   if (id==null){
>  > id="85";
>  > sessionContext.setProperty(ATTR_KEY, id);
>  >   }
>  > }
>  >
>  > // get the implementation class for the Web Service
>  > Object obj = getTheImplementationObject(msgContext);
>  >
>  > Is there any other configuration that I am required to add, possibly
>  > on the client side?
>  >
>  > Is there another (better) way to save an attribute for the session?
>  >
>  > I'm using axis2-1.3 (latest release) and tomcat 5.5.
>  >
>  > This is what my service.xml looks like:
>  >
>  > 
>  > 
>  > 
>  > http://www.w3.org/ns/wsdl/in-out";
>  > class="org.example.www.echo.EchoMessageReceiverInOut"/>
>  > 
>  >   > name="ServiceClass">org.example.www.echo.EchoSkeleton
>  > ...
>  >
>  > Thanks for your help,
>  > Kevin
>  >
>  > -
>  > To unsubscribe, e-mail: [EMAIL PROTECTED]
>  > For additional commands, e-mail: [EMAIL PROTECTED]
>  >
>  >
>  >
>
>
>  -
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



scope=transportsession, new SessionContext instance for each request

2008-03-20 Thread Kevin TierOne
Hello,

I am trying to work out a very simple example with
scope=transportsession.  The purpose of this exercise is to save an
attribute on the session for use when the server receives several
requests from the same client.

The following code returns a different SessionContext instance every
time the service is called.  Thus when I use session.getProperty(),
null is always returned even if I have called setProperty() in a
previous request.

public class EchoMessageReceiverInOut extends
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver{


private static final String ATTR_KEY="CUSTOM_ATTRIBUTE";
public void
invokeBusinessLogic(org.apache.axis2.context.MessageContext
msgContext, org.apache.axis2.context.MessageContext newMsgContext)
throws org.apache.axis2.AxisFault{

try {

SessionContext sessionContext = msgContext.getSessionContext();

String id=null;
if (sessionContext!=null)
{
  id=(String)sessionContext.getProperty(ATTR_KEY);
  if (id==null){
id="85";
sessionContext.setProperty(ATTR_KEY, id);
  }
}

// get the implementation class for the Web Service
Object obj = getTheImplementationObject(msgContext);

Is there any other configuration that I am required to add, possibly
on the client side?

Is there another (better) way to save an attribute for the session?

I'm using axis2-1.3 (latest release) and tomcat 5.5.

This is what my service.xml looks like:




http://www.w3.org/ns/wsdl/in-out";
class="org.example.www.echo.EchoMessageReceiverInOut"/>

org.example.www.echo.EchoSkeleton
...

Thanks for your help,
Kevin

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



Re: Bug? SimpleType enumeration output is incorrect.

2007-08-16 Thread Kevin TierOne
Thanks, it is working correctly for the 1.3 release.

Kevin


On 8/13/07, Amila Suriarachchi <[EMAIL PROTECTED]> wrote:
> Can you please test this for Axis2 1.3 release.
>
> And run this sample code which gives me the correct out put
>
> public class TestClass extends TestCase {
>
> public void testGetResponse(){
> GetResponse getResponse = new GetResponse();
> getResponse.setOut("Test out");
> getResponse.setType(Type_T.a);
>
> try {
> OMElement omElement =
> getResponse.getOMElement(GetResponse.MY_QNAME,
> OMAbstractFactory.getOMFactory ());
> System.out.println("OM Element ==> " +
> omElement.toStringWithConsume());
> } catch (ADBException e) {
> e.printStackTrace();  //To change body of catch statement use
> File | Settings | File Templates.
> } catch (XMLStreamException e) {
> e.printStackTrace();  //To change body of catch statement use
> File | Settings | File Templates.
> }
>     }
> }
>
> http://localhost:8080/wsdlfile/";>
> Test out
> a
> 
>
> Amila.
>
>
>
> On 8/10/07, Kevin TierOne <[EMAIL PROTECTED]> wrote:
> > 1 - If I run the wsdl through the code generator, I get the file
> > WsdlfileSkeleton.java.
> >
> > 2 - I implement this method:
> >   public localhost.wsdlfile.GetResponse Get(localhost.wsdlfile.Get get0)
> >   {
> > localhost.wsdlfile.GetResponse resp=new
> localhost.wsdlfile.GetResponse();
> > resp.setOut(get0.getIn());
> > resp.setType(get0.getType());
> > return resp;
> >   }
> >
> > 3 - After deploying the webservice, I send the request as shown in the
> > original post.
> >
> > 4 - In the TCP monitor, I see the response shown the original post.  I
> > expect that the response should echo the same values and structure as
> > in the request.  However, in the response, the Element  is
> > incorrect.  The name of the element should be .
> >
> > Let me know if you need any other info.
> >
> > Kevin
> >
> > On 8/10/07, Amila Suriarachchi <[EMAIL PROTECTED] > wrote:
> > > Can you please describe your qestion bit?
> > >
> > > in other words How can I regenerate your issue?
> > >
> > > Amila.
> > >
> > >
> > > On 8/9/07, Kevin TierOne < [EMAIL PROTECTED]> wrote:
> > > >
> > > > Sorry, I forgot to mention that I'm using Axis2 1.2.
> > > >
> > > > Kevin
> > > >
> > > > On 8/9/07, Kevin TierOne < [EMAIL PROTECTED]> wrote:
> > > > > The XML tags in the response messsage of an enumerated element uses
> > > > > the simpleType name.  It should use the element name.  For example,
> > > > > using the wsdl below I get the following request and response.
> > > > >
> > > > > Look at the output "c", this element should
> > > > > be c
> > > > >
> > > > > REQUEST:
> > > > >  > > > >
> > >
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
> > > > > xmlns:q0=" http://localhost:8080/wsdlfile/";
> > > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> > > > > xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance";>
> > > > > 
> > > > > 
> > > > > www
> > > > > c
> > > > > 
> > > > > 
> > > > > 
> > > > >
> > > > > RESPONSE:
> > > > >  > > encoding="http://schemas.xmlsoap.org/soap/envelope/";?>
> > > > >  > > xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/";>
> > > > > 
> > > > > http://localhost:8080/wsdlfile/ ">
> > > > > http://localhost:8080/wsdlfile/";>www
> > > > > c
> > > > > 
> > > > > 
> > > > > 
> > > > >
> >

Re: Bug? SimpleType enumeration output is incorrect.

2007-08-10 Thread Kevin TierOne
1 - If I run the wsdl through the code generator, I get the file
WsdlfileSkeleton.java.

2 - I implement this method:
  public localhost.wsdlfile.GetResponse Get(localhost.wsdlfile.Get get0)
  {
localhost.wsdlfile.GetResponse resp=new localhost.wsdlfile.GetResponse();
resp.setOut(get0.getIn());
resp.setType(get0.getType());
return resp;
  }

3 - After deploying the webservice, I send the request as shown in the
original post.

4 - In the TCP monitor, I see the response shown the original post.  I
expect that the response should echo the same values and structure as
in the request.  However, in the response, the Element  is
incorrect.  The name of the element should be .

Let me know if you need any other info.

Kevin

On 8/10/07, Amila Suriarachchi <[EMAIL PROTECTED]> wrote:
> Can you please describe your qestion bit?
>
> in other words How can I regenerate your issue?
>
> Amila.
>
>
> On 8/9/07, Kevin TierOne < [EMAIL PROTECTED]> wrote:
> >
> > Sorry, I forgot to mention that I'm using Axis2 1.2.
> >
> > Kevin
> >
> > On 8/9/07, Kevin TierOne <[EMAIL PROTECTED]> wrote:
> > > The XML tags in the response messsage of an enumerated element uses
> > > the simpleType name.  It should use the element name.  For example,
> > > using the wsdl below I get the following request and response.
> > >
> > > Look at the output "c", this element should
> > > be c
> > >
> > > REQUEST:
> > >  > >
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
> > > xmlns:q0=" http://localhost:8080/wsdlfile/";
> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> > > xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance";>
> > > 
> > > 
> > > www
> > > c
> > > 
> > > 
> > > 
> > >
> > > RESPONSE:
> > >  encoding="http://schemas.xmlsoap.org/soap/envelope/";?>
> > >  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
> > > 
> > > http://localhost:8080/wsdlfile/";>
> > > http://localhost:8080/wsdlfile/";>www
> > > c
> > > 
> > > 
> > > 
> > >
> > >
> > >
> > >
> > > 
> > >  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
> > > xmlns:tns="http://localhost:8080/wsdlfile/ "
> > > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema "
> > >
> xmlns:wsaw="http://www.w3.org/2006/02/addressing/wsdl";
> name="wsdlfile"
> > > targetNamespace=" http://localhost:8080/wsdlfile/";>
> > > 
> > >  > > elementFormDefault="qualified"
> > > targetNamespace=" http://localhost:8080/wsdlfile/";>
> > > 
> > > 
> > > 
> > > 
> > >  > > type="tns:Type_T">
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > >  > > type="tns:Type_T">
> > > 
> > > 
> > > 
> > > 
> > >
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > >  > >
> transport="http://schemas.xmlsoap.org/soap/http"; />
> > > 
> > >  > >
> soapAction="http://localhost:8080/wsdlfile/GetLink"; />
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > http://localhost:8080/wsdlfile"; />
> > > 
> > > 
> > > 
> > >
> >
> >
> -
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>
> --
> Amila Suriarachchi,
> WSO2 Inc.

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



Re: Bug? SimpleType enumeration output is incorrect.

2007-08-09 Thread Kevin TierOne
Sorry, I forgot to mention that I'm using Axis2 1.2.

Kevin

On 8/9/07, Kevin TierOne <[EMAIL PROTECTED]> wrote:
> The XML tags in the response messsage of an enumerated element uses
> the simpleType name.  It should use the element name.  For example,
> using the wsdl below I get the following request and response.
>
> Look at the output "c", this element should
> be c
>
> REQUEST:
>  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
> xmlns:q0="http://localhost:8080/wsdlfile/";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
> 
> 
> www
> c
> 
> 
> 
>
> RESPONSE:
> http://schemas.xmlsoap.org/soap/envelope/";?>
> http://schemas.xmlsoap.org/soap/envelope/";>
> 
> http://localhost:8080/wsdlfile/";>
> http://localhost:8080/wsdlfile/";>www
> c
> 
> 
> 
>
>
>
>
> 
> http://schemas.xmlsoap.org/wsdl/soap/";
> xmlns:tns="http://localhost:8080/wsdlfile/";
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> xmlns:wsaw="http://www.w3.org/2006/02/addressing/wsdl"; name="wsdlfile"
> targetNamespace="http://localhost:8080/wsdlfile/";>
> 
>  elementFormDefault="qualified"
> targetNamespace="http://localhost:8080/wsdlfile/";>
> 
> 
> 
> 
>  type="tns:Type_T">
> 
> 
> 
> 
> 
> 
> 
>  type="tns:Type_T">
> 
> 
> 
> 
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  transport="http://schemas.xmlsoap.org/soap/http"; />
> 
>  soapAction="http://localhost:8080/wsdlfile/GetLink"; />
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> http://localhost:8080/wsdlfile"; />
> 
> 
> 
>

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



Bug? SimpleType enumeration output is incorrect.

2007-08-09 Thread Kevin TierOne
The XML tags in the response messsage of an enumerated element uses
the simpleType name.  It should use the element name.  For example,
using the wsdl below I get the following request and response.

Look at the output "c", this element should
be c

REQUEST:
http://schemas.xmlsoap.org/soap/envelope/";
xmlns:q0="http://localhost:8080/wsdlfile/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>


www
c




RESPONSE:
http://schemas.xmlsoap.org/soap/envelope/";?>
http://schemas.xmlsoap.org/soap/envelope/";>

http://localhost:8080/wsdlfile/";>
http://localhost:8080/wsdlfile/";>www
c








http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:tns="http://localhost:8080/wsdlfile/";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:wsaw="http://www.w3.org/2006/02/addressing/wsdl"; name="wsdlfile"
targetNamespace="http://localhost:8080/wsdlfile/";>

http://localhost:8080/wsdlfile/";>









































http://schemas.xmlsoap.org/soap/http"; />

http://localhost:8080/wsdlfile/GetLink"; />










http://localhost:8080/wsdlfile"; />




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



msgContext.getSessionContext() is null

2007-07-12 Thread Kevin TierOne

Using Axis2 1.2:

In the receiverInOut.invokeBusinessLogic() code,
msgContext.getSessionContext() always seems to be null.

Instead, I use this to get the session context:
msgContext.getTransportIn().getReceiver().getSessionContext(msgContext);

Should msgContext.getSessionContext() be returning the SessionContext as
well?  Or is it null for a reason?

Kevin


Axis2 + Rampart + WS-Security

2007-07-10 Thread Kevin TierOne

I have a question about the capabilities of the rampart module.  I would
like to create a client that sends several SOAP messages to the server.  The
messages are currently authenticated using the UsernameToken in a PWCallback
class.  Is it possible to create a session identifier when processing the
first SOAP message so the remaining SOAP messages are not required to
authenticate?

Is there any built-in function in rampart or the callback class to help me
keep track of a session identifier?  Or is this functionality out of the
scope of rampart and WS-Security?

Is this where WS-SecureConversation comes in to play?  If so, then is there
an Axis2 module in the works for WS-SecureConversation?

Thanks,
Kevin


Re: Axis2-1.2 and rampart-1.2 problems

2007-06-22 Thread Kevin TierOne

You need to use Axis 1.2 and Rampart 1.2.  Otherwise, use Axis 1.1 with
rampart 1.1

Get rampart 1.2 from here:

http://apache.org/dist/ws/rampart/1_2/rampart-1.2.zip


On 6/21/07, Evandro_Contato <[EMAIL PROTECTED]> wrote:



Hi Kevin

The especification of rampart1.1 it requires Axis2-1.1, in test rampart1.1
and Axis2-1.2 occurs the error :(
some idea?

thanks

Evandro



Kevin TierOne wrote:
>
> Check to make sure you have the correct version of Rampart.
>
> Note that the link on this page refers to Rampart 1.1
> http://ws.apache.org/axis2/modules/index.html
>
> Kevin
>
>
>> Hi,
>> I use axis2-1.2 and rampart-1.2 however when compiling occurs the error
>> ERROR AxisServlet:157 - java.lang.NoSuchMethodError:
>> org.apache.axis2.context.MessageContext.isEngaged
(Ljavax/xml/namespace/QName;)Z
>> some idea of as to decide the problem?
>
>> thanks
>> Evandro P. Contato
>
>

--
View this message in context:
http://www.nabble.com/Axis2-1.2-and-rampart-1.2-problems-tf3961165.html#a11242267
Sent from the Axis - Dev mailing list archive at Nabble.com.


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




Invalid MessageContext assoc with "In" key?

2007-06-21 Thread Kevin TierOne

I'm having an issue with the messageContexts in the PostDispatch Handlers.
I would like to read some data from the original envelope from a custom
handler.  I'm reading the envelope by using:

 messageContext.getOperationContext().getMessageContext(key).getEnvelope()



If my skeleton code completes without exceptions these are the envelope
values of the message contexts.  This is the behaviour that I expect.

key = "In", envelope is the original incoming message
key = "Out", envelope is the outgoing message
key = "Fault", envelope is null

The problem is if my skeleton code throws an exception:
key = "In", envelope is the fault envelope *** WHY is it the Fault envelope?
***
key = "Out", envelope is null
key = "Fault", envelope is the fault envelope


Is there an error with the message context associated with the "In" key?
Why is the envelope of the "In" context overwritten?


If it helps, I've narrowed the call that changes the envelope value to this:

AxisServlet.java:368
 msgContext.setEnvelope(faultContext.getEnvelope());


RE: Axis2-1.2 and rampart-1.2 problems

2007-06-21 Thread Kevin TierOne

Check to make sure you have the correct version of Rampart.

Note that the link on this page refers to Rampart 1.1
http://ws.apache.org/axis2/modules/index.html

Kevin



Hi,
I use axis2-1.2 and rampart-1.2 however when compiling occurs the error
ERROR AxisServlet:157 - java.lang.NoSuchMethodError:
org.apache.axis2.context.MessageContext.isEngaged(Ljavax/xml/namespace/QName;)Z
some idea of as to decide the problem?



thanks
Evandro P. Contato