日期:2014-05-17  浏览次数:20440 次

WebService参数问题
Webservice方法带了自定义对象作为参数,运行的时候就这样
Test
The test form is only available for methods with primitive types as parameters. 
SOAP 1.1
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.
新手,不知道该怎么做,自定义对象里面有
public class DataText
{
    public string backupFile = "C:\\temp\\MicrosoftDynamicsAX.bak";
    public Boolean isFullExport = false;
    public Boolean isRecurring = true;
    public string[] axmodels = { "15" };
    public string[][] cleansFields = { new String[] { "SalesTable", "DEL_DeliveryCity", "DEL_DeliveryState" } };
    public DataTextSchedular = new DataTextSchedular();                                    
public DataText()
{
}
}有高手教教我吧

------解决方案--------------------
引用:
public DataTextSchedular = new DataTextSchedular();  

DataTextSchedular 在webservice 里面, 你只能用简单的对象类型
int, bool, string 

http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383513
------解决方案--------------------
把你webservice需要的参数封装成一个类  然后序列化通过webservice传过去  接收后在反序列化回来就行了