Hi,
Thanks for your reply, but it still doesn't work!
Is this the version problem? I am using soap2.2!
By the way, there is another question. Have you ever
met a name-space problem? below are my
request content:
================
client request
================
POST /math/WebSrv_Math.asmx HTTP/1.0
Host: 140.96.81.10
Content-Type: text/xml
Content-Length: 484
SOAPAction: "http://tempuri.org/Add"
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:Add xmlns:ns1="http://tempuri.org/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<ns1:num1 xsi:type="xsd:int">4</ns1:num1>
<ns1:num2 xsi:type="xsd:int">7</ns1:num2>
</ns1:Add>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
=====================
note here: <ns1:num1 xsi:type="xsd:int">4</ns1:num1> and
<ns1:num2 xsi:type="xsd:int">7</ns1:num2>
If I take the name-space: "ns1" away from here, MS.NET will return the
result with 0.
In other words, it seems that MS.NET doesn't understand it. Do you have any
ideas of this?
Thank you!
Enyu
----- Original Message -----
From: "Soumen Sarkar" <[EMAIL PROTECTED]>
To: "'Shih En-Yu '" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, July 25, 2001 1:34 PM
Subject: RE: Apache SOAP client to MS.NET webservice problem
> 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
>