There is any way to expose constants in web services using axis??

2005-08-17 Thread Mik
Hello.
My question is: 
There is any known way toexpose constants making use of axis1.2 :

server side:

class State implements Serializable {
 public static final String CONSTANT_1=CONSTANT_1;

 public static final String CONSTANT_2=CONSTANT_2;

}


client side:

myWebService.setState(State.CONSTANT_1);

I mean generating code from java2wsdl does not seem to generate static
or final constants.

Thanks in advance.


Constants and Web Services

2005-08-16 Thread Mik
Hello.
Maybe a very stupid question but:
I wonder is it possible to publish a provider service which has as
parameter a complex datatype and this datatype has some constants .


something like this :
Provider Service 

public void setState(State state){
...
}


Complex datatype 

Class State {
  public static final String CONSTANT_1=string1;
  
  public static final String CONSTANT_2=string2;

  public String value;

  public State(String value){
this.value= value;
  }

}


Is it possible to generate wsdl i such a way that also the string
constants are published?.

So that somebody willing to use setState service could just generate
stubs (and constants) with wsdl2java 

thanks in advance.


Web Service Provider and Applet of JFrame

2005-08-10 Thread Mik
I have a question:
There is any very simple way to get data from a Web Service provider
(not a client) and show it
in a JFrame or an Applet ?.

I am trying to use RMI. 
First getting data trough the web service and then send it to an
Applet  trough an rmi call but i have some problems setting the java
policy file, i get this error:

java.rmi.UnmarshalException: error unmarshalling return; nested exception is: 
java.lang.ClassNotFoundException: Hello (no security manager: RMI
class loader disabled).

Any idea how to do it in tomcat 5.5.

There is any other alternative way to rmi ?

Thanks in advance for any help.


Question a service request or response and an handler runs in the same thread??

2005-04-26 Thread Mik
My problem is to pass information 
from a Service-client to a ClientRequestHandler and 
then from a ServerRequestHandler to a Service-provider not making use
of the MessageContext.

So i' am thinking to use the ThreadLocal pattern to constuct a
stateful singleton and in this way pass information from a Service to
the Handler and vice versa.

Now my question is: are a Service and an Handler or a chain of
Handlers different steps of the same Thread.

What Happens if for example i do the following:

Service service1=new Service();
Service service2=new Service();

Call call1=service1.creatCall();
Call call2=service2.creatCall();

call1.invoke(EndPointRef_1);
call2.invoke(EndPointRef_2);

Are the different Requests and the subsequent operations of an Handler
part of the same Thread ?

Thanks in advance for any help.


How to dynamically configure an Handler in the Global Request and Response chain for different services?.

2005-04-25 Thread Mik Goodhelp
HOw it is possible to configure at runtime an Handler in the general
chain, or anyway capable to intercept all the outgoing or incoming
traffic  generated by each service-Provider or Requestor?
I have found this on the net:
http://www.cetis.ac.uk/members/scott

But in this way i need to attach my handlers to each Service and this
is precisely what i don't want to do.
{
 EngineConfiguration clientConfig=createClientConfig(); 
 service.setEngineConfiguration(clientConfig); 
 service.setEngine(new AxisClient(clientConfig));
}

what i would like to do is to dynamically configure  Handlers for all services.
Is it possibloe to do something like the following??:

{
 private EngineConfiguration createClientConfig() 
{ 
SimpleProvider clientConfig=new SimpleProvider(); 
Handler GeneralHandler= (Handler) new BasicHandler();
GeneralHandler.setOption(MyOption,blabla);
.

 Attach the Handler to all services 
  return clientConfig;  
}

And then ...
EngineConfiguration clientConfig=createClientConfig(); 
.../...
Pass the configuration to all services?

}


How to pass information between handlers and services.

2005-04-21 Thread Mik Goodhelp
I am trying to implement  an application  that does the following.
Assume we have a client :

startSomething(XMLFLAG)
call.invoke(EndpointReference_1)
call.invoke(EndpointReference_2)
call.invoke(EndpointReference_3)

An Handler has to intercept the different calls and put the XMLFLAG in
the SOAPHeader of all the calls.

On the Provider  side an Handler has to intercept the call, get the
XMLFLAG from the SOAPHeader and pass it to the provider service.

In simple words there is a way to directly pass information between
Client-Services and Client-Handlers and between Provider-Handlers and
Provider-Services
???
Thanks in advance.


Re: How to pass information between handlers and services.

2005-04-21 Thread Mik Goodhelp
The idea is that to pass information to an handler from the client-Application
in such way that all subsequent service invocations will be intercepted,
then Information will be added into the SOAPHeader 
and  deliverd to different provider-services

It should like really like the following:
{
// one time passing the info to an Handler in the General chain
PassInformationToHandler( Info );

Service serice_1=new Service();
Service serice_2=new Service();
Service serice_3=new Service();
// Calls
Call call_1 = (Call) service_1.createCall();
Call call_2 = (Call) service_1.createCall();
...

call_1.invoke(...)
call_2.invoke(...)
call_3.invoke(...)
}

// i don't want to do  something like the following :
{
...
// Calls
Call call_1 = (Call) service_1.createCall();
Call call_2 = (Call) service_1.createCall();
...
MessageContext messageContext_1 = call_1.getMessageContext() ;
MessageContext messageContext_2 = call_2.getMessageContext() ;
MessageContext messageContext_3 = call_3.getMessageContext() ;

messageContext_1.setProperty(MyInfo, Info );
messageContext_2.setProperty(MyInfo, Info );
messageContext_3.setProperty(MyInfo, Info );

call_1.invoke(...)
call_2.invoke(...)
call_3.invoke(...)

}

I was thinking at two ways  to solve this problem 
1) Making use of the singleton pattern. 
Exchanging information saving it into a singleton object, and sharing it.

2) Dynamically attaching an Handler to all the Services, 
passing the information each time the handler is attached (configured).
But this dynamic configuration works per service but i did'nt manage
to attach an Handler to all the services.

Any other idea ?

Thanks for the previous responses :)
 
  
 
On 4/21/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 You can pass information in the MessageContext itself using
 
 the MessageContext.setProperty(String, Object) in the handler and then
 using
 the MessageContext.getProperty(String) in the Service or Client.
 
 // Example Handler Code
public void invoke(MessageContext msgContext) throws AxisFault
{
System.out.println(Inside Handler);
msgContext.setProperty(SomeReference, Some Text if String);
 // Could be any object not just string
}
 
 // Example Service Code
 
  MessageContext ctx = MessageContext.getCurrentContext();
  String SomeReference = (String) ctx.getProperty(SomeReference);
 
  System.out.println(SomeReference =  + SomeReference);  // You
 should get 'Some Text if String'
 
 I've only tested this server side, but it should work client side as well.
 Hope this helps,
 Mark A. Malinoski
 AES/PHEAA
 Technical Coordinator/Web Development
 717-720-2413
 [EMAIL PROTECTED]
 
 Robert Gombotz
 [EMAIL PROTECTED]
 mail.com  To
   axis-user@ws.apache.org, Mik
 04/21/2005 09:34  Goodhelp [EMAIL PROTECTED]
 AM cc
 
   Subject
 Please respond to Re: How to pass information between
 [EMAIL PROTECTED] handlers and services.
  he.org
 
 
 as far as I know there is no way for a handler to talk to a WS
 directly. but you can get the message inside your WS implementation:
 
 in your WS you can get the soap message using
 org.apache.axis.MessageContext.getCurrentContext() which gives you an
 object of type MessageContext. that you can use just like in your
 handlers, so just retrieve any info fram the message you want.
 
 hope I could be of help.
 
 Rob
 
 On 4/21/05, Mik Goodhelp [EMAIL PROTECTED] wrote:
  I am trying to implement  an application  that does the following.
  Assume we have a client :
 
  startSomething(XMLFLAG)
  call.invoke(EndpointReference_1)
  call.invoke(EndpointReference_2)
  call.invoke(EndpointReference_3)
 
  An Handler has to intercept the different calls and put the XMLFLAG in
  the SOAPHeader of all the calls.
 
  On the Provider  side an Handler has to intercept the call, get the
  XMLFLAG from the SOAPHeader and pass it to the provider service.
 
  In simple words there is a way to directly pass information between
  Client-Services and Client-Handlers and between Provider-Handlers and
  Provider-Services
  ???
  Thanks in advance.