Soapfault/ Glue
"philip alb" <[email protected]> Wed, 11 Dec 2002 19:27:00 +0100
| Newsgroups | gmane.comp.java.enhydra.ksoap |
|---|---|
| Message-ID | <000a01c2a142$e5a0f680$0761f63e@ptxv086pee39ws> |
Hello again.
I wrote before, but here is a more exact description of my problem.
I'm trying to call a glue webservice method which takes the complex type Appointment (implementing KvmSerializable) as argument.
I'v registered Appointment with the classmap:
static final String serviceNamespace = "http://tempuri.org/JNotes" ;
static final String serviceUrl = "http://sls1n8:8008/jnote/webservices/jnote" ;
static final String soapAction = "JNotes";
transport = new HttpTransport( serviceUrl, soapAction );
ClassMap classMap = new ClassMap(false); classMap.addMapping("www.themindelectric.com/package","Appointment",newAppointment().getClass());
transport.setClassMap(classMap);
Then I create a Soap Object and try to call the service, but I get an Exception.
soapObj = new SoapObject(serviceNamespace, "addAppointment");
soapObj.addProperty("userId",mobile+pin);
soapObj.addProperty("app",this.generateAppointment(desc,date));
try{
transport.call(soapObj);
}catch(Exception ex){}
I trĂed to call the service method with a Glue client and it works fine. Then I traced both soap messages from
glue client and ksoap client to see the differences.
Here they are:
KSOAP:
<SOAP-ENV:Envelope
xmlns:n1="www.themindelectric.com/package"
xmlns:n0="http://tempuri.org/JNotes"
xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <n0:addAppointment id="o0" SOAP-ENC:root="1">
<userId xsi:type="xsd:string">0171111111111111</userId>
<app xsi: type="n1:Appointment">
<startMills xsi:type="xsd:long">1013385600000</startMills>
<endMills xsi:type="xsd:long">1013385960000</endMills>
<content xsi:type="xsd:string">dgdgd</content>
</app>
</n0:addAppointment>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
GLUE:
<ns0:addAppointment>
xmlns:n0='http://tempuri.org/JNotes'>
xmlns:n1='http://themindelectric.com/package'>
<userId xsi:type='xsd:string'>01112365</userId>
<app id='id0' xsi:type='ns1:Appointment'>
<startMills...
</app>
</ns0:addAppointment>
Here is what I get back from the server when calling with the KSOAP client.
HTTP/1.1 500 Internal Server Error
Optimizable:true
Date: Tue, 11 Dec 2001 15:06:51 GMT
Content-Type: text/xml; charset=UTF-8..Server: GLUE/3.2.1
Content-Length: 2305
<?xml version='1.0' encoding='UTF-8'?>
<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' soap:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:ns5='http://www.themindelectric.com/package/java.rmi/'
xmlns:ns6='http://www.themindelectric.com/package/java.lang/'
xmlns:ns7='http://www.themindelectric.com/package/java.io/'>
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>
electric.xml.io.schema.SchemaException: could not find a type with qname www.themindelectric.com/package:Appointment
</faultstring>
<detail>
<stacktrace>
....
</stacktrace>
</detail>
<tme:exception
xmlns:tme='http://www.themindelectric.com/'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<name xsi:type='xsd:string'>java.rmi.UnmarshalException</name>
<object id='id0' xsi:type='ns5:UnmarshalException'>
<detailMessage xsi:type='xsd:string'>
electric.xml.io.schema.SchemaException:could not find a type with qname www.themindelectric.com/package:Appointment</detailMessage><detail xsi:nil='1'>
</detail>
</object>
</tme:exception>
</soap:Fault>
</soap:Body>
</soap:Envelope>
I can't find differences between the namespaces.
Maybe somebody sees , what the problem is??
Thanks,
Philip Alb