Re: unknown error

2009-08-07 Thread Andreas Veithen
According to the stack trace, this is not an issue in the client code,
but a SOAP fault received from the server.

Andreas

On Thu, Aug 6, 2009 at 16:39, Asma Maalej wrote:
> hello every one
>
> Actually, i used to work with axis2, implementing web service and invoking
> them by a simple client and it worked usually fine.
> however, i was surprised by a throwed exception i don't know the reason
> below is the client code which was working fine:
>
> import java.rmi.RemoteException;
>
> import org.apache.axis2.AxisFault;
>
> import doca.SoustraStub.Soust;
> import doca.SoustraStub.SoustResponse;
>
> public class SoustraClient {
> public static void main (String argv[]){
>     try {
>       SoustraStub stub = new
> SoustraStub("http://localhost:8080/finalServ/services/Soustra";);
>         Soust sous = new Soust();
>             sous.setB(7);
>       sous.setB(4);
>             SoustResponse resp = stub.soust(sous);
>         System.out.println("le résultat de soustraction est
> :"+resp.get_return());
>   } catch (AxisFault e) {
>       // TODO Auto-generated catch block
>       e.printStackTrace();
>   } catch (RemoteException e) {
>       // TODO Auto-generated catch block
>       e.printStackTrace();
>   }
>  }
> }
>
> and this is the unknown exception:
>
> org.apache.axis2.AxisFault: unknown
>   at
> org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:512)
>   at
> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:370)
>   at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
>   at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
>   at
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
>   at doca.SoustraStub.soust(SoustraStub.java:186)
>   at doca.SoustraClient.main(SoustraClient.java:21)
>
> please help
>


Re: Possibility to marshal the request-Parameter to XML?

2009-08-07 Thread Martin Fernau
Hmm, I don't know. Maybe I'm not deep enough into this thematic. 
But how can I use axis2 without databinding then? And what does this mean for 
my service class?

Am Freitag 07 August 2009 schrieb Andreas Veithen:
> Martin,
>
> If that is the requirement, why do you use databinding at all?
>
> Andreas



Re: Possibility to marshal the request-Parameter to XML?

2009-08-07 Thread Andreas Veithen
Martin,

If that is the requirement, why do you use databinding at all?

Andreas

On Fri, Aug 7, 2009 at 15:56, Martin Fernau wrote:
> Hi Everyone!
>
> Following question:
>
> Lets assume that I have a wsdl-File.
> Say further I already did the wsdl2java step successfully.
> Now I have one Service-Class with the following structure:
>
> public MethodResponse1 method1(MethodRequest1 request)
> ...
> public MethodResponse2 method2(MethodRequest2 request)
> ...
> and so on
>
> Is there a way to marshal those Request-Objects back to XML and is there a way
> to unmarshal a Response-Object from an already existing XML?
>
>
> Background:
> My Service is just an interface between an old cobol program on one side and
> the SOAP-Client on the other side. The SOAP-Client is calling my Service and
> want to comunicate with me. But I need to transfer the informations to the
> cobol-program which do the business things.
> The easiest way would be to stream the Request-Informations back to XML. The
> cobol program can read this and itself answering with XML. The answer-XML is
> the Response-Objekt I just need to read and put into such an Object and
> finally return my Method. Would be nice to have a build-in method to stream
> these Object in and out of XML.
> The hard way is to generate the same Classes with the JAXB compiler and
> manually 1:1 copy the informations from the axis objects to the JAXB objects.
> Then I would able to do the marshalling and unmarshalling thing with JAXB.
>


Re: DB storage intercepted response-time values

2009-08-07 Thread Andreas Veithen
Can you please explain your requirement more precisely? From your
explanation it is not clear where the two measures are taken, what
exactly is communicated in the SOAP headers and where you want to
calculate the difference.

Andreas

On Fri, Aug 7, 2009 at 15:29, Asma Maalej wrote:
> Hello
>
> i'm working on the monitoring web services, using axis2-1.4.1 and tomcat
> 6.0.18.
> I have to intercept QoS parameters like response-time. to do that, I should
> capture in the handler code the  System.currentTimeMillis() and add it to
> the SOAPheader of the SOAP message. of course, this handler must to be
> involved in InFlow and the OutFlow.
>
> My problem is how could I recover these 2 values, cause now I can have only
> one which is at the time of the reception of request SOAP message. but the
> one at the moment of sending response SOAP message, I have no idea, how
> could I do that
>
> Any idea please?
>
>


[Axis2] How to invoke a secured webservice

2009-08-07 Thread axis
Hello,

