RE: Web Services Client in Cocoa
RE: Web Services Client in Cocoa
- Subject: RE: Web Services Client in Cocoa
- From: "Josh Ferguson" <email@hidden>
- Date: Mon, 10 Feb 2003 13:19:02 -0600
- Priority: normal
- Thread-topic: Web Services Client in Cocoa
Jeff,
I actually ran into this problem a couple of weeks ago. There are a couple of issues with the WSDL parser that may need to be corrected before you'll actually get any kind of response back. First, the soapAction header will never get set (not a problem in this case, but something to keep in mind...you can fix this in the -createInvocationRef:methodName:protocol:stype:soapAction:: method...you'll notice that &soapAction is passed for both parameters when making the header dictionary...) The second problem you might encounter is that the WSGeneratedObject will only return the "/Results" section of the dictionary it gets back. If there was an error communicating with the server, you won't get any results, but you won't see the errors either. I think there's also a problem in this section of the code:
- (NSDictionary *) getResultDictionary
{
...
if (fResult == NULL) {
WSMethodInvocationRef* invocation = [self getRef];
...
}
I believe it should be: WSMethodInvocationRef invocation = [self getRef];, as [self getRef] returns a WSMethodInvocationRef, not a WSMethodInvocationRef*...Let me know if that works for you.
If these don't fix the problem, I'd recommend stepping through things in the debugger to see where the error is actually occuring.
Josh
-----Original Message-----
From: Jeff LaMarche [
mailto:email@hidden]
Sent: Monday, February 10, 2003 12:51 PM
To: Cocoa Development List
Subject: Web Services Client in Cocoa
I've been playing around with writing a web services client in Cocoa. I
wrote a very simple web service and installed it on a local copy of
TomCat with Axis. The service is correctly installed and running.
I ran WSMakeStubs on the wsdl and it generated my classes, but now I am
at a loss to actually get a result back from the web service. I read
the Gilmore article at O'Reilly's MacDevCenter, but until part 2 is
released, it isn't much help. It seems that no matter what I do, I
always get a null return value. The first thing I changed was to change
the endpoint from @"(null)" to the URL of my service
- (WSMethodInvocationRef) genCreateInvocationRef
{
return [self createInvocationRef
/*endpoint*/:
@"
http://localhost:8080/axis/services/Test?wsdl"
methodName: @"testService"
protocol: (NSString*) kWSSOAP2001Protocol
// missing encoding style - defaulting to RPC
style: (NSString*) kWSSOAPStyleRPC
soapAction: nil /* No SOAPAction header needed */
methodNamespace: NULL /* No Method Namespace specified */
];
}
I also tried it without the ?wsdl at the end.
I am attempting to invoke it like this:
id rtnval = [serviceTestService testService];
NSLog(@"%@", rtnval);
Has anyone successfully done this and have an idea what I might be
doing wrong?
TIA...
Jeff
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.