[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

.Net - Apache interop - base64/Base64Binary and 1999/2001 namespace confusion

(Andreas Falck)

1/21/2003 10:17:00 PM

I have written a C#.Net client in order to access a remote
web service running on Apache (over which I have neither
control nor possession). They seem to disagree on how to
encode binary data. Apache uses the base64 type to encode
(java) byte[], while C#.Net insists on using base64Binary to
encode its System.Byte[].

1. When invoking a web service method returning (an object
which encapsulates) a byte[], the .Net client fails:

"System.InvalidOperationException: There is an error in XML
document (8, 10). ---> System.InvalidCastException: Cannot
assign object of type System.Xml.XmlNode[] to an object of
type SignResult."

2. Invoking a web service method having byte[] as input
parameter causes the Apache server to fail:

"No Deserializer found to deserialize a
'urn:SecureServerService:msisdn' using encoding style '
http://schemas.xmlsoap.org/soap...&#...

I've noted that the namespaces differ:
www.w3.org/2001/XMLSchema (.Net) vs.
www.w3.org/1999/XMLSchema (Apache). Is this the source of
my troubles? Is it possible at all to exchange binary data
in an environment such as described here?

System versions are .Net framework 1.0.3705, Apache Soap 2.2
(supposedly). Soap traffic is enclosed below.

Best regards,
Andreas

___________________________________________________________________________

1. Request from Client

<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap=" http://schemas.xmlsoap.org/soap/envel...
xmlns:soapenc="
http://schemas.xmlsoap.org/soap/encod...
xmlns:tns="urn:SecureServerService"
xmlns:types="urn:SecureServerService/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-inst...
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><...
soap:encodingStyle="
http://schemas.xmlsoap.org/soap/encod...><tns:sign>
<in0 xsi:type="xsd:string">48210079</in0><in1
xsi:type="xsd:string">Signér for helvete!</in1><in2
xsi:type="xsd:string">http://no_such_url/</in2><in3
xsi:type="xsd:string">urn:spResponse</in3><in4
xsi:type="xsd:string">signResponse</in4></tns:sign>
</soap:Body></soap:Envelope> ChainStream

Response from Server

<?xml version='1.0' encoding='UTF-8'?> <SOAP-
ENV:Envelope xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envel... xmlns:xsi="
http://www.w3.org/1999/XMLSchema-inst... xmlns:xsd="
http://www.w3.org/1999/XMLSchema... <SOAP-ENV:Body>
<ns1:signResponse xmlns:ns1="urn:SecureServerService"
SOAP- ENV:encodingStyle="
http://schemas.xmlsoap.org/soap... "> <return
xsi:type="ns1:SignResult"> <unsignedBytes xmlns:ns2="
http://schemas.xmlsoap.org/soap/encod...
xsi:type="ns2:base64">
DgDyy28uc72TU8gu3yAOBFNpZ24FciBmb3IgaGVsdmV0ZSE=
</unsignedBytes> <sessionId xsi:type="xsd:string">
10144673</sessionId> </return> </ns1:signResponse>
</SOAP-ENV:Body> </SOAP-ENV:Envelope>

___________________________________________________________________________


2. Client response:

<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envel...
xmlns:soapenc="http://schemas.xmlsoap.org/soap...
" xmlns:tns="urn:SecureServerService"
xmlns:types="urn:SecureServerService/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-inst...
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><...
soap:encodingStyle="
http://schemas.xmlsoap.org/soap/encod...><tns:sign>
<in0 xsi:type="xsd:string">12345678</in0><in1
xsi:type="xsd:string">Please sign!</in1><in2
xsi:type="xsd:string">http://no_such_url/</in2><in3
xsi:type="xsd:string">urn:spResponse</in3><in4
xsi:type="xsd:string">signResponse</in4></tns:sign>
</soap:Body></soap:Envelope> ChainStream

Response from Server:

<?xml
version='1.0' encoding='UTF-8'?> <SOAP-ENV:Envelope
xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envel... xmlns:xsi="
http://www.w3.org/1999/XMLSchema-inst... xmlns:xsd="
http://www.w3.org/1999/XMLSchema... <SOAP-ENV:Body>
<ns1:signResponse xmlns:ns1="urn:SecureServerService"
SOAP- ENV:encodingStyle="
http://schemas.xmlsoap.org/soap... "> <return
xsi:type="ns1:SignResult"> <unsignedBytes xmlns:ns2="
http://schemas.xmlsoap.org/soap/encod...
xsi:type="ns2:base64">
DgDyy4ZQcViRCIe2MyKPBFNpZ24FciBmb3IgaGVsdmV0ZSE=
</unsignedBytes> <sessionId xsi:type="xsd:string">
10144681</sessionId> </return> </ns1:signResponse>
</SOAP- ENV:Body> </SOAP-ENV:Envelope>

___________________________________________________________________________