介面
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ewel="xxx">
<soapenv:Header/>
<soapenv:Body>
<ewel:BS05007>
<ewel:input>?</ewel:input>
</ewel:BS05007>
</soapenv:Body>
</soapenv:Envelope>
soapui 測驗
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<NS1:BS05007Response xmlns:NS1="xxx">
<NS1:output>
<response>
<errorCode>1</errorCode>
<errorMsg>請驗證傳入引數</errorMsg>
</response>
</NS1:output>
</NS1:BS05007Response>
</soapenv:Body>
</soapenv:Envelope>
vs添加web參考
public class Class1
{
WebReference.Ewell_S50HttpService service = new WebReference.Ewell_S50HttpService();
public string aaa(string xml) {
WebReference.BS05007 bs=new WebReference.BS05007();
bs.input=xml;
String ss= service.BS05007(bs).output;//這一步直接報錯
return ss;
}
}
//呼叫
ClassLibrary1.Class1 cl = new ClassLibrary1.Class1();
var a = cl.aaa(c);
報錯資訊:
public class Class1
{
WebReference.Ewell_S50HttpService service = new WebReference.Ewell_S50HttpService();
public string aaa(string xml) {
WebReference.BS05007 bs=new WebReference.BS05007();
bs.input=xml;
String ss= service.BS05007(bs).output;
return ss;
}
}
第二種呼叫
public class S50Help
{
S50.Ewell_S50Client client = null;
public string sendbs5007(string xml)
{
client = new S50.Ewell_S50Client(new BasicHttpBinding(), new EndpointAddress("xxxx"));
S50.BS05007 bs5007 = new S50.BS05007();
bs5007.input = xml;
XmlDocument doc=new XmlDocument();
var aa=client.BS05007(bs5007).output;
doc.LoadXml(aa.ToString());
return doc.ToString();
}
}
//呼叫
Ewell_S50_Services.S50Help h = new Ewell_S50_Services.S50Help();
var s= h.sendbs5007(c);
“System.ServiceModel.CommunicationException”型別的第一次機會例外在 mscorlib.dll 中發生
其他資訊: 對操作“BS05007”的回復訊息正文進行反序列化時出錯。
uj5u.com熱心網友回復:
那位大佬幫忙看看那里出的問題,我是直接通過vs參考的web服務,就是不成功 直接執行到方法那里就是把uj5u.com熱心網友回復:
Web 參考正常代理類是沒有任何問題的,是否可以提供debug 資訊。uj5u.com熱心網友回復:
uj5u.com熱心網友回復:
我是直接通過vs直接呼叫的uj5u.com熱心網友回復:
網上看到的都是設定maxStringContentLength 長度,我也設定也還是不行uj5u.com熱心網友回復:
ewel沒打全轉載請註明出處,本文鏈接:https://www.uj5u.com/net/232809.html
標籤:Web Services
上一篇:C# List<T>的Contains, Exists, Any,Where性能對比
下一篇:如何橫向直接列印rdlc報表