I am trying to invoke a secured webservice https://example.com using axis2
and get the below exception. Looks like the certificate is not there in
the trust store but not sure how to accept the certificate automatically
when invoking the webservice. Please help me regarding this.

Below is the exception trace I am get when invoking the service in websphere.


SSL HANDSHAKE FAILURE:  A signer with SubjectDN "CN=ecs.amazonaws.com,
O=Amazon.com Inc., L=Seattle, ST=Washington, C=US" was sent from target
host:port "null:null".  The signer may need to be added to local trust
store "C:/Program
Files/IBM/SDP/runtimes/base_v7/profiles/hub20/config/cells/localhostNode01Cell/nodes/localhostNode01/trust.p12"
located in SSL configuration alias "NodeDefaultSSLSettings" loaded from
SSL configuration file "security.xml".  The extended error message from
the SSL handshake exception is: "PKIX path building failed:
java.security.cert.CertPathBuilderException: invalid certificate, key
identifier is missing from authority key identifier extension".


Thanks in Advance
Senthil



http transport

2009-08-07 Thread axis
Hi,

I'm not sure offhand how to make the server certificate authentication work
in that situation, but I believe Axis2 is using the Commons HttpClient by
default, and that appears to offer a way of using your own socket factory

Below is the exception :

SSL HANDSHAKE FAILURE:  A signer with SubjectDN "CN=ecs.amazonaws.com,
O=Amazon.com Inc., L=Seattle, ST=Washington, C=US" was sent from target
host:port "null:null".  The signer may need to be added to local trust
store "C:/Program
Files/IBM/SDP/runtimes/base_v7/profiles/hub20/config/cells/localhostNode01Cell/nodes/localhostNode01/trust.p12"
located in SSL configuration alias "NodeDefaultSSLSettings" loaded from
SSL configuration file "security.xml".  The extended error message from
the SSL handshake exception is: "PKIX path building failed:
java.security.cert.CertPathBuilderException: invalid certificate, key
identifier is missing from authority key identifier extension".

Thanks
Senthil




Re: Writing a service with multiple operations

2009-08-07 Thread Chris Mannion
Thank you, that's exactly what I meant.  So the method names,
"authenticate" and "authenticateWithRole", matching with the operation
names defined in the services.xml is enough for Axis to know which
method to invoke when a request comes in, thank you.

2009/8/7 Chinmoy Chakraborty :
> Do you want to deploy service which has multiple operations? What do you
> mean by "actually building the java class that implements the service"?
>
> If you mean how to write service class with multiple operations then just
> add public methods as you did for single operation e.g. I can have two
> operations for service "AUTHENTICATE_SERVICE"
>
> public String authenticate(String username, String password)
> public String authenticateWithRole(String username, String password, String
> role)
>
> and you need to add these in your services.xml. e.g.
> ...
> abc.service.AuthenticateService
>    
>     class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
>    
>    
>     class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
>    
> ..
>
> Chinmoy
>
> On Fri, Aug 7, 2009 at 7:03 PM, Chris Mannion 
> wrote:
>>
>> That would be using a client to invoke a service with mutliple
>> operations though, right?  I'm talking about actually building the
>> Java class that implements the service.
>>
>> 2009/8/7 Chinmoy Chakraborty :
>> > You can have multiple operations for a single service name. You just
>> > need to
>> > set the action (operation name) of a service you want to invoke.
>> >
>> >   Options options = new Options();
>> >   RPCServiceClient client = new RPCServiceClient();
>> >   options.setTo(targetEPR);
>> >   options.setAction(OPERATION_NAME);
>> >   options.setTimeOutInMilliSeconds(60);
>> >   client.setOptions(options);
>> > 
>> > and your service name should be .../service/service_name.
>> >
>> > HTH,
>> > Chinmoy
>> >
>> > On Fri, Aug 7, 2009 at 6:36 PM, Chris Mannion
>> > 
>> > wrote:
>> >>
>> >> Hi all
>> >>
>> >> I've been re-building my old Axis based web-services as Axis2 services
>> >> but am a little puzzled about one issue.  Two of the services I have
>> >> make multiple operations available so I'm just wondering how I got
>> >> about building that with Axis2.  All the other services that I've
>> >> managed to deploy so far all have only one operation so I've managed
>> >> to build Java classes with one method which takes an OMElement as
>> >> input without really understanding how Axis2 knows that that's the
>> >> correct method to call when the web-service is invoked.  Now that
>> >> there will be multiple methods to match multiple operations on the
>> >> web-service, I really need to properly understand how Axis determines
>> >> which class method relates to which WS operation.  Is it as simple as
>> >> making sure the methods have the same name as the operations or is
>> >> there something more complicated I'll need to do?
>> >>
>> >> --
>> >> Chris Mannion
>> >> iCasework and LocalAlert implementation team
>> >> 0208 144 4416
>> >
>> >
>>
>>
>>
>> --
>> Chris Mannion
>> iCasework and LocalAlert implementation team
>> 0208 144 4416
>
>



