为“localhost.MobileCodeWSSoap”的终结点配置部分,因为找到了该协定的多个终结点配置。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace webservice
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
localhost.MobileCodeWSSoapClient service = new webservice.localhost.MobileCodeWSSoapClient();
textBox1.Text = service.getMobileCodeInfo("15195175","");
}
}
}
soluction:
app.config 里面endpoint删除一个,
result:
<client>
<endpoint address="http://ws.webxml.com.cn/WebServices/MobileCodeWS.asmx"
binding="basicHttpBinding" bindingConfiguration="MobileCodeWSSoap"
contract="localhost.MobileCodeWSSoap" name="MobileCodeWSSoap" />
</client>