0

Below is the webservice given by third party to integrate in C# winforms:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:tns="http://tempuri.org/" elementFormDefault="qualified"      targetNamespace="http://tempuri.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="GetRecharge">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="account_no" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="smc" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="amount" type="xs:int" />
<xs:element minOccurs="0" name="Uniqueid" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetRechargeResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="GetRechargeResult" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element></xs:schema>

Also a URL to test this webservice is provided. How do i go about consuming this svc webservice in C# winforms. Code snippets are welcome.

Edit : I tried adding web reference to the project in VS2010 but I am getting the following error :

https://i.stack.imgur.com/PoxAr.jpg

idrisjafer
  • 725
  • 1
  • 14
  • 29
  • [Create a wcf client?](http://msdn.microsoft.com/en-us/library/ms733133(v=vs.110).aspx) – rene Nov 16 '13 at 09:19
  • That's not a web service. That's only the XML schema. – John Saunders Nov 16 '13 at 09:34
  • @JohnSaunders How should i use this XML Schema and given test service URL to integrate with my application? – idrisjafer Nov 16 '13 at 09:43
  • Add ?wsdl to the URL provided to build a WCF client. – Konrad Kokosa Nov 16 '13 at 10:02
  • 2
    You cannot use what they gave you. They gave you something that doesn't work. Also, do not ever use "Add Web Reference". Use "Add Service Reference". The people who gave you that URL need to fix their service. You can click that "Details" link to get the details of what's wrong so you can tell them. See "[How to Consume a Web Service](http://johnwsaunders3.wordpress.com/2009/05/17/how-to-consume-a-web-service/)" – John Saunders Nov 16 '13 at 11:10

0 Answers0