axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From francesco foresti <fraf...@tiscali.it>
Subject Message Receiver not found for AxisOperation
Date Thu, 11 Oct 2007 01:33:51 GMT

Hi,
i'm trying to access a deployed group of services,
which are shown as active, and i can see their wsld(s) (with
axis2-1.3 in three different versions: bin. war. nightly build);
however, every client i've written until now throws this kind of error (as 
follows), so what am i doing wrong?

thank you.


error message:

org.apache.axis2.AxisFault: Message Receiver not found for AxisOperation: 
getEtichetta

	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 org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)
	at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:508)
	at com.clients.direct.ProtocolClient.doIt(ProtocolClient.java:31)
	at com.clients.direct.ProtocolClient.getEtichetta(ProtocolClient.java:18)
	at com.clients.direct.ProtocolClient.main(ProtocolClient.java:112)

one of the implementation classes; this
one exposes only the getEtichetta method:

public final class Protocollatore implements ProtocolService {

  private static Protocollo protocollo;
  private static boolean set = false;

  public Protocollatore() {
	  if(!set) {
		  protocollo = new Protocollo();
		  set = true;
	  }
  }

  protected synchronized Protocollo getProtocollo ( ) {
	if(set){
	  protocollo.AddOne();
	  Protocollo p = new Protocollo(protocollo.getValue());
	  return p;
	} else return null;
  }

  public synchronized OMElement getEtichetta (OMElement _null) {
	  OMElement method = null;
	  try {
		  OMFactory fac = OMAbstractFactory.getOMFactory();
		  if(set){
			  protocollo.AddOne();
			  Etichetta e = new Etichetta(protocollo.getValue());
			  method = e.getOMElement();
		  } else {
			  OMNamespace ens = 
fac.createOMNamespace("http://soap-shop.com/error","error");
			  method = fac.createOMElement("InitFault", ens);
			  method.addChild(fac.createOMText(method, "Errore : Protocollatore non 
inizializzato"));
		  }	  
	  } catch (XMLStreamException xse) { 
		  System.out.println("Protocollatore.getEtichetta() : "+xse.toString());
	  } 
	  return method;  
  }

  protected synchronized Etichetta Etichetta ( ) {
	  if(set){
		  protocollo.AddOne();
		  Etichetta e = new Etichetta(protocollo.getValue());
		  return e;
	  }  else return null;  
  }
}

The client class for this service:

public class ProtocolClient {

	public static OMElement getEtichetta() throws AxisFault {
		OMElement payload = getNewOMElement("Etichetta");
		OMElement result = doIt(payload, "getEtichetta");
		return result;
	}
	
    private static EndpointReference targetEPR = 
          new EndpointReference(
            "http://localhost:8180/axis2/services/ProtocolService");

public static void main(String[] args) {
         try {
        	 OMElement payload = getNewOMElement("Vuoto");
        	 OMElement result = getEtichetta();
             String response = result.getFirstElement().getText();
         } catch (Exception e) { 
 			e.printStackTrace();
         }
	}

private static OMElement doIt(OMElement payload, String action) throws 
AxisFault {
		Options options = new Options();
		options.setTo(targetEPR);
		options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
		options.setAction("urn:"+action);
		ServiceClient sender = new ServiceClient();
		sender.setOptions(options);
	        OMElement result = sender.sendReceive(payload);
	        return result;
	}

private static OMElement getNewOMElement(String tag) {
	OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace omNs = 	
		fac.createOMNamespace("http://soap-shop.com/ProtocolService",
        	"ProtocolServiceNS");
        OMElement result = fac.createOMElement(tag,omNs);
        return result;
	}
}

the services.xml file:

<?xml version = '1.0' encoding = 'UTF-8'?>
<serviceGroup>
  <service name="AdminService" scope="application" >
    <description>Admin Service</description>
    <parameter name="ServiceClass" >com.business_logic.Admin</parameter>
    <operation name="evadiOrdine" >
 <messageReceivers>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" 
class="org.apache.axis2.receivers.RawXMLInOutMessageReceiver" />
</messageReceivers>
  <actionMapping>urn:evadiOrdine</actionMapping></operation>
    <operation name="inserisciProdotto" >
 <messageReceivers>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" 
class="org.apache.axis2.receivers.RawXMLInOutMessageReceiver" />
</messageReceivers>
        <actionMapping>urn:inserisciProdotto</actionMapping>
</operation>
  </service>
  <service name="ProtocolService" scope="application" >
    <description>Protocol Service</description>
    <parameter name="ServiceClass" >com.business_logic.Protocollatore
		</parameter>
    <operation name="getEtichetta" >
<messageReceivers>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" 
class="org.apache.axis2.receivers.RawXMLInOutMessageReceiver" />
</messageReceivers>
        <actionMapping>urn:getEtichetta</actionMapping>
 </operation>
  </service>
  <service name="CatalogService" scope="application" >
    <description>Catalog Service</description>
    <parameter name="ServiceClass" >com.business_logic.Catalogo
		</parameter>
    <operation name="getOMCatalog" >
      <messageReceivers>
        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" 
class="org.apache.axis2.receivers.RawXMLInOutMessageReceiver" />
      </messageReceivers>
      <actionMapping>urn:getOMCatalog</actionMapping>
    </operation>
  </service>
</serviceGroup>
-- 
===================================================================
Francesco Foresti
Registered Linux User #332599
key fingerprint = 59D5 1E61 6631 5DEF DC88 C64C 7F53 2F45 99FB CD21

Mime
View raw message