Return in SOAP webservice call
Return in SOAP webservice call
- Subject: Return in SOAP webservice call
- From: Niklas Saers <email@hidden>
- Date: Sat, 15 Mar 2008 00:47:03 +0100
Hi guys,
I've made a little webservice test, using NuSOAP I've made a
webservice that returns a string that is a 9k base64 encoded file.
I've used different soap testers and the method works great. When I
call it through Cocoa, it's called fine, all the parameters are passed
correctly and the correct response (as far as I can read, anyway) is
sent. My problem is, when I do:
WSMethodInvocationRef soapReq = createsoapReq(url, method, namespace,
params, paramOrder, reqHeaders);
NSDictionary *result = (NSDictionary
*)WSMethodInvocationInvoke(soapReq);
NSString *ret = [result objectForKey: (NSString *)
kWSMethodInvocationResult];
ret is set to null rather than a reference to the NSString containing
the 9kb base64 encoded file. Do you have any clues why it is set to
null? The output of NSLog(result) follows
Secondly, are there better ways to transfer a file as a part of a SOAP
answer than making it into a base64 encoded string?
Cheers
Nik
2008-03-15 00:38:17.404 myApp[9750:60b] result: {
"/WSDebugInBody" = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?
><SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/
\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance
\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\"><SOAP-
ENV:Body><return xsi:type=\"xsd:string\">I replaced a 9kb string that
was here</return></SOAP-ENV:Body></SOAP-ENV:Envelope>";
"/WSDebugInHeaders" = {
Connection = close;
"Content-Length" = 12657;
"Content-Type" = "text/xml; charset=ISO-8859-1";
Date = "Fri, 14 Mar 2008 23:38:16 GMT";
Server = "Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.7l
DAV/2 PHP/5.2.4";
"X-Powered-By" = "PHP/5.2.4";
"X-Soap-Server" = "NuSOAP/0.7.3 (1.114)";
};
"/WSDebugOutBody" = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n
\n <SOAP-ENV:Envelope\n\n xmlns:xsd=\"http://www.w3.org/2001/XMLSchema
\"\n\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n
\n xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\"\n
\n SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/
encoding/\"\n\n xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/
\">\n\n <SOAP-ENV:Body>\n\n <initSQLite xmlns=\"urn:soap\">
\n\n <email xsi:type=\"xsd:string\">email@hidden</email>\n
\n <password xsi:type=\"xsd:string\">myPasswd</password>\n
\n </initSQLite>\n\n </SOAP-ENV:Body>\n\n </SOAP-
ENV:Envelope>\n\n";
"/WSDebugOutHeaders" = {
"Content-Type" = "text/xml";
Host = "saers.dk";
Initsqlite = "";
"User-Agent" = "Mac OS X; WebServicesCore.framework (1.0.0)";
};
"/kWSHTTPResponseMessage" = <NSCFType: 0x124a1a0>;
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden