ok, so I'm just experimenting with some development. I'm trying to connect to a very simple .NET web service I created. Basically, I feed it a number between 1 and 3 and it sends me back a string telling me what number I fed it. Like I said...simple.
The documentation for dealing with web services is...limited..to say the least. I've pieced together what I can and have come up with the following:
It doesn't throw up any errors on the compile but when I run it and hit the button, the WSThingy results come back as
Searching for anything in that error block has proven to be fruitless. Can anyone see something that I'm missing? I'm hoping its something along the lines of "lol you noob. you forgot a ? at the end of your string. Go back to automator!!!11!!!!oneone"
The documentation for dealing with web services is...limited..to say the least. I've pieced together what I can and have come up with the following:
Code:
- (IBAction)fetchResults:(id)sender
{
NSString *ddlValue = [ddlNumb stringValue];
NSLog(@"DDLValue = %@", ddlValue);
WSMethodInvocationRef rpcCall;
NSURL *rpcURL = [NSURL URLWithString: @"http://test.dragonden.net/service.asmx"];
NSString *methodName = @"BringIt";
NSDictionary *params = [NSDictionary dictionaryWithObject: ddlValue forKey: @"x"];
NSDictionary *result;
rpcCall = WSMethodInvocationCreate((CFURLRef) rpcURL, (CFStringRef) methodName, kWSXMLRPCProtocol);
WSMethodInvocationSetParameters (rpcCall, (CFDictionaryRef) params, NULL);
result = (NSDictionary *) (WSMethodInvocationInvoke(rpcCall));
NSLog(@"result = %@", result);
if (WSMethodResultIsFault ((CFDictionaryRef) result)) {
NSLog(@"result = %@", [result objectForKey: (NSString *) kWSFaultString]);
[lblResult setStringValue: @"Error"];
} else {
[lblResult setStringValue: [result objectForKey: (NSString *) kWSMethodInvocationResult]];
}
}
It doesn't throw up any errors on the compile but when I run it and hit the button, the WSThingy results come back as
Code:
"/FaultCode" = -65794;
"/FaultExtra" = {
domain = -1;
error = -65795;
msg = "Can't find a 'methodResponse' element";
};
"/FaultString" = "/CFStreamFault";
"/kWSHTTPResponseMessage" = <NSCFType: 0x1a8900>;
"/kWSResultIsFault" = 1;
Searching for anything in that error block has proven to be fruitless. Can anyone see something that I'm missing? I'm hoping its something along the lines of "lol you noob. you forgot a ? at the end of your string. Go back to automator!!!11!!!!oneone"