on 12-15-2006 10:14 AM
Hi all,
when calling a WebService-method from my WebDynpro-application, I get the following error message:
"Deserializing fails. Nested message: XML Deserialization Error. Can not create instance of class [com.karmann.ApplMan.dto.SoftwareKomponenteDTO] when deserializing XML type [urn:com.karmann.ApplMan.dto][SoftwareKomponenteDTO].."
SoftwareKomponenteDTO is a class that I have implemented. It implements Serializable and overwrites the methods "equals()" and "hashcode()". It contains members of types long, String and java.sql.Date.
The method I call needs an argument of type SoftwareKomponenteDTO. Other methods which return something of type SoftwareKomponenteDTO do not make any problems.
The same error message appears when I test the WebService-method in the WebService-navigator. So I assume that the problem is not the way I call the method from WebDynpro.
Thanks for help,
Christoph
Congrats !
Best Regards,
Amar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For ex:
Consider the below hierarchy in the webservice model (to check the hierarchy refer the model in the NWDS)
RequestObj
--ComplexTypeObj
RequestObj mainRequest = new RequestObj();
mainRequest._setUser("");
mainRequest._setPassword("");
ComplexTypeObj requestObject = new ComplexTypeObj();
requestObject.set____("");
mainRequest.setRequestObject(requestObject);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christoph,
As your webservice model has complex data types, so you have to set the complex types for the Request Object, so setting the simple type would not serve the purpose.
Identify the mandatory complex type objects for the Request Object in the webservice, set the mandatory attributes for the mandatory Complex DataType Objects identified and then execute the webservice.
I have implemented the similar scenario with lots of complex data type objects successfully by following the above mentioned procedure.
Thanks and Regards,
Amar Bhagat Challa.
Hi Amar,
thanks for all your help. Now I found what my problem was. The complex type that I deliver to my method must have a public constructor without parameters. I think that this is slightly confusing, because in the other direction (method delivers complex type as return value) this is not neccessary. Anyway, my problem's solved now.
Regards,
Christoph
I think the problem occurs if the request object of webservice is not passed with the mandatory parameters. Try passing the mandatory request object parameters and call execute.
Thanks and Regards,
Amar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for this hint, Amar. But this points directly to my next problem: How can I set this parameter. I know how to set flat parameters (e.g. of type long, boolean, etc.). But how can I set a parameter of a complex type?
For example I can call
wdContext.currentSaveElement().setIdFather(long id)
in order to set the parameter idFather of type long for the WebService-method save(). But there is no method
wdContext.currentSaveElement().setIdFather(SoftwareKomponenteDTO aKomp)
Could you please help me on more time?
Kind regards,
Christoph
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.