-- 
Chris Mannion
iCasework and LocalAlert implementation team
0208 144 4416


Re: DB storage intercepted response-time values

2009-08-07 Thread Asma Maalej

Thanks for yoour reply

but, it seems to me that you didn't understand my problem
in fact, i have already this book
and i don't need to have more information about the logical process of 
handler; my problem is so clear
it consists of how could I recover the information of the response-time 
at the handler runtime


Chinmoy Chakraborty a écrit :

Follow the link, you may find it useful...
 
http://www.packtpub.com/article/handler-and-phase-in-apache-axis
 
Chinmoy


On Fri, Aug 7, 2009 at 6:59 PM, Asma Maalej > wrote:


Hello

i'm working on the monitoring web services, using axis2-1.4.1 and
tomcat 6.0.18.
I have to intercept QoS parameters like response-time. to do that,
I should capture in the handler code the
 System.currentTimeMillis() and add it to the SOAPheader of the
SOAP message. of course, this handler must to be involved in
InFlow and the OutFlow.

My problem is how could I recover these 2 values, cause now I can
have only one which is at the time of the reception of request
SOAP message. but the one at the moment of sending response SOAP
message, I have no idea, how could I do that

Any idea please?






blocked handler thread after returning InvocationResponse.SUSPEND

2009-08-07 Thread Hannes Schubert

Hi all,

I use Axis2 1.5 handlers to suspend request processing for some period of
time. This seems to compute now, however, there are some issues I do not
understand:

1) after returning InvocationResponse.SUSPEND by one handler it is not
enough to call Axis2Engine.resume(). I am required to invoke also
RequestResponseTransport.signalResponseReady() for that message AFTER the
call to Axis2Engine.resume(). Otherwise the handler thread is blocked by
RequestResponseTransport.awaitResponse() until timeout occurs...

2) how to get rid of this blocked handler thread? It seems to me that it is
not required any more because the handler is resumed by another thread. I
would prefer Axis2 to unwind the whole stack and forget it until my
concurrent thread resumes that request.

Any hint is appreciated

Best regards

Hannes
-- 
View this message in context: 
http://www.nabble.com/blocked-handler-thread-after-returning-InvocationResponse.SUSPEND-tp24865321p24865321.html
Sent from the Axis - User mailing list archive at Nabble.com.



Possibility to marshal the request-Parameter to XML?

2009-08-07 Thread Martin Fernau
Hi Everyone!

Following question:

Lets assume that I have a wsdl-File.
Say further I already did the wsdl2java step successfully.
Now I have one Service-Class with the following structure:

public MethodResponse1 method1(MethodRequest1 request)
...
public MethodResponse2 method2(MethodRequest2 request)
...
and so on

Is there a way to marshal those Request-Objects back to XML and is there a way 
to unmarshal a Response-Object from an already existing XML?


Background:
My Service is just an interface between an old cobol program on one side and 
the SOAP-Client on the other side. The SOAP-Client is calling my Service and 
want to comunicate with me. But I need to transfer the informations to the 
cobol-program which do the business things.
The easiest way would be to stream the Request-Informations back to XML. The 
cobol program can read this and itself answering with XML. The answer-XML is 
the Response-Objekt I just need to read and put into such an Object and 
finally return my Method. Would be nice to have a build-in method to stream 
these Object in and out of XML. 
The hard way is to generate the same Classes with the JAXB compiler and 
manually 1:1 copy the informations from the axis objects to the JAXB objects. 
Then I would able to do the marshalling and unmarshalling thing with JAXB.


Re: DB storage intercepted response-time values

2009-08-07 Thread Chinmoy Chakraborty
Follow the link, you may find it useful...

http://www.packtpub.com/article/handler-and-phase-in-apache-axis

Chinmoy

On Fri, Aug 7, 2009 at 6:59 PM, Asma Maalej  wrote:

> Hello
>
> i'm working on the monitoring web services, using axis2-1.4.1 and tomcat
> 6.0.18.
> I have to intercept QoS parameters like response-time. to do that, I should
> capture in the handler code the  System.currentTimeMillis() and add it to
> the SOAPheader of the SOAP message. of course, this handler must to be
> involved in InFlow and the OutFlow.
>
> My problem is how could I recover these 2 values, cause now I can have only
> one which is at the time of the reception of request SOAP message. but the
> one at the moment of sending response SOAP message, I have no idea, how
> could I do that
>
> Any idea please?
>
>


Re: Writing a service with multiple operations

2009-08-07 Thread Chinmoy Chakraborty
Do you want to deploy service which has multiple operations? What do you
mean by "actually building the java class that implements the service"?

If you mean how to write service class with multiple operations then just
add public methods as you did for single operation e.g. I can have two
operations for service "AUTHENTICATE_SERVICE"

public String authenticate(String username, String password)
public String authenticateWithRole(String username, String password, String
role)

and you need to add these in your services.xml. e.g.
...
abc.service.AuthenticateService
   
   
   
   
   
   
..

Chinmoy


On Fri, Aug 7, 2009 at 7:03 PM, Chris Mannion
wrote:

> That would be using a client to invoke a service with mutliple
> operations though, right?  I'm talking about actually building the
> Java class that implements the service.
>
> 2009/8/7 Chinmoy Chakraborty :
>  > You can have multiple operations for a single service name. You just
> need to
> > set the action (operation name) of a service you want to invoke.
> >
> >   Options options = new Options();
> >   RPCServiceClient client = new RPCServiceClient();
> >   options.setTo(targetEPR);
> >   options.setAction(OPERATION_NAME);
> >   options.setTimeOutInMilliSeconds(60);
> >   client.setOptions(options);
> > 
> > and your service name should be .../service/service_name.
> >
> > HTH,
> > Chinmoy
> >
> > On Fri, Aug 7, 2009 at 6:36 PM, Chris Mannion <
> chris.mann...@nonstopgov.com>
> > wrote:
> >>
> >> Hi all
> >>
> >> I've been re-building my old Axis based web-services as Axis2 services
> >> but am a little puzzled about one issue.  Two of the services I have
> >> make multiple operations available so I'm just wondering how I got
> >> about building that with Axis2.  All the other services that I've
> >> managed to deploy so far all have only one operation so I've managed
> >> to build Java classes with one method which takes an OMElement as
> >> input without really understanding how Axis2 knows that that's the
> >> correct method to call when the web-service is invoked.  Now that
> >> there will be multiple methods to match multiple operations on the
> >> web-service, I really need to properly understand how Axis determines
> >> which class method relates to which WS operation.  Is it as simple as
> >> making sure the methods have the same name as the operations or is
> >> there something more complicated I'll need to do?
> >>
> >> --
> >> Chris Mannion
> >> iCasework and LocalAlert implementation team
> >> 0208 144 4416
> >
> >
>
>
>
> --
>  Chris Mannion
> iCasework and LocalAlert implementation team
> 0208 144 4416
>


Re: Writing a service with multiple operations

2009-08-07 Thread Chris Mannion
That would be using a client to invoke a service with mutliple
operations though, right?  I'm talking about actually building the
Java class that implements the service.

2009/8/7 Chinmoy Chakraborty :
> You can have multiple operations for a single service name. You just need to
> set the action (operation name) of a service you want to invoke.
>
>   Options options = new Options();
>   RPCServiceClient client = new RPCServiceClient();
>   options.setTo(targetEPR);
>   options.setAction(OPERATION_NAME);
>   options.setTimeOutInMilliSeconds(60);
>   client.setOptions(options);
> 
> and your service name should be .../service/service_name.
>
> HTH,
> Chinmoy
>
> On Fri, Aug 7, 2009 at 6:36 PM, Chris Mannion 
> wrote:
>>
>> Hi all
>>
>> I've been re-building my old Axis based web-services as Axis2 services
>> but am a little puzzled about one issue.  Two of the services I have
>> make multiple operations available so I'm just wondering how I got
>> about building that with Axis2.  All the other services that I've
>> managed to deploy so far all have only one operation so I've managed
>> to build Java classes with one method which takes an OMElement as
>> input without really understanding how Axis2 knows that that's the
>> correct method to call when the web-service is invoked.  Now that
>> there will be multiple methods to match multiple operations on the
>> web-service, I really need to properly understand how Axis determines
>> which class method relates to which WS operation.  Is it as simple as
>> making sure the methods have the same name as the operations or is
>> there something more complicated I'll need to do?
>>
>> --
>> Chris Mannion
>> iCasework and LocalAlert implementation team
>> 0208 144 4416
>
>



-- 
Chris Mannion
iCasework and LocalAlert implementation team
0208 144 4416


DB storage intercepted response-time values

2009-08-07 Thread Asma Maalej

Hello

