on 09-12-2005 1:39 PM
Hi,
I have created a web service for an SAP-Bapi with the web service creation wizard of the SAP-System (EC5).
Now I would like to implement a client bean in the NetWeaver Developement Studio for it.
How can I give input parameters for a testmethod? I have created the following test method and the init method. Now I need to fill the array Bapisdstad[] somehow. How can I do this? I need to create Bapisdstad-elements, but I don't know how to do this?
Thank you!
Julia
public Z_SalesorderGetStatus port;
/**
Business Method.
*/
public String testCustomerId(int Id) {
// TODO : Implement
try{
Bapisdstat[] bapis = new Bapisdstat[1];
this.port.salesorderGetstatus("hallo",bapis);
String b=" ";
return "hallo"+b;
}
catch(Throwable e){
return "Fehler"+e;
}
}
/**
Create Method.
*/
public void ejbCreate() throws CreateException {
try{
// TODO : Implement
InitialContext ic = new InitialContext();
Z_SalesorderGetStatusService s = (Z_SalesorderGetStatusService)ic.lookup ("java:comp/env/Salesorder1Proxy");
Z_SalesorderGetStatus vi = (Z_SalesorderGetStatus)s.getLogicalPort(Z_SalesorderGetStatus.class);
this.port = vi;
}
catch(Throwable e)
{
}
}
Hello Julia,
Doesn`t it work:
bapis[0] = new Bapisdstat(...);
bapis[0].set....(...);
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Maksim,
thank you for your answer.
When I insert something like:
bapis[0] = new Bapisdstat();
bapis[0].setMaterial("wood");
I get the following mistake:
java.rmi.RemoteException: Service call exception; nested exception is: com.sap.engine.services.webservices.jaxrpc.exceptions.XmlMarshalException: XML Serialization Error. Property [DocNumber] of class [com.sap.proxies.types.p1.Bapisdstat] must exist and can not be null. This is required by schema description
Is something wrong with my coding or do I have to do something else? Is there any documentation about this?
Best regards,
Julia
Hi,
thank you. How do I know what is the right docNumber or can I choose any number?
I added all the mandatory dates and numbers and now I get this mistake:
java.rmi.RemoteException: Service call exception; nested exception is: com.sap.engine.services.webservices.jaxrpc.exceptions.XmlMarshalException: XML Serialization Error. Object content does not correspond to Schema restrictions of type [urn:sap-com:document:sap:rfc:functions][char1].
Best regards,
Julia
Hello Julia,
Regarding first question:
docNumber is part of BAPI functionality, so I don`t know what is expected by BAPI. Refer documentation for functional module.
Regarding second question:
Type of some property is char1 and most probably you set it to incorrect value (may be something like "11").
Chech your wsdl file, section <wsdl:types>. It describes metadata for used types.
Best regards, Maksim Rashchynski.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.