RE: Axis2: howto handle custom mustUnderstand Headers

2007-11-02 Thread ROSSILLE Samuel
Erratum:

Return InvocationResponse.CONTINUE if the header is OK, 

return InvocationResponse.ABORT if you want Axis to ignore the request.

Throw an Exception if you want the client to receive a SOAP Fault


-Message d'origine-
De : ROSSILLE Samuel [mailto:[EMAIL PROTECTED] 
Envoyé : vendredi 2 novembre 2007 10:37
À : axis-user@ws.apache.org
Cc : [EMAIL PROTECTED]
Objet : RE: Axis2: howto handle custom mustUnderstand Headers

Hi

No, you must not change the MustUnderstandChecker.

You must add a handler that will process your custom header. You have two 
things to do:

1/ Write the handler class

The simplest way to do so is to write a class that extends the AbstratHandler 
provider by Axis (look up in the API docs for fully qualified name). Override 
the invoke method. In it's body you will proceed the header the way you have to.
Return InvocationResponse.CONTINUE if the header is OK, 
InvocationResponse.ABORT in other cases.

2/ Declare your handler class in axis configuration.

Edit the conf/axis2.xml file, and declare your handler in the inflow 
declaration (tag ), where the comments tells you to 
do it , like thos for example:

after the comment like this:





  


Tell me if you need more help.

Regards,

Samuel Rossille
-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 1 novembre 2007 16:57
À : ROSSILLE Samuel
Objet : RE: Axis2: howto handle custom mustUnderstand Headers

Hi Samuel,

I saw your response in the newsgroup below. I still don't quite understand how 
to configure it. Did you modify the MustUnderstandChecker or did you extend the 
class and put the code in below? If the latter, did you then configure that 
class in the axis2.xml handlers? Is there a document that talks about this?

Thanks in advance for all your help,

Thanks,
Rob

ROSSILLE Samuel wrote:
> 
> Hi
> 
> messageContext.getEnvelope().getHeader().examineAllHeaderBlocks()
> gives you an Iterator over all the SOAPHeaderBlock of the message
> 
> hb.getMustUnderstand()
> tells you if a the SOAPHeaderBlock hb must be understood.
> 
> hb.setProcessed()
> tells Axis that your program understands a the SOAPHeaderBlock hb and has
> correctly completed it's processing. 
> 
> Regards
> Samuel Rossille
> 
> -Message d'origine-
> De : Andreas Schultz [mailto:[EMAIL PROTECTED] 
> Envoyé : mardi 16 octobre 2007 15:54
> À : axis-user@ws.apache.org
> Objet : Axis2: howto handle custom mustUnderstand Headers
> 
> Hi all,
> 
> I need to handle custom header fields that have the mustUnderstand
> attribute set to true(1).
> Currently such an invocation triggers a fault:
> org.apache.axis2.AxisFault: Must Understand check failed for header : MyID
> 
> Searching the maillinglist has turned up a references to a
> MustUnderstandChecker, but i don't understand how i tell it what
> header elements are supported.
> 
> Is there a magic trick to tell axis which headers my service likes?
> 
> Regards
> Andreas
> 
> -
> 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]
> 
> 
> 
Quoted from: 
http://www.nabble.com/Axis2%3A-howto-handle-custom-mustUnderstand-Headers-tf4634363.html#a13235540

-
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]



RE: Axis2: howto handle custom mustUnderstand Headers

2007-11-02 Thread ROSSILLE Samuel
Hi

No, you must not change the MustUnderstandChecker.

You must add a handler that will process your custom header. You have two 
things to do:

1/ Write the handler class

The simplest way to do so is to write a class that extends the AbstratHandler 
provider by Axis (look up in the API docs for fully qualified name). Override 
the invoke method. In it's body you will proceed the header the way you have to.
Return InvocationResponse.CONTINUE if the header is OK, 
InvocationResponse.ABORT in other cases.

2/ Declare your handler class in axis configuration.

