on 07-05-2006 2:45 PM
Hi everyone,
When I execute my web service, I get the following error.
<b>
Array Property [Item] in class [none] must not have NULL elements. This is restricted by schema description.
</b>
I do not understand it, because I filled up all the data.
Can someone help me with that problem ?
Thanks.
hi,
first check out if the web service that u r trying to connect is enabled in ur portal server. else it wont work.
theja.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
This web service is in fact an RFC written in ABAP.
I got it's wsdl file.
I test it with the Web Services Navigator and it works properly.
The problem here is that I should be initializing a field.
If I am mistaking, please let me know.
Here is a part of the wsdl file.
<b>
- <xsd:element name="_-ILG_-BAPI_SUI_MIDDLE_CREATE">
- <xsd:complexType>
- <xsd:all>
- <xsd:element name="ET_MESSAGETABLE">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element name=<u>"item"</u> minOccurs="0" maxOccurs="unbounded" type="s0:BAPIRET2" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="I_SUI_MIDDLE_CREATE" type="s0:_-ILG_-BAPI_SUI_MIDDLE_CREATE" />
- <xsd:element name="I_TEST" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="1" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
- <xsd:element name="_-ILG_-BAPI_SUI_MIDDLE_CREATE.Response">
- <xsd:complexType>
- <xsd:all>
- <xsd:element name="ET_MESSAGETABLE">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element name=<u>"item"</u> minOccurs="0" maxOccurs="unbounded" type="s0:BAPIRET2" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
- <xsd:element name="E_MIDNUM">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="12" />
<xsd:pattern value="\d*" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="E_SUCCESS">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="1" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element
</b>
Please notice the "Item"s underlined.
Thanks.
Message was edited by: David Fryda
Hi David,
There are 2 things.
1. When u tested from web service navigator/browser, there will be default values like for integer fields it will be 0 and for string variables empty values will be there. Thus at any point of time, null values will not be passed and web service runs fine.
2. Secondly, when u run from webdynpro and if you don't pass any values to string variables -- null value will be passed instead of empty value. Thus your web service is failing saying that null values are not allowed.
So, to run your web service from webdynpro, pass emtpy values for input variables or else control null values in ABAP side .
Hope this helps you.
Regards,
Shiva Kumar
Hi Shiva,
Thanks for your reply.
I filled up all the fields that have to get values.
Now I need to pass to a method object BAPIRET2 as an array.
So, I wrote :
BAPIRET2 []bapiret2 = new BAPIRET2[1];
ilgInner.setET_MESSAGETABLE(bapiret2);
Everything compiles.
Should I need to filled up values in that []bapiret2 ?
This is what I did :
bapiret2[0].setFIELD("");
bapiret2[0].setID("");
bapiret2[0].setLOG_MSG_NO("");
bapiret2[0].setLOG_NO("");
bapiret2[0].setMESSAGE("");
bapiret2[0].setMESSAGE_V1("");
bapiret2[0].setMESSAGE_V2("");
bapiret2[0].setMESSAGE_V3("");
bapiret2[0].setMESSAGE_V4("");
bapiret2[0].setNUMBER("");
bapiret2[0].setPARAMETER("");
bapiret2[0].setROW(1);
bapiret2[0].setSYSTEM("");
bapiret2[0].setTYPE("");
The problem is that bapiret2[0] is null so I get a null pointer exception.
Do you think I need to filled up every field...it seems strange, doesn't it ?
Thanks for your help.
Hi David Fryda,
bapiret2[0] is giving null. Because the 0-th object it self null. Ensure if(bapiret2[0] != null) before assigning any value to it.
It is sometimes necessary to pass null values to webserive, when you are not passing any values. Moreover it is the best practice, passing null values.
Thanks,
Sridhar
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.