axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 10824] New: - dynamic proxy client has problem with beans
Date Mon, 15 Jul 2002 13:35:29 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10824>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10824

dynamic proxy client has problem with beans

           Summary: dynamic proxy client has problem with beans
           Product: Axis
           Version: current (nightly)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Serialization/Deserialization
        AssignedTo: axis-dev@xml.apache.org
        ReportedBy: cchabanois@cognicase.fr


Note : I tested with beta-3 version but beta-3 is not proposed in "Version"
listbox in Bugzilla ...

I have a service that takes a bean as parameter.
I deployed it using Axis.
I got wsdl using "http://localhost:8080/axis/services/Address?wsdl". The wsdl I
got was good. 

When I tried to use my dynamic proxy client, I got the following error :
"
- Mapping Exception to AxisFault
AxisFault
 faultCode: {http://xml.apache.org/axis/}Server.userException
 faultString: java.io.IOException: No serializer found for class
address.AddressBean in registry org.apache.axis.encoding.TypeMappingImpl@2ba11b
 faultActor: null
 faultDetail: ...
"

I tried then to use JAX-RPC RI from Sun (with my service running on Axis)
>java address.AddressClient
Your street : 55, rue des Lilas
Your postCode : 75005
Which is the result that is intended.

here is the interface :
========================
package address;

public interface AddressService extends java.rmi.Remote {
    public String updateAddress(AddressBean addressBean, int newPostCode) throws
javax.xml.rpc.ServiceException;
}

Here is the implementation :
============================
package address;

public class AddressServiceImpl implements  AddressService 
{    

    public String updateAddress(AddressBean addressBean, int newPostCode) throws
javax.xml.rpc.ServiceException
    {
	addressBean.setPostcode(newPostCode);
	return("Your street : "+addressBean.getStreet()+"\nYour postCode : "+newPostCode);
    }
}

Here is the bean :
================
package address;

public class AddressBean  implements java.io.Serializable {
    private java.lang.String street;
    private int postcode;

    public AddressBean() {    }
    public java.lang.String getStreet() {return street;}
    public void setStreet(java.lang.String street) { this.street = street; }
    public int getPostcode() { return postcode; }
    public void setPostcode(int postcode) {this.postcode = postcode; }
}

And the wsdd :
==============
<deployment
    xmlns="http://xml.apache.org/axis/wsdd/"
    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

  <service name="Address" provider="java:RPC">
      <parameter name="className" value="address.AddressServiceImpl"/>
      <parameter name="wsdlTargetNamespace" value="http://soapNcl/address/"/>
      <beanMapping qname="ns:AddressBean" xmlns:ns="http://soapNcl/address/"
                   languageSpecificType="java:address.AddressBean"/>
      <operation name="updateAddress">
        <parameter name="addressBean"/>
	<parameter name="newPostCode"/>
      </operation>
      <parameter name="allowedMethods" value="updateAddress"/>
  </service>
</deployment>


And the client  (dynamic proxy client)
=======================================
package address;
import java.net.*;
import javax.xml.rpc.*;
import javax.xml.namespace.QName;

public class AddressClient
{
  public static void main(String[] args)
  {
    try
    {
      URL urlWsdl = new URL("http://localhost:8080/axis/services/Address?wsdl");
      String nameSpaceUri = "http://soapNcl/address/";
      String serviceName = "AddressServiceImplService";
      String portName = "Address";

      ServiceFactory serviceFactory = ServiceFactory.newInstance();
      Service service = serviceFactory.createService(urlWsdl,new
QName(nameSpaceUri, serviceName));	    
      AddressService myProxy = (AddressService) service.getPort(new
QName(nameSpaceUri, portName), AddressService.class);
      AddressBean addressBean = new AddressBean();
      addressBean.setStreet("55, rue des Lilas");
      System.out.println(myProxy.updateAddress(addressBean, 75005));
 
    } catch (Exception e)
    {
      e.printStackTrace();
    }
  }	  
}

Mime
View raw message