Dear everybody ...

I'm développing a very-simple service, to test Exception behaviour and Soap Fault.

Here are the files I'm using to develop such a simple service.

When I invoke this Service, the 'stringField' field of the returned object is always empty ... weird, isn't it ?


Invoke to cacth the Fault : no troubles :
[EMAIL PROTECTED]:~/workspaces/seduite/Test-Exception$ invoke.sh http://localhost:8080/axis2/services/FaultyService/faultyOperation?i=0 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 185 0 185 0 0 1258 0 --:--:-- --:--:-- --:--:-- 0
<?xml version="1.0"?>
<soapenv:Reason xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";>
<soapenv:Text xml:lang="en-US">Here is a FaultyException throwed by FaultyService</soapenv:Text>
</soapenv:Reason>


invoke to retrieve object content : where is 'stringField' ?
[EMAIL PROTECTED]:~/workspaces/seduite/Test-Exception$ invoke.sh http://localhost:8080/axis2/services/FaultyService/faultyOperation?i=1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 255 0 255 0 0 2011 0 --:--:-- --:--:-- --:--:-- 0
<?xml version="1.0"?>
<ns:faultyOperationResponse xmlns:ns="http://faulty.dataSources.seduite.rainbow.i3s.unice.fr/xsd";> <ns:return type="fr.unice.i3s.rainbow.seduite.dataSources.faulty.FaultyObject">
    <ns:anotherField>47</ns:anotherField>
  </ns:return>
</ns:faultyOperationResponse>

invoke.sh is basicaly a curl $1 | xmllint --format -.
I've checked the SOAP Monitor Applet, service answers always miss 'stringField'.

Any idea ? It's ... weird ...

--
 Sebastien
<?xml version="1.0" ?>
<service name="FaultyService" scope="application" >
  
  <description>Throw FaultyException on  demand</description>
  <schema schemaNamespace="http://faulty.dataSources.seduite.rainbow.i3s.unice.fr/xsd"; />
  <messageReceivers>
  	<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only";
  					 class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
  	<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out";
  					 class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
  </messageReceivers>
  
  <parameter name="ServiceClass">fr.unice.i3s.rainbow.seduite.dataSources.faulty.FaultyServiceImpl</parameter>
  
</service>
package fr.unice.i3s.rainbow.seduite.dataSources.faulty;

public class FaultyServiceImpl implements FaultyService {

        public FaultyObject faultyOperation(int i) throws FaultyException {
                
                if ( i == 0 ){
                        // throw an Exception
                        throw new FaultyException("Here is a FaultyException 
throwed by FaultyService");
                } else {
                        // return an Object
                        return new FaultyObject("aFirstField content",47);
                }
        }
}
package fr.unice.i3s.rainbow.seduite.dataSources.faulty;

import java.io.Serializable;

public class FaultyObject implements Serializable {
        
        private static final long serialVersionUID = 1L;
        
        public FaultyObject() {}
        
        private String stringField;
        private int anotherField;
        
        public String getAFirstField() {
                return stringField;
        }
        public void setAFirstField(String field) {
                stringField = field;
        }
        public int getAnotherField() {
                return anotherField;
        }
        public void setAnotherField(int anotherField) {
                this.anotherField = anotherField;
        }
        
        public FaultyObject(String firstField, int anotherField) {
                stringField = firstField;
                this.anotherField = anotherField;
        }

}
package fr.unice.i3s.rainbow.seduite.dataSources.faulty;

public interface FaultyService {

        public FaultyObject faultyOperation(int i) throws FaultyException; 
        
}
package fr.unice.i3s.rainbow.seduite.dataSources.faulty;

public class FaultyException extends Exception {

        private static final long serialVersionUID = 1L;
        
        public FaultyException() {}
        public FaultyException(String msg) { super(msg); }
        
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to