You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Bounds, Daniel (DBOUNDS)" <DB...@arinc.com> on 2007/04/11 17:51:52 UTC
Problem serializing
All,
I'm trying write an adapter for an email server that calls a web
service. My application first retrieves and email from a POP3 server
then encodes the email into and XML format. The format is defined by
Mail.xsd supplied by Oracle. I used the Mail.xsd and jaxb to create all
of my stub code to encode the email to XML. That works great.
When I try to invoke the web service I get the following error:
WebServicesManager.java:140) - RemoteException in invokeCall()
java.io.IOException: No serializer found for class
com.oracle.services.bpel.mail.impl.MailMessageTypeImpl in registry
org.apache.axis.encoding.TypeMappingDelegate@140984b
This is the code I have for calling the web service:
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.log4j.Logger;
import javax.xml.rpc.ServiceException;
import java.rmi.RemoteException;
import javax.xml.namespace.QName;
import com.oracle.services.bpel.mail.MailMessageType;
static org.apache.axis.description.OperationDesc [] operations;
static {
operations = new org.apache.axis.description.OperationDesc[1];
initOperation();
}
private static void initOperation(){
org.apache.axis.description.OperationDesc oper;
org.apache.axis.description.ParameterDesc param;
oper = new org.apache.axis.description.OperationDesc();
oper.setName("initiate");
param = new org.apache.axis.description.ParameterDesc(new
javax.xml.namespace.QName("http://services.oracle.com/bpel/mail",
"mailMessage"), org.apache.axis.description.ParameterDesc.IN, new
javax.xml.namespace.QName("http://services.oracle.com/bpel/mail",
"MailMessageType"), com.oracle.services.bpel.mail.MailMessageType.class,
false, false);
oper.addParameter(param);
oper.setReturnType(XMLType.XSD_STRING);
oper.setReturnType(org.apache.axis.encoding.XMLType.AXIS_VOID);
oper.setStyle(org.apache.axis.constants.Style.RPC);
oper.setUse(org.apache.axis.constants.Use.LITERAL);
operations[0] = oper;
}
public String invokeCall(MailMessageType payload)
{
String rval = new String();
try
{
service = new Service();
call = (Call) service.createCall();
call.setOperation(operations[0]);
call.setTargetEndpointAddress(new java.net.URL(http://myaddess
<http://myaddess/> ));
call.setOperationName("mymethod");
rval = (String) call.invoke( new Object [] {payload});
}
catch (RemoteException re)
{
logger.error("RemoteException in invokeCall() " + re.toString());
}
return rval;
}
I understand that I can't just ask Axis to serialize my MailMessageType,
but I'm not sure how to do that. I haven't marhsalled anything in my
code that create the XML document. It looks like the code that JAXB
created includes code to serialize.
Anyone have any ideas?
Thanks,
-Dan