I have a c# windows form. I have added a web reference to a web service running on another server on my network.
I have verified that the web service is responding by using VisualWebServiceClient (VWSC)(
http://digitforge.com/Public/Downloads.aspx) (great utilility by the way).
VWSC shows me the request that it sends to the web service as being -
==========================
==========
==========
==========
==========
=
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="
http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="
http://strongmail.com/soap/strongmail.wsdl" xmlns:types="
http://strongmail.com/soap/strongmail.wsdl/encodedTypes" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="
http://www.w3.org/2001/XMLSchema">
<soap:Body
soap:encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/">
<execute>
<smIn
xsi:type="xsd:string"><
strongmail
-client username="admin" password="admin"
context="clientinfo" action="mailings">
<mailing>
<status code="3">Active</sta
tus>
</mailing>
</strongmail-client>
</smIn>
</execute>
</soap:Body>
</soap:Envelope>
==========================
==========
==========
==========
==========
=
My questinon is how do I call the same web service and pass it the same info from inside a C# windows app?
I have the following lines of code -
==========================
==========
==========
==========
==========
==
using System;
using System.Collections.Generic
;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using StrongMailWebServicesTest1
.StrongMai
l;
using System.Xml;
namespace StrongMailWebServicesTest1
{
public partial class Form1 : Form
{
strongmail sm = new strongmail();
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
smIn = "<strongmail-client username="admin"
password="admin"
context="clientinfo&q
uot; action="mailings"
;><m
ailing>
<status
code="3">Acti
ve</sta
tus><
;/mailing&
gt;</st
rongmail-c
lient>"
;
string smOut = "";
smOut = sm.execute(smIn);
}
}
}
==========================
==========
==========
==========
==========
==
But I get a response back (smOut) telling me that there was an error parsing the input.
Thanks,
Kevin.
Start Free Trial