Avatar of RakeshBhandari
RakeshBhandariFlag for India

asked on 

Pass parameter to webservice through c#

i want to pass parameters & use a third party webservice

i will pass parameters to it using c#

however, i don't know how to do it since i don't know much about the webservice that is created

i only know how many and which parameters to pass to it... but don't know how to interface it

can someone with knowledge about the same please help me?

attaching the link to the webservice as well as the xml code when i open it in a webbrowser:
http://smsc2.jaamoon.com/EODSMSBroadcast?wsdl

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://webservice.smsc.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="EODSMSBroadcastService" targetNamespace="http://webservice.smsc.com/">
<types>
<xs:schema xmlns:tns="http://webservice.smsc.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://webservice.smsc.com/" version="1.0">
<xs:element name="eodbroadcast" type="tns:eodbroadcast"/>
<xs:element name="eodbroadcastResponse" type="tns:eodbroadcastResponse"/>
<xs:complexType name="eodbroadcast">
<xs:sequence>
<xs:element minOccurs="0" name="username" type="xs:string"/>
<xs:element minOccurs="0" name="password" type="xs:string"/>
<xs:element minOccurs="0" name="senderid" type="xs:string"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="mobilenos" type="xs:string"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="message" type="xs:string"/>
<xs:element name="validatenos" type="xs:boolean"/>
<xs:element minOccurs="0" name="messagetype" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="eodbroadcastResponse">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="return" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</types>
<message name="EODSMSBroadcast_eodbroadcastResponse">
<part element="tns:eodbroadcastResponse" name="eodbroadcastResponse"/>
</message>
<message name="EODSMSBroadcast_eodbroadcast">
<part element="tns:eodbroadcast" name="eodbroadcast"/>
</message>
<portType name="EODSMSBroadcast">
<operation name="eodbroadcast" parameterOrder="eodbroadcast">
<input message="tns:EODSMSBroadcast_eodbroadcast"/>
<output message="tns:EODSMSBroadcast_eodbroadcastResponse"/>
</operation>
</portType>
<binding name="EODSMSBroadcastBinding" type="tns:EODSMSBroadcast">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="eodbroadcast">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="EODSMSBroadcastService">
<port binding="tns:EODSMSBroadcastBinding" name="EODSMSBroadcastPort">
<soap:address location="http://68.168.100.177:80//EODSMSBroadcast"/>
</port>
</service>
</definitions>

Open in new window

C#WCF

Avatar of undefined
Last Comment
RakeshBhandari
Avatar of Navneet Hegde
Navneet Hegde
Flag of United States of America image

Avatar of RakeshBhandari

ASKER

i am unable to understand

can someone PLEASE provide me a C# example to CALL this webservice with the parameters that are defined inside it?

also, what is the method name, if any?
Avatar of Navneet Hegde
Navneet Hegde
Flag of United States of America image

Hi!

Your webservice looks like

        Dim ss As New com.jaamoon.smsc2.EODSMSBroadcastService()

        Dim testClass As New com.jaamoon.smsc2.eodbroadcast
        testClass.username = "sa"
        testClass.password = "abx"

        Dim result As String() = ss.eodbroadcast(testClass)

1. testClass has different properties which you have to assign
2. This result  will be result as Array which you will get back

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Navneet Hegde
Navneet Hegde
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of RakeshBhandari

ASKER

awesomeness!

thank you for your help!
C#
C#

C# is an object-oriented programming language created in conjunction with Microsoft’s .NET framework. Compilation is usually done into the Microsoft Intermediate Language (MSIL), which is then JIT-compiled to native code (and cached) during execution in the Common Language Runtime (CLR).

98K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo