cancel
Showing results for 
Search instead for 
Did you mean: 

Error consuming java webservice

Former Member
0 Kudos

Hi,

I am consuming a webservice from SAP. The test is giving an exception

"SoapFaultCode:1 JAXB unmarshalling exception: Unable to create an instance of de.********.blw.v2.MeldungType; neste

d exception is javax.xml.bind.UnmarshalException: Unable to create an instance of de.******.blw.v2.MeldungType -

with linked exception: http://java.lang.InstantiationException";

Can any one please help..

Edited by: Gunjan Tyagi on Jul 21, 2009 9:56 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

This seems to be temporary error, please try this to be sure that this is not a problem with webservice.

Use url of wsdl and try it with WSNavigator or SOAPUI and post result here, if it is working fine then this is temporary error.

If this is custom developed service and deployed then make sure that libraries(other than SAP standard) required to run this service are part of deployment package (.ear file).

Post more information to help you better.

Regards,

Gourav

Former Member
0 Kudos

HI Gourav,

This service is working fine when used from some other tool. I dont have acces to that tool and only thing i have is the the test data as used from that tool in .xml form. I used the same test data in sap also but getting the exception.

One change i did in the xsd file is that there was a recursive reference for an element referring to the same node. It was having property minOccurs="0". So i removed the field from, the xsd since SAP do not support recursive usage of types and created the client proxy. Does this differece could be a cause for this excpetion.

Another doubt is the node MeldungType is of type abstract in the .xsd as shown below.

<xsd:complexType name="MeldungType" abstract="true" >

<xsd:annotation>

</xsd:sequence>

</xsd:complexType>

Hence I used a derived type from this meldungtype. Could this be a potential problem for instantiation.

comments welcome..

Former Member
0 Kudos

Hi,

You can test service by webservice navigator (you can find it http://yoursaphost:yourj2eeport) and I recommend that you test it again.

The error you mentioned is closely related to MeldungType, please try to concentrate on it, in this type of situation my suggestion is to keep everything intact including recurring reference and then test again.

Regards,

Gourav

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Gunjan,

I think there is a mismatch in the WSDL supplied to you and SOAP message that you are trying to consume in the program.

Try co-relate the SOAP output tags specified in WSDL file and SOAP message that you are getting. If there is a difference in the structure like tags missing or different name for the tags..that will be the root cause for the error.

Thanks & Regards,

Aditya Metukul

Former Member
0 Kudos

Hi Aditya,

Can you please explain a little bit detailed.

regards

Gunjan

Former Member
0 Kudos

Hi,

What Aditya means is that you modified wsdl (i.e. deleted some xsd datatype etc) and you are still using original xml test message so it is possible that that xml message still structured for original wsdl hence you are getting this error.

Regards,

Gourav

Former Member
0 Kudos

Hi Gourav,

No i m not using the old test data.

The test data is generated in sap while executing and i just use the generated structure with the proper test data.

Thanks.

Former Member
0 Kudos

Hello Gourav,

Hav you come across any situation where there was an abstract type used inteh interface parameter.

if so can you please tell me how you have used it.

rgds

Gunjan

Former Member
0 Kudos

Hi,

I never used them but I'll try and let you know. If you know any service available on internet with abstract data type then let me know, I'll start with it.

Regards,

Gourav

Former Member
0 Kudos

hi Gourav,

sure if i come across anything i will let u know.

rgds

Gunjan