Skip to Content

Consume SAP Web services in c#

Hello All,

Sorry for newbie question, I am new to this SAP .net integration world; please excuse me if this question is answered elsewhere. ABAP programmer already send me the wsdl link to test in .NET. We are using .net with c# and VS2008 as IDE.

This is my progress and i am stuck at this point :

1. Already add a Service Reference

2. My .NET Progress code
NetworkCredential _credential = new NetworkCredential();
ZSDFM_CUSTOMER_INTRFC zClassObj = new ZSDFM_CUSTOMER_INTRFC();
ZsdfmCustomerIntrfc zMethodObj = new ZsdfmCustomerIntrfc();
ZsdfmCustomerIntrfcResponse zMethodResObj = new ZsdfmCustomerIntrfcResponse();
ZsdstCustomer _cust = new ZsdstCustomer();

_credential.UserName = "abc";
_credential.Password = "123";

3.some WSDL code
<xsd:complexType name="ZsdstCustomer">
<xsd:sequence>
<xsd:element name="CustGroup" type="n0:char10" />
<xsd:element name="CustFname" type="n0:char50" />
<xsd:element name="CustLname" type="n0:char50" />      
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="TableOfZsdstCustomer">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="item" type="tns:ZsdstCustomer" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="ZsdfmCustomerIntrfc">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Customer" type="tns:TableOfZsdstCustomer" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ZsdfmCustomerIntrfcResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Customer" type="tns:TableOfZsdstCustomer" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>

My question is how to input the customer parameter(CustGroup, CustFname, CustLname), send to sap, and get the response from sap ?

Can you tell us how to achieve this? Any sample code will be much appreciated.

regards,

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers