cancel
Showing results for 
Search instead for 
Did you mean: 

Web Service From Java class, serialization problem

Former Member
0 Kudos

Hi,

I want to create Web Service from Java class, I made java project, generated web service from it, create web service archive project and deployed it to WAS 6.40.

My class have 2 methods,

public int add(int a, int b);

public MyResponse doSomthing(MyRequest req);

I can succesfully call add method from Web Service Navigator, it works fine but when I call doSomthing methods I get the following error:

<b>

Deserializing fails. Nested message: XML Deserialization Error. Result class [com.mycomp.sap_tech.ws.MyRequest] does not have property [Amount] of type [java.lang.String]. It is required to load XML..

</b>

Any ideas how to resolve it?

P.S. MyRequest class is exposed throw VI, has default constractor and public getters and setters for all properties. It implements Serializable as well. Any guesses?

Thanks in advance,

Victor.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Victor,

It looks for me like inconsistency between the Web-Service and Java classes.

Try to undeploy the Web-Service (Remove), rebuild everything again and deploy.

Close all browsers and test again.

Tell if it helps.

Avi

Former Member
0 Kudos

Hi Victor,

Your MyResponse class should be Serializable implemented.

Make your Myresponse class as Serializable implemented.

Regards,

Bhavik

Former Member
0 Kudos

Hi Bhavik, thanks for response.

as I already mentioned it implements Serializable, so it is not the problem.

Thanks Avi but it didn't helps iether

Victor

Former Member
0 Kudos

Hi Victor,

Sorry it didn't help but it still looks for me as an inconsistency since from the error you posted it seems that in the WSDL file, the MyRequest class is containing Amount attribute but the Java class implementation doesn't contain attribute with this name.

Just to be sure, compare the WSDL with the Java class.

Avi

Former Member
0 Kudos

Hi, thanks for reply.

I checked all the things you mentioned. I even made new, clean project and did again all the staff there. It didn't help.

Can somebody point out to WS documention about SAP implementation and runtime of it? I saw the Sap Help context but found only the overview and basic things there.

Thanks in advance.

Victor.

Former Member
0 Kudos

Hi Victor,

If is it possible send me your project and I will take a look in it.

Avi

Former Member
0 Kudos

Hi, with the help of SAP I solved the problem

I just want to share solution with comunity:

The "_" symbol is not allowed in the properties names!!

Hope it helps for sombedy

Victor.