So now that i can call my Javaclass inside of cocoon through the axisblock, how can i call cocoon from inside this class?

Here is the class im calling the Webservice with:

public class TestTheWebservice {
    public static void main(String [] args) throws Exception {

//The codataWS.testmethod with cocoon#axisblock
///////////////////////////////////////////////////////////////
Service service1 = new Service(new QName("CodataWS"));
String endpoint1 = "http://localhost:8080/cocoon/samples/blocks/axis/rpcrouter";;


            Call call1 = (Call)service1.createCall();
            call1.setTargetEndpointAddress(new URL(endpoint1));
            call1.setSOAPActionURI("CodataWS");
            call1.setOperationName(new QName("CodataWS", "testmethod"));
        
            String result1 = (String)call1.invoke(new Object [] {});
        
            System.out.println("Got result : " + result1);

And here the class which has been called:
--------------/usr/local/tomcat/webapps/cocoon/WEB-INF/classes----------------

public class CodataWS{
        CocoonBean cocoon = new CocoonBean();

        public String testmethod(){
                try {                   
                        ByteArrayOutputStream buffer = new 
ByteArrayOutputStream();
                        cocoon.processURI("generateWSresponse", buffer);
                        return buffer.toString();
                } catch (Exception e) {
                        // TODO Auto-generated catch block
                        return "ERROR: " + e.getMessage();
                }
        }
}
---------8<------------------------8<-----------------------------8<-----------
The result is:

Got result : ERROR: The configuration file could not be found.


can i process a pipeline like this? how do i have to configure that bean?

Gruss Jan


[EMAIL PROTECTED] wrote:
Yeah!
Thanks a lot Sven for helping me out of this ... :o)
<quote who="sven morales">

The method is  setOperationName().  Your code
re-written:

public class TestTheWebservice {
   public static void main(String [] args) throws
Exception {

               Service cocoonService = new
Service(new QName("Version"));

               Call cocoonCall =
(Call)cocoonService.createCall();
               URL localEndpoint = new
URL("http://localhost:8081/cocoon.orig/samples/blocks/axis/rpcrouter";);


cocoonCall.setTargetEndpointAddress(localEndpoint); // set SOAPAction

cocoonCall.setSOAPActionURI("Version");
               //cocoonCall.setPortName(new
QName("Version"));
      cocoonCall.setOperationName(new
QName("Version", "getVersion"));

              // inserting inside {} becomes
<args0>xxx</args0>
               String resultCocoon =
(String)cocoonCall.invoke(new Object [] {});
     System.out.println("  result: " + resultCocoon);

       }
}



__________________________________
Do you Yahoo!?
Check out the new Yahoo! Front Page.
www.yahoo.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]


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



Reply via email to