Edit the conf/axis2.xml file, and declare your handler in the inflow 
declaration (tag ), where the comments tells you to 
do it , like thos for example:

after the comment like this:





  


Tell me if you need more help.

Regards,

Samuel Rossille
-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 1 novembre 2007 16:57
À : ROSSILLE Samuel
Objet : RE: Axis2: howto handle custom mustUnderstand Headers

Hi Samuel,

I saw your response in the newsgroup below. I still don't quite understand how 
to configure it. Did you modify the MustUnderstandChecker or did you extend the 
class and put the code in below? If the latter, did you then configure that 
class in the axis2.xml handlers? Is there a document that talks about this?

Thanks in advance for all your help,

Thanks,
Rob

ROSSILLE Samuel wrote:
> 
> Hi
> 
> messageContext.getEnvelope().getHeader().examineAllHeaderBlocks()
> gives you an Iterator over all the SOAPHeaderBlock of the message
> 
> hb.getMustUnderstand()
> tells you if a the SOAPHeaderBlock hb must be understood.
> 
> hb.setProcessed()
> tells Axis that your program understands a the SOAPHeaderBlock hb and has
> correctly completed it's processing. 
> 
> Regards
> Samuel Rossille
> 
> -Message d'origine-
> De : Andreas Schultz [mailto:[EMAIL PROTECTED] 
> Envoyé : mardi 16 octobre 2007 15:54
> À : axis-user@ws.apache.org
> Objet : Axis2: howto handle custom mustUnderstand Headers
> 
> Hi all,
> 
> I need to handle custom header fields that have the mustUnderstand
> attribute set to true(1).
> Currently such an invocation triggers a fault:
> org.apache.axis2.AxisFault: Must Understand check failed for header : MyID
> 
> Searching the maillinglist has turned up a references to a
> MustUnderstandChecker, but i don't understand how i tell it what
> header elements are supported.
> 
> Is there a magic trick to tell axis which headers my service likes?
> 
> Regards
> Andreas
> 
> -
> 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]
> 
> 
> 
Quoted from: 
http://www.nabble.com/Axis2%3A-howto-handle-custom-mustUnderstand-Headers-tf4634363.html#a13235540

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



RE: getting following exception in making client connection to the service

2007-10-26 Thread ROSSILLE Samuel
This Exception means that the class loader can't find the class  
javax.jms.ByteMessage.

This class is provided by one of the dependencies: 
geronimo-jms_1.1_spec-1.1.jar, so please check that this file is in your 
classpath.

Regards,

Samuel Rossille

-Message d'origine-
De : Shalab Goel [mailto:[EMAIL PROTECTED] 
Envoyé : mercredi 24 octobre 2007 19:21
À : axis-user@ws.apache.org
Objet : getting following exception in making client connection to the service 

Appreciate any help on what I might be missing.


java.lang.NoClassDefFoundError: javax/jms/BytesMessage
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at 
org.apache.axis2.deployment.AxisConfigBuilder.processTransportSenders(AxisConfigBuilder.java:516)
at 
org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:109)
at 
org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:640)
at 
org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:105)
at 
org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:60)
at 
org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:174)
at 
org.apache.axis2.client.ServiceClient.initializeTransports(ServiceClient.java:211)
at 
org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:138)
at org.apache.axis2.client.ServiceClient.(ServiceClient.java:133)
...
...


-
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]



RE: Axis2: howto handle custom mustUnderstand Headers

2007-10-16 Thread ROSSILLE Samuel
Hi

messageContext.getEnvelope().getHeader().examineAllHeaderBlocks()
gives you an Iterator over all the SOAPHeaderBlock of the message

hb.getMustUnderstand()
tells you if a the SOAPHeaderBlock hb must be understood.

hb.setProcessed()
tells Axis that your program understands a the SOAPHeaderBlock hb and has 
correctly completed it's processing. 

Regards
Samuel Rossille

-Message d'origine-
De : Andreas Schultz [mailto:[EMAIL PROTECTED] 
Envoyé : mardi 16 octobre 2007 15:54
À : axis-user@ws.apache.org
Objet : Axis2: howto handle custom mustUnderstand Headers

Hi all,

I need to handle custom header fields that have the mustUnderstand
attribute set to true(1).
Currently such an invocation triggers a fault:
org.apache.axis2.AxisFault: Must Understand check failed for header : MyID

Searching the maillinglist has turned up a references to a
MustUnderstandChecker, but i don't understand how i tell it what
header elements are supported.

Is there a magic trick to tell axis which headers my service likes?

Regards
Andreas

-
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]



RE: Axis2 client

2007-10-11 Thread ROSSILLE Samuel
I'm not sure, but I think I saw 

"Exception occurred while trying to invoke
service method"

before, when my service method raised an Exception.

Maybe, you could try to catch all Exception whit "catch (Exception ex) {" in 
the body of your service method, to see if the problem comes from Axis or from 
your method.

I hope this will Help

Regards

Samuel Rossille
-Message d'origine-
De : rajnishe [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 11 octobre 2007 15:27
À : axis-user@ws.apache.org
Objet : Axis2 client


Hello All

I am using axis2 for webservice development.
When i run client first time it gives me error below .
But second time and later many times it runs successfully.
I am using jboss 4.0.2 server .
Now i restart server and try to run it again gives me this error.
So this error occured only one time when server is up .
Thanks in advance for your kind sugestion to solve this problem.

org.apache.axis2.AxisFault: Exception occurred while trying to invoke
service method createEvent
at
org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at
st.ict.qs.ws.client1.EventServiceStub.createEvent(EventServiceStub.java:205)
at test_case.test.main(test.java:47)

Best Regards
Rajnish Chauhan 
-- 
View this message in context: 
http://www.nabble.com/Axis2-client-tf4607258.html#a13155849
Sent from the Axis - User mailing list archive at Nabble.com.


-
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]



RE: AxisFault and CustomException

2007-10-04 Thread ROSSILLE Samuel
Hi

 

I'm not yet Axis2 guru, but i think i understand your problem :-)

 

When the java method of your service throws a method, axis translates the java 
exception into a soap fault. Soap fault is less structured than a java 
exception. It has only a soap:code and a soap:reason. Both are text elements. 
By default, axis sets this text to the value of the stack trace of the java 
exception (look at comments at the beginning of axis2.xml).

 

Then, when your client catches the soap fault, it raises an AxisFault, which is 
a java exception, but you have lost the structure, because of the fact that 
there is no equivalent in soap to the very structured java exception.

 

getDetail() just gives you soap element  which contains the code and the reason.

 

For myself, I would not use a soap fault, but encapsulate the result type of my 
method in a wrapper which contains an error code (one of the codes means that 
result ok). If the method fails, the error code gives you the exception and the 
wrapper object would be null:

 

package axis2test;
public class MyService {
public MyService() {
}
public MyDataType addOneToPositiveValue(int value) throws CustomException {



MyDataType result = new MyDataType();

if(value < 1) {
result.setErrorCode(1);

return 0;
}
else {

 result.setErrorCode(0)

 return(value + 1);
}  
}
}



package axis2test;
public class MyDataType {
private int data;

private int errorCode;

 

public getters, setters,...

 



}



Samuel Rossilel



De : Pär Malmqvist [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 4 octobre 2007 15:20
À : axis-user@ws.apache.org
Objet : AxisFault and CustomException

 


Hello!
 
I have created a simple Axis2 service called MyService, se code below. It has 
one method: addOneToPositiveValue. If it is called with a negative value it 
throws a CustomException.
I have created a MyService.aar and deployed it on Axis2 1.3 and Tomcat 5.5.23
 
Then I created a simple client with wsdl2java and xmlbeans style.
 
Its really hard to get the CustomException in an easy way at the client side.
The AxisFault.getDetail() displays the name of the exception deep down in some 
kind of stacktrace. Thats all.
 
Can you Axis2 gurus have a look at it please?
If I haven't missed anything I think something has to be done to make this 
easier.
 
Thanks.
 
/Pär
 

package axis2test;
public class MyService {
public MyService() {
}
public int addOneToPositiveValue(int value) throws CustomException {
if(value < 1) {
throw(new CustomException());
}

return(value + 1);
}
}
 
package axis2test;
public class CustomException extends Exception {   
private static final long serialVersionUID = 9;
public CustomException() {
super();
}
public String toString() {
return(super.toString() + ' axis2test.CustomException');
}
}
 


This is a webservice for MyService




axis2test.MyService




Get news, entertainment and everything you care about at Live.com. Check it 
out!  



RE: SOAP UI: how to pass values to parameters such as arrays ?

2007-09-25 Thread ROSSILLE Samuel
I faced the same issue.

 

I solved it by creating another web service that returns an array of the same 
type of my param, and I look at the result to get the right pattern.

 

SOAP UI is a good tool for testing web services with simple input params, but 
when it become a bit complicated, you should think about generating client stub



De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Envoyé : mardi 25 septembre 2007 16:14
À : axis-user@ws.apache.org
Objet : SOAP UI: how to pass values to parameters such as arrays ?

 


Hi, 
This is i guess a basic question for Soap UI users. 
I am using Soap UI to test my web services. 
Some operations on a web service have parameters of ARRAY type. 

I would like to know, in that case, how do you pass the values in the Request 
editor ? 
There is no Question Mark to replace with a value. 
Am i missing something ? 

thanks for helping. 





[Axis2] required jdk level

2007-09-20 Thread ROSSILLE Samuel
Hi

I'm working on web services for CGI.  
We intend to use Axis2-1.3 as our web services stack. However, I'm
having trouble with the following issue: I've read in the system
requirement section on the download page, that all we need to use this
version of Axis is the JDK 1.4. I've downloaded the standard binary
distribution, and when I try to use the SAAJConverter, I get the
following error at compile time:

| cannot access org.apache.axis2.jaxws.message.util.SAAJConverter
| bad class file:
D:\users\samuel.rossille\webservices\download\axis2-1.3\lib\axis2-jaxws-
1.3.jar(org/apache/axis2/jaxws/message/util/SAAJConverter.class)
| class file has wrong version 49.0, should be 48.0

on this line

| import org.apache.axis2.jaxws.message.util.SAAJConverter;

I looked at the source code and found out that the actual source level
of this class was java 1.5. Do you use a retro-translator tool ?  Is
there a way to use these classes? I've been looking for documentation
about this topic, but I've found nothing so far. Any help would be most
welcome.

Regards,

Samuel Rossille
CGI
www.cgi.com

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



[Axis2] required jdk level

2007-09-20 Thread ROSSILLE Samuel
Hi

I'm working on web services for CGI.  
We intend to use Axis2-1.3 as our web services stack. However, I'm
having trouble with the following issue: I've read in the system
requirement section on the download page, that all we need to use this
version of Axis is the JDK 1.4. I've downloaded the standard binary
distribution, and when I try to use the SAAJConverter, I get the
following error at compile time:

| cannot access org.apache.axis2.jaxws.message.util.SAAJConverter
| bad class file:
D:\users\samuel.rossille\webservices\download\axis2-1.3\lib\axis2-jaxws-
1.3.jar(org/apache/axis2/jaxws/message/util/SAAJConverter.class)
| class file has wrong version 49.0, should be 48.0

on this line

| import org.apache.axis2.jaxws.message.util.SAAJConverter;

I looked at the source code and found out that the actual source level
of this class was java 1.5. Do you use a retro-translator tool ?  Is
there a way to use these classes? I've been looking for documentation
about this topic, but I've found nothing so far. Any help would be most
welcome.

Regards,

Samuel Rossille
CGI
www.cgi.com

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