axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Dillon (ext. 944)" <Brian.Dil...@fineos.com>
Subject RE: INOUT / OUT parameters
Date Thu, 28 Nov 2002 15:33:33 GMT
Cedric,

At the moment I have a WSDD which defines;

      <operation name="myTestCall">
        <parameter nane="myStr" type="tns:string"
        xmlns:tns="http://www.w3.org/2001/XMLSchema" mode="INOUT"/>
      </operation>

In my Implementation code I have a method with signature;

    public String myTestCall(StringHolder in0) throws
java.rmi.RemoteException;

This seems to deploy ok (and the WSDL looks ok i.e. it has a response type
which contains an extra String for the INOUT parameter).

  <wsdl:message name="myTestCallResponse">
    <wsdl:part name="myTestCallReturn" type="xsd:string"/>
    <wsdl:part type="xsd:string"/>
  </wsdl:message>

My problem is, since I am not using generated stubs and skeletons how should
my client call the service ?

This is what I am using;

           cll.addParameter("testParam",
                             org.apache.axis.Constants.XSD_STRING,
                             javax.xml.rpc.ParameterMode.INOUT);
	     cll.setReturnType(org.apache.axis.Constants.XSD_STRING);
           String strXmlOid = "Some arbitrary string";
           javax.xml.rpc.holders.StringHolder xmlOid = new
javax.xml.rpc.holders.StringHolder(strXmlOid);
           String ret = (String) cll.invoke( new Object[] {xmlOid} );

But I get the exception 


	- Mapping Exception to AxisFault
	AxisFault
	 faultCode: {http://xml.apache.org/axis/}Server.userException
	 faultString: java.io.IOException: No serializer found for class
javax.xml.rpc.holders.StringHolder
	in registry org.apache.axis.encoding.TypeMappingImpl@26f75b
	 faultActor: null
	 faultDetail:
	        stackTrace: java.io.IOException: No serializer found for
class javax.xml.rpc.holders.StringH
	older in registry org.apache.axis.encoding.TypeMappingImpl@26f75b
	        at
org.apache.axis.encoding.SerializationContextImpl.serializeActual(Serializat
ionContextImp

This is why I presumed originally that I might need a serializer, but If I
don't do you know what I am doing wrong ?

Thanks,

Brian
-----Original Message-----
From: Cédric Chabanois [mailto:CChabanois@cognicase.fr]
Sent: 28 November 2002 14:55
To: 'axis-user@xml.apache.org'
Subject: RE: INOUT / OUT parameters


> Hi,
> 
> Has anyone used OUT/INOUT parameters in an Axis SOAP service 
> before ? If so;

Me and it works well.
 
> Do you need to provide Serializers/Deserializers to cope with 
> the Handlers ?
> 
> If I want to use a String (or other basic type) as an INOUT 
> parameter should
> I be using 'avax.xml.rpc.holders.StringHolder' and is there already a
> (de)serialiser for this ?

For string, the holder class is javax.xml.rpc.holders.StringHolder. Many
holders are already defined in javax.xml.rpc.holders
You don't need to provide a serialiser (even if you use a bean holder or
array holder but you will need to write your holder classes in these cases)

> What should the WSDD look like ?

something like :

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

  <service name="TEST3" provider="java:RPC">
    <parameter name="allowedMethods" value="*"/>
    <parameter name="wsdlPortType" value="TEST3"/>
    <parameter name="wsdlTargetNamespace" value="http://soapNcl/TEST3/"/>
    <parameter name="className"
value="fr.cognicase.webservices.TEST3.TEST3BindingImpl"/>
      <beanMapping qname="ns:SEG1Bean" xmlns:ns="http://soapNcl/TEST3/"
 
languageSpecificType="java:fr.cognicase.webservices.COMMON.SEG1Bean"/>

      <operation name="MODIFYCSTRING" >
        <parameter name="PARAM" mode="INOUT"/>
      </operation>
      <operation name="MODIFYINT4" >
        <parameter name="PARAM" mode="INOUT"/>
      </operation>
      <operation name="MODIFYNUM4" >
        <parameter name="PARAM" mode="INOUT"/>
      </operation>
      <operation name="MODIFYSEG" >
        <parameter name="PARAM" mode="INOUT"/>
      </operation>
  </service>
</deployment>

Cédric Chabanois


**************************************************************************
The information contained in this e-mail is confidential,
may be privileged and is intended only for the use of the
recipient named above. If you are not the intended
recipient or a representative of the intended recipient,
you have received this e-mail in error and must not copy,
use or disclose the contents of this email to anybody
else. If you have received this e-mail in error, please
notify the sender immediately by return e-mail and
permanently delete the copy you received. This email has
been swept for computer viruses. However, you should
carry out your own virus checks.


Registered in Ireland, No. 205721. http://www.FINEOS.com
**************************************************************************


Mime
View raw message