Hi,

I'm trying to use a public webservice, which I have been using for years with other programming environment where you have to prepare everything at a lower level of coding, placing everything with hand( soap header, body, authantication etc). In VS2008 I have succeded referencing and accessing the web service. But I don't know how to invoke the request by sending the requested complex and simple elements and invoking the response and getting the return values. This is my code;

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Web;
using System.Web.Services;

namespace HowTo
{
     public partial class WEBSERVICE : Form
    {
        HowTo.tr.gov.sgk.medula.ProvizyonGirisDVO oProvizyon=new HowTo.tr.gov.sgk.medula.ProvizyonGirisDVO();
        //HowTo.tr.gov.sgk.medula.HastaKabulIslemleriService   "This is the servise I like to use
        //HowTo.tr.gov.sgk.medula.ProvizyonGirisDVO  "This is the complex type that includes data to be sent
        //HowTo.tr.gov.sgk.medula.ProvizyonCevapDVO  "This complex element contains list of elements with return data elements


        public WEBSERVICE()
        {
            InitializeComponent();

        }

        private void button1_Click(object sender, EventArgs e)
        {
            //this is where I like to use web service. Send request and get response
        }

       
    }
}

I appreciate any help

Thanks in advance

snky

I generated the Web Reference and I have the proxy and I see the methods and services of Web Service. Question is how do I send a request ? Maybe this is a simple question but I just cannot see it. The link you mentioned did not help much
snky

I invoked the method to send request data.Web service has received it and created the response. I can see it. But now I am struggling to read the returned data which contains complex element. So my problem nos is to fetch the returning data.

// execute the Request 
            proxy.hastaKabul(oProvizyon);// here I invoke hastaKabul method which also includes the response
// Below what I want to read (<sonucKodu>0503</sonucKodu>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<soapenv:Header />
	<soapenv:Body>
		<p305:hastaKabulResponse xmlns:p305="http://servisler.ws.gss.sgk.gov.tr">
			<hastaKabulReturn>
				<hastaBasvuruNo xsi:nil="true" />
				<hastaBilgileri xsi:nil="true" />
				<sonucKodu>0503</sonucKodu>
				<sonucMesaji>Veri Kaynağı hatası!</sonucMesaji>
				<takipNo xsi:nil="true" />
			</hastaKabulReturn>
		</p305:hastaKabulResponse>
	</soapenv:Body>
</soapenv:Envelope>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.