i'm working on the monitoring web services, using axis2-1.4.1 and tomcat 
6.0.18.
I have to intercept QoS parameters like response-time. to do that, I 
should capture in the handler code the  System.currentTimeMillis() and 
add it to the SOAPheader of the SOAP message. of course, this handler 
must to be involved in InFlow and the OutFlow.


My problem is how could I recover these 2 values, cause now I can have 
only one which is at the time of the reception of request SOAP message. 
but the one at the moment of sending response SOAP message, I have no 
idea, how could I do that


Any idea please?



Re: Writing a service with multiple operations

2009-08-07 Thread Chinmoy Chakraborty
You can have multiple operations for a single service name. You just need to
set the action (operation name) of a service you want to invoke.

  Options options = new Options();
  RPCServiceClient client = new RPCServiceClient();
  options.setTo(targetEPR);
  options.setAction(OPERATION_NAME);
  options.setTimeOutInMilliSeconds(60);
  client.setOptions(options);

and your service name should be .../service/service_name.

HTH,
Chinmoy


On Fri, Aug 7, 2009 at 6:36 PM, Chris Mannion
wrote:

> Hi all
>
> I've been re-building my old Axis based web-services as Axis2 services
> but am a little puzzled about one issue.  Two of the services I have
> make multiple operations available so I'm just wondering how I got
> about building that with Axis2.  All the other services that I've
> managed to deploy so far all have only one operation so I've managed
> to build Java classes with one method which takes an OMElement as
> input without really understanding how Axis2 knows that that's the
> correct method to call when the web-service is invoked.  Now that
> there will be multiple methods to match multiple operations on the
> web-service, I really need to properly understand how Axis determines
> which class method relates to which WS operation.  Is it as simple as
> making sure the methods have the same name as the operations or is
> there something more complicated I'll need to do?
>
> --
> Chris Mannion
> iCasework and LocalAlert implementation team
> 0208 144 4416
>


Writing a service with multiple operations

2009-08-07 Thread Chris Mannion
Hi all

I've been re-building my old Axis based web-services as Axis2 services
but am a little puzzled about one issue.  Two of the services I have
make multiple operations available so I'm just wondering how I got
about building that with Axis2.  All the other services that I've
managed to deploy so far all have only one operation so I've managed
to build Java classes with one method which takes an OMElement as
input without really understanding how Axis2 knows that that's the
correct method to call when the web-service is invoked.  Now that
there will be multiple methods to match multiple operations on the
web-service, I really need to properly understand how Axis determines
which class method relates to which WS operation.  Is it as simple as
making sure the methods have the same name as the operations or is
there something more complicated I'll need to do?

-- 
Chris Mannion
iCasework and LocalAlert implementation team
0208 144 4416


Consuming a .net webservice with setManageSession

2009-08-07 Thread mikebgx2

Hi Folks,

I'm trying to talk to a .net webservice that saves my context / login state
in a cookie.
Aparently a .net client would call:  m_api.CookieContainer= new
CookieContainer()
The Axis1 equivalent is: call.setMaintainSession(true);
The Axis2 equivalent, which I'm using, is  setManageSession(true)  , as per
my code below:

DotNetWs stub= new DotNetWs(uri);
Options options = new Options();
options.setManageSession(true);
stub._getServiceClient().setOptions(options);

Authenticate auth = new Authenticate();
auth.setUsername("user");
auth.setPassword("pwd");
AuthenticateResponse resp= null;
try {
resp = stub.Authenticate(auth);
} catch (RemoteException e) {
e.printStackTrace();
}


When I get to the stub.Authenticate() call, these error messages are logged:
org.apache.axis2.description.ClientUtils inferOutTransport
SEVERE: Address information does not exist in the Endpoint Reference
(EPR).The system cannot infer the transport mechanism.

If I comment-out the call to setOptions() Authenticate() succeeds, but
subsequent calls to the webservice fail with "not authorized" ie it cant
remember my login state / context.

Maybe I need to do something to the WSDL?
Here's the endpoint part of it: ( Also see
http://test.myco.ws/imailtest_api.wsdl
http://test.myco.ws/imailtest_api.wsdl  full WSDL if interested : ) :
   
http://www.nabble.com/file/p24862935/imailtest_api.wsdl imailtest_api.wsdl

  http://www.imailtest.co.uk/webservice/imail_api.asmx"; />


  http://www.imailtest.co.uk/webservice/imail_api.asmx"; />

  


Any ideas please?

Regards,  Mike.
-- 
View this message in context: 
http://www.nabble.com/Consuming-a-.net-webservice-with-setManageSession-tp24862935p24862935.html
Sent from the Axis - User mailing list archive at Nabble.com.