Hi Fabricio,
I'm new to axis, but I got the following to work. I think
this is what you want.
-dexter
--- On Sat 03/20, Fabricio B. Teixeira < [EMAIL PROTECTED] > wrote:
From: Fabricio B. Teixeira [mailto: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Date: Sat, 20 Mar 2004 17:18:07 -0300
Subject: Using <bean mapping>
Hi,<br><br>I�ve developed a web service and I am trying to call it, but the
following<br>error is raised: java.io.IOException: No serializer found for
class<br>QuerySequence in registry [EMAIL PROTECTED]<br>Looking at the web I found out
that the WSDD file should have a<br><beanMapping> tag. Is It rigth? What shoud I
do?<br><br>********My java class which is my web service is**********<br><br>public
class RestoreQuerySequence {<br><br> public QuerySequence Restore(String FastaFile)
{<br><br> String line, query_def = null; <br> String query_seq = null;<br>
String str = ">gi|13431740|sp|P57794|NIFS_ACEDI Cysteine desulfurase<br>(Nitrogenase
metalloclusters biosynthesis protein<br>nifS)\n" +<br>
<br>"MNAVYLDNNATTRVDPAAVSAMLPFFTEQFGNASSMHAFGAEVGGALHTARRQLQALLGAEFDHEIVYTA\n" +<br>
<br>"GGTESDNTAILSALETQAGRNEIVTSAVEHPAVLALCAWLEKTRGTRVHYIGVDARGRLDIDAYRRALSP\n";<br>...<br>
<br> while (line != null) {<br> ... <br> } //while<br><br>
qs.setDefinition(query_def);<br> qs.setSequence(query_seq);<br><br> }<br>
catch (IOException e) {<br> System.out.println("Arquivo Fasta n�o encontrado!");
<br> }<br><br> return qs;<br> }<br> <br>}<br><br>*********The
QuerySequence class is:**************<br><br>public class QuerySequence {<br>
<br> private String fDefinition;<br> private String fSequence;<br> <br> <br>
public String getDefinition() {<br> return fDefinition;<br> }<br><br> public
String getSequence() {<br> return fSequence;<br> }<br><br> public void
setDefinition(String string) {<br> fDefinition = string;<br> }<br><br> public
void setSequence(String string) {<br> fSequence = string;<br>
}<br><br>}<br><br>*********And the WSDD is: **************<br><br><deployment
xmlns="http://xml.apache.org/axis/wsdd/" <br>
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"><br><br> <service
name="RestoreQuerySequence" provider="java:RPC"><br> <br> <requestFlow><br>
<handler type="soapmonitor"/><br> </requestFlow> <br><br> <responseFlow><br>
<handler type="soapmonitor"/><br> </responseFlow><br><br> <parameter
name="className" value="RestoreQuerySequence"/><br> <parameter
name="allowedMethods" value="*"/><br><br>
</service><br><br></deployment><br><br><br>Thanks for everything,<br><br>Fabricio B.
Teixeira<br><br>Attachment: winmail.dat (3.62KB)<br>
_______________________________________________
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Axis" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package samples.userguide.example5;
public class BeanService
{
public QuerySequence Restore(String FastaFile)
{
QuerySequence qs = new QuerySequence();
qs.setFDefinition("Hello");
qs.setFSequence("World");
return qs;
}
}
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Axis" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package samples.userguide.example5;
import org.apache.axis.AxisFault;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.utils.Options;
import org.apache.axis.encoding.XMLType;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
public class Client
{
public static void main(String [] args) throws Exception
{
Options options = new Options(args);
Object ret = null;
Service service = new Service();
Call call = (Call) service.createCall();
QName qn = new QName( "urn:BeanService", "QuerySequence" );
call.registerTypeMapping(QuerySequence.class, qn,
new
org.apache.axis.encoding.ser.BeanSerializerFactory(QuerySequence.class, qn),
new
org.apache.axis.encoding.ser.BeanDeserializerFactory(QuerySequence.class, qn));
String result;
try {
call.setTargetEndpointAddress( new java.net.URL(options.getURL()) );
call.setOperationName( new QName("OrderProcessor2", "Restore") );
call.addParameter( "arg1", XMLType.XSD_STRING, ParameterMode.IN);
call.setReturnClass(QuerySequence.class);
ret = call.invoke( new Object[] { "test" } );
} catch (AxisFault fault) {
result = "Error : " + fault.toString();
}
//System.out.println(result);
QuerySequence qs = (QuerySequence)ret;
System.out.println(qs.getFDefinition() + ":" + qs.getFSequence());
}
}
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="OrderProcessor2" provider="java:RPC">
<parameter name="className" value="samples.userguide.example5.BeanService"/>
<parameter name="allowedMethods" value="Restore"/>
<beanMapping qname="myNS:QuerySequence" xmlns:myNS="urn:BeanService"
languageSpecificType="java:samples.userguide.example5.QuerySequence"/>
</service>
</deployment>
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Axis" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package samples.userguide.example5;
/** This is a JavaBean which represents an order for some products.
*
* @author Glen Daniels ([EMAIL PROTECTED])
*/
public class QuerySequence
{
private String fDefinition;
private String fSequence;
public String getFDefinition() {
return fDefinition;
}
public String getFSequence() {
return fSequence;
}
public void setFDefinition(String string) {
fDefinition = string;
}
public void setFSequence(String string) {
fSequence = string;
}
}