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 Anton Kraev <kr...@syndesis.com> on 2002/05/03 18:13:41 UTC

axis - soap:lite interoperability



           Hello, I am a newbie to axis. I am trying to
           interoperate axis
           java server and soap::lite client. At this point, I already
           tested the
           interoperability of simple datatypes (it works) and now I
           want to pass
           complex datatype, array of structures.

           all my server datatypes are in custom namespace
           (http://datatypes.portal.creator.syndesis.com), this is from
           axis
           deployment descriptor, note xmlns attribute:

           ------snip-------
           <typeMapping
           xmlns:ns="http://datatypes.portal.creator.syndesis.com"
           qname="ns:SearchCriteria"


type="java:com.syndesis.creator.portal.datatypes.SearchCriteriaItem[]"


serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"


deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
           />
           ------snip-------

           This is the client source code (I tried both SOAP::Data
approach and
           plain perl structure approach):

           ------snip-------
           use Class::Struct;
           struct( SearchCriteriaItem => {
           Name => '$',
           Value => '$',
           });

           my $sc = new SearchCriteriaItem;
           $sc->Name("srname");
           $sc->Value("*");

           my $dt = [SOAP::Data->name("SearchCriteriaItem" => $sc)];
           use SOAP::Lite +trace => all;

           my $soap = SOAP::Lite ->

service('file:/disk2/act41/WebGUI/tomcat/webapps/axis/test.wsdl');



#$soap->serializer->prefix("http://test.portal.creator.syndesis.com");


#$soap->serializer->uri("http://test.portal.creator.syndesis.com");


           #print $soap ->
           query('SRntNetwork',[SOAP::Data->name("SearchCriteriaItem" =>

           [SOAP::Data->name("Name" => "srname"),
SOAP::Data->name("Value" =>
           "*")])]);
           $a = [{Name => 'srname', Value => '*'}];
           print $soap -> query('SRntNetwork',$dt);
           ------snip-------

           All fails because of the following problem:
           Namespaces coming from perl (client side):

           xmlns:namesp2="http://xml.apache.org/xml-soap" (for
SOAPStruct, this
           namespace is hardcoded)
           xmlns:namesp2="http://namespaces.soaplite.com/perl (for any
other
           generic SOAP::Data array or structure coming from perl side)

           This is what we get as a result of namespace incompatibility
on server
           side:
           <faultstring>org.xml.sax.SAXException: No deserializer
defined for
           array type

http://namespaces.soaplite.com/perl:SearchCriteriaItem</faultstring>

           As far as I understand, I have two options:

           1) on server-side, generate all datatypes to be in soap::lite

           namespace, so that they can be properly deserialized. But
this
           approach means that for every client I want to support I need
a
           different server with different namespace, and this is not
real
           interoperability.

           2) make soap::lite specify server-side namespace in
serialization
           somehow.

           Could someone please clarify on that, because right now
           interoperability seems no more than a hype to me.

           Thanks, Anton.