cancel
Showing results for 
Search instead for 
Did you mean: 

sap web service to use in .net

Former Member
0 Kudos

hi

I have created a web service in sap in which i have used Tables parameter,

I am using this web service in asp.net application , I have added it successfully in .net application,

but when I am trying to pass the table parameter from .net to sap , it is giving an error

String URL;

URL="http://.../sap/bc/srt/rfc/sap/ZSERVICETABLE?sap-client=301&wsdl=1.1";

ICredentials cred = new NetworkCredential(" ", " ");

WebReference.zservicetableService wsnew = new WebReference.zservicetableService();

wsnew.Url = URL;

wsnew.Credentials = cred;

WebReference.ZREQTABLE stable = new WebReference.ZREQTABLE();

wsnew.ZJ_REQUESTTABLE(ref stable);

this is giving an error , for the table that i have passed

Is there any solution?

Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Puneeta,

I had the same problem.You can use the following code.

WebService1.Mara[] TMara = new WebService1.Mara[[10]];

NetworkCredential credentials = new NetworkCredential("User", "Pwd", "Domain <Optional>");

WebService1.ZOMR_WS_DFService Ws1 = new WebService1.ZOMR_WS_DFService();

Ws1.Credentials = credentials;

Ws1.ZomrWs("000000000000000001",ref TMara );

Regards,

Former Member
0 Kudos

Hi Puneeta,

What is the error?

Post the error. It would be easy then to find the reason.

Regards.

Former Member
0 Kudos

Hi Puneeta,

What is the error?

Post the error. It would be easy then to find the reason.

Regards.

Former Member
0 Kudos

hi jitesh

Actually I am having a problem in passing table parameter from .net to sap

The best overloaded method match for 'WebReference.zrequestentryService.ZjRequesttable(ref WebReference.Zreqtable[], string, string)' has some invalid arguments

Argument '1': cannot convert from 'ref WebReference.Zreqtable' to 'ref WebReference.Zreqtable[]'

URL = "http:// /sap/bc/srt/rfc/sap/ZREQUESTENTRY?sap-client=301&wsdl=1.1";

WebReference.zrequestentryService wservice = new WebReference.zrequestentryService();

wservice.Url = URL;

System.Net.ICredentials cred = new NetworkCredential("", "");

wservice.Credentials = cred;

string datefrom = "01.05.2009";

WebReference.Zreqtable ztable = new zreqtable();

wservice.ZjRequesttable(ref ztable,datefrom);----


<In this line I am getting error

Regards

Former Member
0 Kudos

Hi Puneeta,

>>The best overloaded method match for 'WebReference.zrequestentryService.ZjRequesttable(ref >>WebReference.Zreqtable[], string, string)' has some invalid arguments

There! It say it all. It is expecting an array of type Zreqtable (Zreqtable[]).

>>WebReference.Zreqtable ztable = new zreqtable();

>>wservice.ZjRequesttable(ref ztable,datefrom);----


<

And you are passing only an instance of zreqtable. You required to pass an array of it.

Purely a programming error, I would say.

Regards

Former Member
0 Kudos

hi jitesh

thanks , actually i have done it with array, though the solution does not give any error , but what i want to is to pass a table parameter as sap rfc is returning tables parameter, so finally when i debug the application i do not get result from the service.

so now i am doing it with sap.net connector,

one thing more i am adding a web service to my .net application can you give me a url or some help on how to do it with enterprise service some really basic example , I am really not clear with sap enterprise service

thanks & regards

Former Member
0 Kudos

Hi Puneeta,

Not sure, if I understood your requirement but let me try-

>>what i want to is to pass a table parameter as sap rfc is returning tables parameter,

When passing the parameters from client side (.NET or any other), you would have to check what is the corresponding type generated in client proxy(.NET application). Without being concerned about what is in the server side (RFC) data types or parameter type.

Now regarding your query about Tables type parameter: Well, this datatype is valid in ABAP but do you have a Table type in .NET ? I guess NO. And SAP .NET connector does not recognize .NET datatables or dataset for that matter.

->> i do not get result from the service.

Ideally if the execution is successful you must get the response. Try doing end-to-end debugging from .NET to RFC and see whether the values are indeed being returned from RFC.

>>one thing more i am adding a web service to my .net application can you give me a url or some help >>on how to do it with enterprise service some really basic example , I am really not clear with sap >>enterprise service

If you are talking here about Enterprise Sevice Explorer for VS 2005, read this https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0319dc4-d76d-2a10-d19f-e4f4ff31...

Regards

Former Member
0 Kudos

hi jitesh

Thanks for the help,

I have done it sap.net connector,I am still not able to do with web service,

I will be reading enterprise service from the link that u have sent , and then i wil be trying with the enterprise service

regards

puneeta