You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Duffiana Jones <cd...@polydeme.fr> on 2001/05/14 18:01:06 UTC

Base64 encoding / SMTP2HTTP bridge/ (in)compatibility with SOAP::Lite

Hi all,

I have a working Apache SOAP server side : an HTTP endpoint service
implementing a foo(String ) method  that I can successfully call over
HTTP transport from both java clients (Apache SOAP) and Perl clients
(SOAP::Lite).

But, as I need to achieve an asynchronous call, I managed to use SMTP
transport via the SMTP2HTTPBridge class, and doing so started me facing 
encoding/marshalling troubles.

First try: 
the perl client was sending a Base64 encoded message (mail body), while
SMTP2HTTP bridge expects literal XML input (the server side was
complaining about parsing error, as if it was trying to directly parse
the b64 encoded text).  

Next try:
So, as a fix, and with help from P.Kulchenko, we made the client side
sending a message that a parser would like, ie a textual representation
of the SOAP call xml tree (forcing SOA::Lite side to binary encoding,
which is not a so good idea). As consequences I get the following :
- the mail body within the recipient is human (and parser) readable,
while the content-encoding SMTP header is set to binary.
- on server side, parsing seems to go fine, but I get a
NoSuchMethodException : the method defined server side (in the Java
class that implements the service) and called client side is
hello(String), while the exception complains about a
hello(org.apache.soap.Envelope,org.apache.soap.rpc.SOAPContext,org.apache.soap.rpc.SOAPContext)
-- no signature match !?

rem : I have no <isd:mapping> elements within my deployment descriptor,
and I'm such new to SOAP that I don't know if that may be within my
troubles scope or not :(

May be the perl implementation(SOAP::Lite) delivers Base-64 encoded
messages (the whole mail body, I mean the whole mail except the SMTP
headers, that btw appear to be stirctly correct, ie. they set the
content-encoding and content-type headers to appropriate values) while
server side (Apache SOAP) expects a text reprersentation of the XML SOAP
tree (with which encoding ?) and use Base-64 encoding only for the soap
body element or for parameters values marshalling like
<foo:bar>JTH76Juyt5tT==</foo:bar>.

AFAIK the SOAP specs do not cover SMTP transport, and implementations
may be incompatibles : am I facing such a thing ? If this is the case,
and as both implementations are nice (Apache SOAP and SOAP::Lite), can't
we make them interoperables ? I think that may not require such a big
work, as they seem to _be_ inetroperable using HTTP transport, the
missing part would only be the SMTP integration (i don't say YOU do, I
use, i want help this way, but before I need to understand deeper).
Or does this compatibility need a better encoding configuration than the
one I did ? 

BTW, as I'm not sure what I guess from the general SOAP specs, is there
a place where I can find a mapping table for perl and java types (I can
currently be happy with native types and arrays of them) ?

As I'm far from a soap guru, I may also face side effects for
misconfiguration (I think again about my deployment descriptor no seting
any <isd:mapping> element) or misunderstanding of SOAP marshalling, so
correct me (please) if I said big mistakes.  

What confuses me the most, is that the stuff works when I use the HTTP
transport on SOAP::Lite side ... troubles appear only with SMTP2HTTP
bridge integration.

I actualy have two chances :
- make the bridge accpeting Base64-encoded input messages by better
configuration, which may resolve my troubles (if my side effects theory
is correct ?)
- find out why server side complains about the method signatures, may be
there's a real problem here ...

I reproduce the exact mail content at the end of my post. If someone has
5 minutes to read it, just to see if there's nothing obvious that I
miss, it would be great :) 

I'm so confused that any comments, suggestions, pointers, FAQs, support,
miracle is very more than welcome.


regards,
duf.



------------------------ The mail that don't please SMTP2HTTP bridge
-----------------------------------

>From cdufaza@polydeme.fr  Mon May 14 18:19:05 2001
Return-Path: <cd...@polydeme.fr>
Received: from safi.polydeme.fr (IDENT:root@safi.polydeme.fr
[192.168.1.156])
	by safi.polydeme.fr (8.11.0/8.11.0) with ESMTP id f4EDIt022571
	for <so...@safi.polydeme.fr>; Mon, 14 May 2001 18:19:05 +0500
Message-Id: <20...@safi.polydeme.fr>
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Type: text/xml
MIME-Version: 1.0
Date: Mon, 14 May 2001 13:18:55 UT
To: soap@safi.polydeme.fr
From: cdufaza@polydeme.fr
Subject: SOAP request
X-Mailer: SOAP::Lite/Perl/0.47
Soapaction: "urn:WebConfirming#hello"
Status: RO

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"><SOAP-ENV:Body><namesp1:hello
xmlns:namesp1="urn:WebConfirming"><c-gensym5 xsi:type="xsd:string">John
B. Good</c-gensym5></namesp1:hello></SOAP-ENV:Body></SOAP-ENV:Envelope>

---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org