Hi again david !!! :

 Many, many, MANY thanks for spending time helping me!!!!!. I
apologize for all these newbie questions!!. I'll try to answer all the
newbie questions if a become an advanced user!!.

 I've been doing what you told me... so I've learning about Ant and
now I'm trying with Ant. I've created a project in Eclipse with these
files :

org.testing.MyTestingService
org.testing.client.MyTestingServiceRPCClient
org.testing.data.External
org.testing.data.Internal

(External and Internal are the same as in the previous posts, External
class has a boolean field, a String field and a Internal field.
Internal has a String field. Those fields are private and I've getters
and setters for those fields). MyTestingService has only one method
called "retExternal" with only this code inside :

 return new External("external message", true, new Internal
("internal message"));

I've created a "services.xml" and a "build.xml" to generate the ".aar"
file to deploy the service and to compile the RPC client. The Ant
tasks complete successfully. Then I've deployed the service and I've
tried it requesting this URL from my browser :
http://localhost:8080/axis2/services/MyTestingService/retExternal

 All seems to work because I get this answer :

<ns:retExternalResponse>
 <ns:return>
   <error>true</error>
   <exMessage>external message</exMessage>
   <internal>
     <internal>internal message</internal>
   </internal>
 </ns:return>
</ns:retExternalResponse>

Then I tried my RPC client wich has this code :

package org.testing.client;

import javax.xml.namespace.QName;
import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.rpc.client.RPCServiceClient;
import org.testing.data.*;

public class MyTestingServiceRPCClient {

 public static void main(String[] args) {
   try {
       RPCServiceClient serviceClient = new RPCServiceClient();
       Options options = serviceClient.getOptions();
       EndpointReference targetEPR = new
EndpointReference("http://localhost:8080/axis2/services/MyTestingService";);
       options.setTo(targetEPR);
       QName op = new QName("http://testing.org/xsd";, "retExternal");
       Object[] opArgs = new Object[] { };
       Class[] returnTypes = new Class[] { External.class };            
       Object[] response = serviceClient.invokeBlocking(op, opArgs,
returnTypes)
       External result = (External) response[0];
       if (result == null)
           System.out.println("ERROR !!! return == null");
       else {
        System.out.println("Happy ending !!!. It returned :");
        System.out.println("exMessage             : " + result.getExMessage());
        System.out.println("error                 : " + result.isError());
        Internal internal = result.getInternal();
        if(internal == null)
          System.out.println("ERROR !!! internal == null");
        else
          System.out.println("internal message      : " + 
internal.getInternal());
      }

 } catch(AxisFault fault) {
     System.out.println("ERROR !!! AxisFault.");
     fault.printStackTrace();
 } catch(Exception e) {
     System.out.println("ERROR !!! Exception.");
     e.printStackTrace();
 }
}
}

When I run this client I get this Exception :

ERROR !!! AxisFault.
org.apache.axis2.AxisFault: org.testing.data.External
        at 
org.apache.axis2.engine.DefaultObjectSupplier.getObject(DefaultObjectSupplier.java:28)
        at 
org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:370)
        at 
org.apache.axis2.databinding.utils.BeanUtil.processObject(BeanUtil.java:676)
        at 
org.apache.axis2.databinding.utils.BeanUtil.ProcessElement(BeanUtil.java:624)
        at 
org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:560)
        at 
org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceClient.java:99)
        at 
org.testing.client.MyTestingServiceRPCClient.main(MyTestingServiceRPCClient.java:29)
Caused by: java.lang.InstantiationException: org.testing.data.External
        at java.lang.Class.newInstance0(Unknown Source)
        at java.lang.Class.newInstance(Unknown Source)
        at 
org.apache.axis2.engine.DefaultObjectSupplier.getObject(DefaultObjectSupplier.java:26)
        ... 6 more

 It seems a problem deserializing the org.testing.data.External class
but I don't know what to do to fix the problem. Any idea of what could
i do to get this working?

 Thanks in advance if anybody could help me.


2007/7/18, david <[EMAIL PROTECTED]>:
Hello Albert, The StockQuoteService sample was designed to be built and run 
from the command-line. Try to setup you new StockQuoteService from the 
command-line (using ANT). HTH, David.

albert quinn wrote ..
>   Hi !! :
>
>   I've not got answer to my last post "POJO Web Service yes or not
> question", but I haven't given up and keep on trying things. I think
> there is a bug in the "Axis 2 Service Archiver" Eclipse plugin. I'll
> try to explain it :
>
>   I've created a new Eclipse project with differente folder for source
> and classes. In the "src" folder I've created the "code.prueba"
> package where I've put the "StockQuoteService.java" example from the
> Axis 2 quick start guide. Then I've used the "Axis 2 code generator"
> Eclipse plugin to generate a WSDL from it. The I've used the plugin
> again to generate the client and server code. Then I've run the "Axis
> 2 Service Archiver" choosing the bin folder of my new project, Next,
> "Skip WSDL" option, Next, Next (no jar files needed), "Generate the
> service xml automatically", Next, then nothing happens... I can't see
> the next plugin screen but no errors are showed... long life to the
> user-friendly software !!!! ;)
>
>   If I choose "Cancel" and run the "Axis 2 Service Archiver" again,
> then, when I push the "Next" button to see the first plugin Screen...
> nothing happens, but if I push the "Next" button again, then I can see
> the first plugin screen... and then I can keep on till the "Generate
> the service xml automatically" screen, then I push "Next" button and
> again... nothing happens... no errors reported...
>
> ---------------------------------------------------------------------
> 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]

Reply via email to