Server deserializer problem.

Hi all,

I have read through the examples and FAQ regarding
"How do I send user defined java objects using SOAP?"
and am still encountering a deserializer problem on
the server. The faultString: "No Deserializer found
to deserialize a 'urn://org.mitre.mii:foo' using
encoding style
'http://schemas.xmlsoap.org/soap/encoding/'"

I am running Tomcat 4.0.1.
Web Application 1 is the SOAP server called pdc_soap.war
Web Application 2 is called pdc.war

My client application makes a SOAP RPC to the SOAP
server running in Web App 1. The RPC invokes a method
on a Java object running in Web App 2.

I have created a very simple test RPC that has Web App 1
making a call to an object on Web App 2. It expects a
String as a parameter and returns a String result.
This works so I am assuming that my SOAP/Tomcat
installation is correct?

Any thoughts as to what is causing this faultString?
I have reviewed the deployment descriptor and
SOAPMappingRegistry and can't see any obvious errors.

Any help would be great.

-thanks
-matt




// *******************
// * DeploymentDescriptor.xml
// *******************
<isd:service
     xmlns:isd="http://xml.apache.org/xml-soap/deployment";
     id="urn:project">
  <isd:provider type="java" scope="Request" methods="query">
    <isd:java class="org.mitre.mii.project.test.Foo" static="false"/>
  </isd:provider>
  
<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>

  <isd:mappings>
    <isd:map
         encodingStyle="http://schemas.xmlsoap.org/soap/encoding";
         xmlns:x="urn://org.mitre.mii"
         qname="x:foo"
         javaType="org.mitre.mii.project.test.Foo"
         java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
         
xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
  </isd:mappings>
</isd:service>




// *******************
// * SOAP RPC
// *******************
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
  xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance";
  xmlns:xsd="http://www.w3.org/1999/XMLSchema";>
<SOAP-ENV:Body>
<ns1:query
  xmlns:ns1="urn:project"
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
  <foo xmlns:ns2="urn://org.mitre.mii" xsi:type="ns2:foo">
    <bar xsi:type="xsd:string" xsi:null="true"/>
  </foo>
</ns1:query>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>




// **********************
// * Client Java application.
// **********************
Foo foo = new Foo();

Vector params = new Vector();
params.addElement(new Parameter
    ("foo", Foo.class, foo, null));

SOAPMappingRegistry fooMapping = new SOAPMappingRegistry();
BeanSerializer beanSerializer = new BeanSerializer();

// Map the types.
fooMapping.mapTypes
    (Constants.NS_URI_SOAP_ENC,
     new QName("urn://org.mitre.mii", "foo"),
     org.mitre.mii.project.test.Foo.class,
     beanSerializer,
     beanSerializer);

Call call = new Call();
call.setTargetObjectURI(targetObjectUri);
call.setMethodName(methodName);
call.setSOAPMappingRegistry(fooMapping);
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
call.setParams(params);






Reply via email to