on 05-22-2006 12:19 PM
hello everyone,
I want to implement a web service between server and mobile phone, the web service is in dotnet plattform and the client is in java plattform (j2me), now i can only receive a response with simple datatype, i.e., int and string or their arrays. but i have now a custom datatype, Address include name and address etc. and i want to receive an array of such dataype, how can i do it?
now i have the following exception:
the server is unable to process the request....
an error occurs when generating the xml documents.....
thx in advance
best regards
Yaning
Hi Yaning,
Your custom datatype class must implement Serializable interface and have getters and setters for each property.
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Yaning,
I have experience with consuming web services running on SAP J2EE WAS from .Net.
Simple example is to create session bean with one business method which is returning class which implements Serializble interface and having setter and getter for each property it is exposing. And afterwards wrap session bean to web service.
De- and Serialization of any types is done by WS container.
Best regards, Maksim Rashchynski.
maksim, thanks for ur tips, but now i have such a problem, i send my request, but the content in buffer as response is such exception:
**********************************************************
SoapFault - faultcode: 'soap:Server' faultstring: 'System.Web.Services.Protocols.SoapException:
the server is unable to process the request
---> System.InvalidOperationException:
an error occurs when generating the xml documents ---> System.InvalidOperationException:
the type System.Object can not be used in this context
at System.Xml.Serialization.XmlSerializationWriter.WriteReferencedElement(String name, String ns, Object o, Type ambientType)........
********************************************************
the soap sample for this function is as following:
********************************************************
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?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:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://192.168.1.3/Server2BB_WebService/Server2BBService" xmlns:types="http://192.168.1.3/Server2BB_WebService/Server2BBService/encodedTypes" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<q2:getAddressesResponse xmlns:q2="http://192.168.1.3/Server2BB-WebService/Server2BBService">
<getAddressesResult href="#id1" />
</q2:getAddressesResponse>
<soapenc:Array id="id1" xmlns:q1="http://192.168.1.3/Server2BB_WebService/CAS_Address" soapenc:arrayType="q1:CAS_Address[2]">
<Item href="#id2" />
<Item href="#id3" />
</soapenc:Array>
<q4:CAS_Address id="id2" xsi:type="q4:CAS_Address" xmlns:q4="http://192.168.1.3/Server2BB_WebService/CAS_Address">
<CAS_GUID xsi:type="xsd:int">int</CAS_GUID>
.......................................................
</soap:Body>
</soap:Envelope>
*******************************************************
so i dont know how can i resolve this problem at the server side or web service side, can you tell me where did i something wrong?
thanks in advance
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.