WebServiceCore: Stream Fault Error
WebServiceCore: Stream Fault Error
- Subject: WebServiceCore: Stream Fault Error
- From: "Dr. Jan-Hendrik Dörner" <email@hidden>
- Date: Thu, 2 Dec 2004 15:32:22 +0100
Hi,
I am trying to use the WebServiceCore functions within Object-C.
Although they seem to work fine, they do so only sometimes. After a
couple of WSMethodInvocationInvoke calls to the same server
("Localhost"), I get a CFStreamFaul -Error response. Sometimes, this
error disappears on a repeated call with the same arguments. If I check
my Apache-logs, I cannot see that in those cases any calls were
received.
Unfortunately, sometimes I cannot get any calls to get out at all.
Is this a common problem?
What can I do get answers more reliably?
Here is the source-code I use in my program. (I am aware, that async -
calls are better, but this justs adds complexity to my problems, since
I have the same trouble there...)
NSString *SOAPSERVER =@"http://localhost/HelloServer.php";
NSString *SOAPMETHODSERVER =@"http://localhost/HelloServer.php/";
int RETRIES = 7;
- (NSDictionary *)callServer:(NSString *)method
withParameter:(NSDictionary *)params{
NSDictionary *result = NULL;
int zz=RETRIES;
WSMethodInvocationRef soapCall;
do{ if(result != NULL) [result release]; result = NULL;
soapCall = WSMethodInvocationCreate((CFURLRef)[NSURL
URLWithString:SOAPSERVER],(CFStringRef) method, kWSSOAP2001Protocol );
WSMethodInvocationSetParameters(soapCall,(CFDictionaryRef)[NSDictionary
dictionaryWithObject:params forKey:@"parameter"],NULL );
WSMethodInvocationSetProperty(soapCall, kWSSOAPBodyEncodingStyle,
kWSSOAPStyleRPC);
WSMethodInvocationSetProperty(soapCall, kWSSOAPMethodNamespaceURI,
(CFTypeRef)SOAPSERVER);
WSMethodInvocationSetProperty(soapCall, kWSHTTPExtraHeaders,
[NSDictionary dictionaryWithObject:[SOAPMETHODSERVER
stringByAppendingString:method] forKey:@"SOAPAction"]);
result = (NSDictionary *)WSMethodInvocationInvoke( soapCall );
CFRelease(soapCall);
}while(WSMethodResultIsFault((CFDictionaryRef) result) && (--zz > 0));
if(WSMethodResultIsFault((CFDictionaryRef) result)) {
NSLog(@"Cannot execute %@ due to Network Error.",method);
}
return result;
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden