使用SOAPUI
连接到SOAP Web服务,示例成功连接:
使用代码c#:
var service = new com.nexxera.flnws001qae.NexxeraWSv2ImplService();
service.RequestSoapContext.Security.Tokens
.Add(new UsernameToken(Properties.Settings.Default.USUARIOWS, Properties.Settings.Default.SENHAWS, PasswordOption.SendPlainText));
var FileName = System.IO.Path.GetFileName(currentFilePath);
service.RequestSoapContext.Attachments.Add(new
Microsoft.Web.Services2.Attachments.Attachment(FileName,
"application/octet-stream", currentFilePath));
service.RequestSoapContext.Add("text/plain", new ContentType());
var c = new StreamReader(currentFilePath).ReadToEnd();
var fs = new com.nexxera.flnws001qae.fileWrapper
{
filename = currentFilePath.Split('\\').Last(),
content = currentFilePath.Split('\\').Last()
};
var arqq = new com.nexxera.flnws001qae.uploadFilev2
{
destination = "LARIND.BANCOS",
file = fs
};
var result = service.uploadFile(arqq);
连接到SOAP Web服务时的详细信息错误:
不受支持的内容类型:应用程序/边框