Objective c 如何将值数组传递给SudzC生成的webservice类?

Objective c 如何将值数组传递给SudzC生成的webservice类?,objective-c,soap,ios4,touchxml,sudzc,Objective C,Soap,Ios4,Touchxml,Sudzc,我有一个从WSDL生成的sudzc服务类,它接受ArrayFint和ArrayOfString对象作为参数。服务方法签名如下: - (SoapRequest*) Search: (id <SoapDelegate>) handler filters: (NSMutableArray*) displayedAttributes: (NSMutableArray*) displayedAttributes; -(SoapRequest*)搜索:(id)处理程序筛选器:(NSMutabl

我有一个从WSDL生成的sudzc服务类,它接受ArrayFint和ArrayOfString对象作为参数。服务方法签名如下:

- (SoapRequest*) Search: (id <SoapDelegate>) handler filters: (NSMutableArray*) displayedAttributes: (NSMutableArray*) displayedAttributes;
-(SoapRequest*)搜索:(id)处理程序筛选器:(NSMutableArray*)显示的属性:(NSMutableArray*)显示的属性;
我的问题是,如何将值传递到期望NSMutableArray的参数中

在上面的方法签名中,“displayedAttributes”参数需要一个
ArrayFint
对象(该对象应在int标记中填充多个整数,例如
123
等)

但是,我尝试过的这些方法都不起作用:

  • 直接传递(int)对象的NSArray/NSMutableArray
  • 直接传递NSNumber对象的NSArray/NSMutableArray
  • 传递包含@“1”、“2”、“3”等的字符串数组
  • 传递已包含
    @“1”
    @“2”
    等的字符串数组
  • 基于整数从字符串中构造
    cxml文档

我确信这在下载的附带文档中得到了某种程度的解释——我现在还不清楚。

我也遇到过类似的情况,将对象数组传递给SOAP请求。我通过做以下更改使它工作

中的SOAP数组大小写未添加到中

+(NSString *) serialize: (id) object()
{
//look if it is array not implemented
}
因此,我设法改变了以下方法

+ (NSString*) serialize: (id) object withName: (NSString*) nodeName {
    if([object respondsToSelector:@selector(serialize:)]) {
        if([object isKindOfClass:[SoapArray class]]) 
            return [object serialize:object];
        return [object serialize: nodeName];
    }
    NSString *temp =[NSString stringWithFormat:@"<%@>%@</%@>", nodeName, [Soap serialize: object], nodeName];
    NSLog(@"serialise = %@", temp);
    return temp;
}

Pass element arr object您的SOAP请求???

这有点旧,但我希望它能帮助别人。我通过以下方式在SoapArray上实现了
序列化:
方法:

- (NSMutableString *)serialize:(NSString *)name
{
    NSMutableString *str = [NSMutableString string];
    //[str appendFormat:@"<%@>", name];
    for (id content in self)
    {
        //[str appendString:[Soap serialize:content]];
        [str appendString:[Soap serialize:content withName:name]];
    }
    //[str appendFormat:@"</%@>", name];
    return str;
}
-(NSMutableString*)序列化:(NSString*)名称
{
NSMutableString*str=[NSMutableString];
//[格式:@“,名称];
for(自我中的id内容)
{
//[str appendString:[Soap序列化:内容]];
[str appendString:[Soap serialize:content with name:name]];
}
//[格式:@“,名称];
返回str;
}

如您所见,这里有一些注释行。如果您取消对它们的注释并对for中当前使用的一个进行注释,您将得到一个名为name的标记,其中包含使用内容类名标记的对象。

@Jon Limjap:您真幸运!!!它要求您输入您以前处理过的类型,我有SudzC为我生成的自定义类类型(!)。。。它仅在传递CXMLNode(需要CXMLDocument/CXMLElement)时初始化。。我不知道怎么对付这种人

一个例子是:filter是一个类,我有一个filter类,但没有办法初始化它(除了alloc init,然后设置它的属性,但它的属性是另一个这样的自定义类型!!!!)…如果你知道任何“诀窍”告诉/配置sudzc以允许我们传递对象或获取cocoa类型的对象,请告诉我

- (NSMutableString *)serialize:(NSString *)name
{
    NSMutableString *str = [NSMutableString string];
    //[str appendFormat:@"<%@>", name];
    for (id content in self)
    {
        //[str appendString:[Soap serialize:content]];
        [str appendString:[Soap serialize:content withName:name]];
    }
    //[str appendFormat:@"</%@>", name];
    return str;
}