Can someone tell me why I get a "I only know how to serialize an org.w3c.dom.Element" when I call this remote method via SOAP?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sharon_Well
Posted On:   Friday, April 19, 2002 01:45 PM

I am passing xml as a string, and using encodingStyle "LITERAL", which is what you are supposed to do to NOT get that error. public Boolean SaveComponents(String CompDoc, String username,String encodepassword) throws Exception { Boolean returnVal = null; URL endpointURL = new URL(endpoint); Call call = new Call(); call.setSOAPTransport(m_httpConnection); call.setTargetObjectURI("urn:MedleyManager"); call.setMethodName("SaveMedleyAndComponents"); //call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML); Vector params = new Vector(); params.addElement(new Parameter("CompDoc",Element.class, CompDoc,Constants.N   More>>

I am passing xml as a string, and using encodingStyle "LITERAL", which is what you are supposed to do to NOT get that error.


public Boolean SaveComponents(String CompDoc,
String username,String encodepassword) throws Exception


{
Boolean returnVal = null;

URL endpointURL = new URL(endpoint);
Call call = new Call();
call.setSOAPTransport(m_httpConnection);
call.setTargetObjectURI("urn:MedleyManager");
call.setMethodName("SaveMedleyAndComponents");
//call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);
Vector params = new Vector();
params.addElement(new Parameter("CompDoc",Element.class, CompDoc,Constants.NS_URI_LITERAL_XML));
params.addElement(new Parameter("username",String.class,username, Constants.NS_URI_SOAP_ENC));
params.addElement(new Parameter("encodepassword",String.class,encodepassword, Constants.NS_URI_SOAP_ENC));
call.setParams(params);

Response response = call.invoke(endpointURL, "");

if (!response.generatedFault())
{
Parameter result = response.getReturnValue();
returnVal = (Boolean)result.getValue();
}
else
{
Fault fault = response.getFault();
throw new SOAPException(fault.getFaultCode(), fault.getFaultString());
}

return returnVal;

}

Thanks,
Sharon.

   <<Less
About | Sitemap | Contact