Take a look at org.apache.axis2.Axis2SampleDocLitServiceStub.java for the 
following example code
(I took a peek at it in between watching the World Cup)

From what I can see you need to establish array of NameOfAxisOperation [] in 
this fashion

//establish Array of AxisOperations on stack
protected static org.apache.axis2.description.AxisOperation[] _operations;

//Allocate the necessary byes from heap for all Operations
_operations = new org.apache.axis2.description.AxisOperation[3];

//Create the service
 _service = new 
org.apache.axis2.description.AxisService("Axis2SampleDocLitService");

//Create the operations
org.apache.axis2.description.AxisOperation __operation;

//Define if this operation is Request and Response or Just Request
__operation = new org.apache.axis2.description.OutInAxisOperation();
//set the operation name
__operation.setName(new javax.xml.namespace.QName("", "NameOfAxisOperation"));

//Add the configured operation to your array of operations
_operations[0]=__operation;
//Add the operation to the service
_service.addOperation(__operation);

//Establish a new client to the service
_serviceClient = new 
org.apache.axis2.client.ServiceClient(configurationContext,_service);

//Establish a new endpoint..
final EndpointReference targetEPR = new 
EndpointReference("http://localhost:8080/pfappspabxutils";);
//Assign the _serviceClient's options to accept the new endpont
_serviceClient.getOptions().setTo(new 
org.apache.axis2.addressing.EndpointReference(targetEPR));

try
{
    org.apache.axis2.client.OperationClient _operationClient = 
_serviceClient.createClient(_operations[0].getName());
    _operationClient.getOptions().setAction("NameOfAxisOperation");
//enable this (true) if you have properly configured your SOAPFault
// _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);

// create SOAP envelope
   org.apache.axiom.soap.SOAPEnvelope env = null;

org.apache.axis2.Axis2SampleDocLitServiceStub.NameOfAxisOperationParam param6   
                 
//Style is Doc.

//Establish the envelope   ..be careful with the QName 1st parameter which 
indicates the namespace                                 
org.apache.axiom.soap.SOAPEnvelope env = 
toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
                                                param6,
                                                optimizeContent(new 
javax.xml.namespace.QName("",
                                                "NameofAxisOperation")));
                                            

// create message context 
org.apache.axis2.context.MessageContext _messageContext = new 
org.apache.axis2.context.MessageContext() ;
//associate the envelope with the created MessageContext
_messageContext.setEnvelope(env);

// add the message context to the operation client
_operationClient.addMessageContext(_messageContext);

//execute the operation client
_operationClient.execute(true);

//Acquire the messageContext returned
org.apache.axis2.context.MessageContext _returnMessageContext = 
_operationClient.getMessageContext(
                                           
org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);

//Acquire the returned envelope
 org.apache.axiom.soap.SOAPEnvelope _returnEnv = 
_returnMessageContext.getEnvelope();

//Pull back the 'Object' Model part for later retrieval
java.lang.Object object = fromOM(getElement(_returnEnv,"rpc"),
} //end try
catch(org.apache.axis2.AxisFault f)
{ //put out the appropriate Fault Message
            org.apache.axiom.om.OMElement faultElt = f.getDetail();
}

Bon Chance!
Martin --
                


*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



----- Original Message ----- 
From: "Bruno Negrao" <[EMAIL PROTECTED]>
To: <[email protected]>; "Martin Gainty" <[EMAIL PROTECTED]>
Sent: Sunday, July 09, 2006 11:07 AM
Subject: Re: Bug? Cannot instantiate AxisOperation object


> Good morning Martin. I'm not using a wsdl for this test. TestAgenda
> class is attached.
> try it out there in your machine and tell me what happens.
> I already installed the latest nightly build and I'm still having the error.
> 
>> Can we see the code for TestAgenda (line 46 specifically)
> on line 46 is the code:
> 
> AxisOperation agendaPesquisa =  new AxisOperation();
> 
> thank you,
> bruno
>


--------------------------------------------------------------------------------


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

Reply via email to