Hello there,
SOAP specification leaves a lot of holes to achieve program
interoperability -- not as solid as OMG IIOP or Java RMI
or CMIP/SNMP network management protocol. Basically all
these distributed communication protocol follows rigid
on the wire data format:
OMG IIOP : Common Data Representation(CDR)
Java RMI : Java Remote Messaging Protocol(JRMP)
CMIP/SNMP : ASN.1 BER (ITU standard X.208/X.209)
I do not see why SOAP could not follow a rigid on the wire
data format(i.e encoding style). Maybe somebody knowledgable
could throw more light in this area.
Anyway I did a search in http://www.google.com/ for
"SOAP interoperability" and got a lot of URLs. You can see
for yourself. The most relevant one to your problem is:
http://www.perfectxml.com/articles/xml/soapguide.asp
Hope this helps.
Soumen Sarkar.
-----Original Message-----
From: Shih En-Yu
To: [EMAIL PROTECTED]
Sent: 7/24/01 7:15 PM
Subject: Apache SOAP client to MS.NET webservice problem
Hi there,
I'm trying to deploy a web-service using Microsoft .NET, and using
Apache Soap to make a soap request to the web-service. Here comes the
questions. When a client makes a request, server can understand the
request and process it. But client can't understand the soap message
that server responds. Below are the error message:
Caught SOAPException (SOAP-ENV:Client): No Deserializer found to
deserialize a
'http://tempuri.org/:result' using encoding style
'http://schemas.xmlsoap.org/s
oap/encoding/'.
I've seen many people ask this question before, and I know it is the
interoperability problem between each SOAP implementations. But I still
can't solve this problem. Below are my client program:
=================
client programe
=================
import java.io.*;
import java.util.*;
import java.net.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.*;
import org.apache.soap.encoding.*;
import org.apache.soap.encoding.soapenc.*;
import org.apache.soap.rpc.*;
public class test1
{
public test1()
{
try
{
URL rurl = new URL("
http://localhost:2020/math/WebSrv_Math.asmx
<http://localhost:2020/math/WebSrv_Math.asmx> ");
Call call = new Call ();
call.setTargetObjectURI (" http://tempuri.org/
<http://tempuri.org/> ");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
SOAPMappingRegistry smr = new SOAPMappingRegistry();
StringDeserializer sd = new StringDeserializer();
smr.mapTypes(Constants.NS_URI_SOAP_ENC,new
QName("","Result"),null,null,sd);
call.setSOAPMappingRegistry(smr);
Vector params = new Vector ();
params.addElement (new Parameter("ns1:num1", int.class, new
Integer(4),null));
params.addElement (new Parameter("ns1:num2", int.class, new
Integer(7),null));
call.setParams (params);
Response resp;
try
{
call.setMethodName ("Add");
resp = call.invoke (/* router URL */ rurl, /* actionURI */"
http://tempuri.org/Add <http://tempuri.org/Add> " );
}
catch (SOAPException se)
{
System.err.println("Caught 1 SOAPException (" +
se.getFaultCode() + "): " +
se.getMessage());
return;
}
if (resp.generatedFault ())
{
Fault fault = resp.getFault ();
System.out.println ("Ouch, the call failed: ");
System.out.println (" Fault Code = " + fault.getFaultCode
());
System.out.println (" Fault String = " +
fault.getFaultString ());
}
else
{
Parameter result = resp.getReturnValue ();
String value=(String)result.getValue();
}
// Check the response.
}catch (Exception ae) {}
}
public static void main(String args[])
{
test1 t=new test1();
}
}
And below are the soap message that the web service responds:
===========
responds
===========
Cache-Control: private, max-age=0
Content-Type: text/xml
Content-Length: 389
<?xml version="1.0"?>
<soap:Envelope xmlns:soap=" http://schemas.xmlsoap.org/soap/envelope/
<http://schemas.xmlsoap.org/soap/envelope/> " xmlns:soapenc="
http://schemas.xmlsoap.org/soap/encoding/
<http://schemas.xmlsoap.org/soap/encoding/> " xmlns:xsi="
http://www.w3.org/1999/XMLSchema-instance
<http://www.w3.org/1999/XMLSchema-instance> " xmlns:xsd="
http://www.w3.org/1999/XMLSchema <http://www.w3.org/1999/XMLSchema> ">
<soap:Body>
<AddResult xmlns=" http://tempuri.org/ <http://tempuri.org/> ">
<result>11</result>
</AddResult>
</soap:Body>
</soap:Envelope>
Is there any thing wrong with my code?
Thanks
Enyu