on 06-06-2005 8:29 AM
Hi,
I am trying to call a web service.
I am getting the following exception :
<b>Service call exception; nested exception is: com.sap.engine.services.webservices.jaxrpc.exceptions.XmlMarshalException: XML Serialization Error. Property [DATE_RANGE] of class [com.model.proxies.types.BAPI_FLIGHT_GETLIST] must exist and can not be null. This is required by schema description.
</b>
How do we initialize and where ?
I am misunderstanding the different classes like the Complex.... and Request....
Thanks a lot for the help.
For my knowledge CompelxTypes are not supported in webservices. I am not sure but you can try with changing the response type to simple and verify
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
If your complex type is structure or a table which in turn contains many fields of simple type.You can do the following.
make one Java Class in which you can define all fields we are returned from the BAPI and generate setter and getter methods of it.This java class must implement serializable interface.
Now, from method of the webservice which needs to return complex type like table, return object of this java class.
Before reutrning assign output values to this object and return back.If requires then use array of this object, which solves returning of the table.
I hope you are finding for this thing only.
Let me know.
Bhavik
Hi Bhavik,
I am still trying to call the same BAPI.
Here is the relevant code in the controller :
<b>
public void wdDoInit()
{
//@@begin wdDoInit()
Request_BAPI_USER_GETLISTPortType_BAPI_USER_GETLIST input = new Request_BAPI_USER_GETLISTPortType_BAPI_USER_GETLIST();
wdContext.nodeRequest_BAPI_USER_GETLISTPortType_BAPI_USER_GETLIST().bind(input);
//@@end
}
public void executeRFC( )
{
//@@begin executeRFC()
wdContext.currentRequest_BAPI_USER_GETLISTPortType_BAPI_USER_GETLISTElement().modelObject()._setUser("015462229");
wdContext.currentRequest_BAPI_USER_GETLISTPortType_BAPI_USER_GETLISTElement().modelObject()._setPassword("789789");
BAPI_USER_GETLIST importParams = new BAPI_USER_GETLIST();
ArrayList list = new ArrayList();
BAPIUSNAME structure = new BAPIUSNAME();
structure.setUSERNAME(new String());
structure.setFIRSTNAME(new String());
structure.setLASTNAME(new String());
structure.setFULLNAME(new String());
list.add(structure);
BAPIUSNAME[] rows = new BAPIUSNAME[list.size()];
list.toArray(rows);
importParams.setUSERLIST(rows);
importParams.setWITH_USERNAME("X");
try {
wdContext.currentRequest_BAPI_USER_GETLISTPortType_BAPI_USER_GETLISTElement()
.modelObject().execute();
}catch(Exception e) {
wdContext.currentContextElement().setException(e.getMessage());
}
wdContext.nodeResponse().invalidate();
//@@end
}
</b>
I succeed calling this web service with a Portal Component like a DynPage.
In order to make the web service more simple, I removed all the tables that I am not interested in.
Whan I run my webdynpro application, I get an exception caught in the executeRFC method :
<b>
Service call exception; nested exception is: com.sap.engine.services.webservices.jaxrpc.exceptions.XmlUnmarshalException: XML Deserialization Error. XML is not valid. Node <ROWS> child of <ns1:BAPI_USER_GETLIST.Response> not described in Schema
</b>
Do you understand what I have to do ?
Thanks a lot.
Hi David,
Did you modified your webservice after importing into webdynpro?
If yes, then you have to delete the associated model and create the same once again.It is due to inconsistancy between structure what you have in model and structure described in XML which you get as result from R/3.
So, create the same model once again.
Regards,
Bhavik
Do you have the Property "DATE_RANGE" in the Model ??
regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes I have it in the Model...
The DATE_RANGE is in the ComplexType_BAPI_FLIGHT_GETLIST class and in the ComplexType_BAPI_FLIGHT_GETLISTResponse class.
I have only selected the Request_BAPI_FLIGHT_GETLISTPortType_BAPI_FLIGHT_GETLIST classes : so I bound my controller to this.
Do I have to initialize each table even if I do not use them ? I just want to diplay as a result the FLIGHT_LIST table.
Thanks.
Hi,
Request_XXX Ob=new Request_XXX();
wdContext.NodeXXX().bind(Ob);
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
This is what I did.
But at execution time, the WebDynPro throws me the exception taht I posted in my first post.
Here is what I wrote :
<b>
public void wdDoInit()
{
//@@begin wdDoInit()
Request_BAPI_FLIGHT_GETLISTPortType_BAPI_FLIGHT_GETLIST input = new
Request_BAPI_FLIGHT_GETLISTPortType_BAPI_FLIGHT_GETLIST();
wdContext.nodeRequest_BAPI_FLIGHT_GETLISTPortType_BAPI_FLIGHT_GETLIST().bind(input);
//@@end
}
</b>
Thanks.
Looks like there is a difference btn the Model that you have in the project and the actual webservice .
Please check once again.
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
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.