Ich versuche, einen Web-Service zu verbinden, mit dem nächsten Code:Web Service iPhone
NSURL *soapURL;
WSMethodInvocationRef soapCall;
NSString *methodName;
NSMutableDictionary *params;
NSDictionary *result;
soapURL = [NSURL URLWithString:@"http://wicaweb2.intec.ugent.be:80/FaceTubeWebServiceService/FaceTubeWebService?WSDL"];
methodName = @"getMostViewed";
soapCall = WSMethodInvocationCreate((CFURLRef)soapURL,
(CFStri ngRef)methodName, kWSSOAP2001Protocol);
params = [NSMutableDictionary dictionaryWithCapacity:2];
[params setObject:@"1" forKey:@"arg0"];
[params setObject:@"all_time" forKey:@"arg1"];
NSArray *paramsOrder = [NSArray arrayWithObjects:@"arg0",@"arg1", nil];
WSMethodInvocationSetParameters(soapCall,
(CFDictionaryRef)params,(CFArrayRef)paramsOrder);
WSMethodInvocationSetProperty(soapCall,
kWSSOAPMethodNamespaceURI,
(CFTypeRef)@"http://webservice.facetube.wica.intec.ugent.be/");
result = (NSDictionary*)WSMethodInvocationInvoke(soapCall);
NSString *resultado = [result objectForKey: (NSString*)kWSMethodInvocationResult];
NSLog(@"Result:%@",resultado);
Aber ich erhalte die gleiche Antwort, als wenn ich Parameter nicht senden.
Ich habe dies:
[Session started at 2009-07-07 22:01:53 +0200.]
2009-07-07 22:01:57.669 Hello_SOAP[6058:20b] Result:{
}
Genau, scheint dies aber ich werde Sie auch die Parameter zeigen, dass das Verfahren benötigt:
SOAP Anfrage
> <?xml version="1.0" encoding="UTF-8"?> > <soapenv:Envelope > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:ns1="http://webservice.facetube.wica.intec.ugent.be/"> > <soapenv:Body> > <ns1:getMostViewed> > <arg0>1</arg0> > <arg1>all_time</arg1> > </ns1:getMostViewed> > </soapenv:Body> </soapenv:Envelope>
Wie Sie sehen können, den Namen der Parameter, die ich brauche, sind arg0
und arg1
, denn das kann ich nicht verstehen, was falsch läuft :)