Loading ...
Sorry, an error occurred while loading the content.

Using apache soap to access SOAP::Lite server

Expand Messages
  • Steve Prior
    I ve got a SOAP server written using SOAP::Lite and I m trying to access it from Java using Apache SOAP, but get the following error when I try to connect. It
    Message 1 of 2 , Feb 15, 2003
    • 0 Attachment
      I've got a SOAP server written using SOAP::Lite and I'm trying to
      access it from Java using Apache SOAP, but get the following error
      when I try to connect. It seems like the client and server aren't
      using the same encoding style. Can anyone steer me in the right
      direction to fix this problem?

      Thanks
      Steve Prior

      C:\>java Client


      Calling the SOAP Server to say hello


      The SOAP Server says: Exception in thread "main" [SOAPException: faultCode=SOAP-
      ENV:Client; msg=No Deserializer found to deserialize a 'http://xml.apache.org/xm
      l-soap:SOAPStruct' using encoding style 'http://schemas.xmlsoap.org/soap/encodin
      g/'.; targetException=java.lang.IllegalArgumentException: No Deserializer found
      to deserialize a 'http://xml.apache.org/xml-soap:SOAPStruct' using encoding styl
      e 'http://schemas.xmlsoap.org/soap/encoding/'.]
      at org.apache.soap.rpc.Call.invoke(Call.java:244)
      at Client.main(Client.java:25)
    • Martin Hajduch
      ... could you post the whole xml communication ? the message seems like you are returning complex data type (SOAPStruct) - is it a hash or something ? in such
      Message 2 of 2 , Feb 15, 2003
      • 0 Attachment
        > g/'.; targetException=java.lang.IllegalArgumentException: No
        > Deserializer found
        > to deserialize a 'http://xml.apache.org/xml-soap:SOAPStruct'
        > using encoding styl
        > e 'http://schemas.xmlsoap.org/soap/encoding/'.]

        could you post the whole xml communication ?
        the message seems like you are returning complex data type (SOAPStruct) -
        is it a hash or something ?
        in such case, you should have corresponding java classes and register them
        with axis

        if you want to use axis' 'generic' deserializer (the easy way), you have
        to create java bean-like classes (follow the bean naming convention) and
        then after creating call object:

        Call call = (Call)service.createCall();

        ... set endpoint & operation name here ...

        QName qn = new QName( "namespace of your object", "name of
        your object" );
        call.registerTypeMapping(Object.class, qn,
        new
        org.apache.axis.encoding.ser.BeanSerializerFactory(Object.class, qn),
        new
        org.apache.axis.encoding.ser.BeanDeserializerFactory(Object.class, qn));

        you should use your unique namespace & data type name, and set them in
        server properly (bless, etc...)

        regards,
        martin
      Your message has been successfully submitted and would be delivered to recipients shortly.