axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Beston" <alex.bes...@gmail.com>
Subject help with deserialization
Date Mon, 26 Mar 2007 23:29:33 GMT
Hi Axis people

heres my code ( see below) I have a

"Caught SOAPException (SOAP-ENV:Client): No Deserializer found to
deserialize a
'http://servers.core.tsNet:ns1:filterToServerReturn' using encoding style
'null';."

error. Im trying to get a string when I send a user name / pass / filter
type. its connecting ok but i cant get to the information,

I've set up a Foo.class to do that but the get / set methods would not
seem to be accessed by the BeanSerializer.

What do I need to deserialize properly?

thanks!

Alex

public class Foo {
	String filterToServerReturn;
	
	
	public Foo(String some){
		this.filterToServerReturn = null;
	}

	
	 public String getFoo()
	  {
	    return filterToServerReturn;
	  }

	  public void setFoo(String filterToServerReturn)
	  {
	    this.filterToServerReturn = filterToServerReturn;
	  }
}

//////

public static void main(String[] args) throws Exception
  {
    Foo something = new Foo("ha");
    // Process the arguments.
    URL url = new
URL("http://shallot.csd.abdn.ac.uk/CoreServers/services/FilterServer?wsdl");
    BeanSerializer beanSer = new BeanSerializer();
    SOAPMappingRegistry smr = new SOAPMappingRegistry();

    smr.mapTypes(Constants.NS_URI_SOAP_ENC,
                 new QName("urn:FilterServerService", "filterToServerReturn"),
                 Foo.class, beanSer, beanSer);

    Vector params = new Vector();


    params.addElement(new Parameter("userName", String.class, "guest", null));
    params.addElement(new Parameter("password", String.class, "guest", null));
    params.addElement(new Parameter("filterAsXML", String.class,
"JavaMean", null));


    // Build the call.
    Call call = new Call();
    call.setSOAPMappingRegistry(smr);
    call.setTargetObjectURI("urn:FilterServerService");
    call.setMethodName("filterToServer");
    call.setParams(params);

    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

    // Invoke the call.
    Response resp;

    try
    {
      resp = call.invoke(url, "");
    }
    catch (SOAPException e)
    {
      System.err.println("Caught SOAPException (" +
                         e.getFaultCode() + "): " +
                         e.getMessage());
      return;


    }

Mime
View raw message