• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Complex data for webservices
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Complex data for webservices


  • Subject: Re: Complex data for webservices
  • From: Niklas Saers <email@hidden>
  • Date: Mon, 21 Apr 2008 14:15:25 +0200

Just a short PS

On Apr 21, 2008, at 1:45 PM, Niklas Saers wrote:
TestAuthentication *WS = [[TestAuthentication alloc] init];
[WS setParameters:param];
NSLog(@"isComplete == %d, isFault == %d, true == %d", [WS isComplete], [WS isFault], YES);

I hadn't noticed that static functions were also present in the stubs, so I tried them but got the same results. I added a NSLog there as well, and got the same result:


+ (id) TestAuthentication:(CFTypeRef) in_parameters
{
id result = NULL;
TestAuthentication* _invocation = [[TestAuthentication alloc] init];
[_invocation setParameters: in_parameters];
result = [[_invocation resultValue] retain];
NSLog(@"debug: isComplete: %d, isFault: %d, true: %d", [_invocation isComplete], [_invocation isFault], YES);
[_invocation release];
return result;
}


output: debug: isComplete: 1, isFault: 1, true: 1

To decouple this from the complex types, I wrote a little webservice in C# for MS-IIS called testInt that I've verified with SOAP Client from Scandalous Software that behaves correctly:

[WebMethod]
int testInt() {
  return 5;
}

that returns

<soap:Envelopexmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:xsi="http://www.w3.org/2001/XMLSchema instance"xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
-<soap:Body>
-<testIntResponse xmlns="webservices.mydomain.com/myService">
-<testIntResult>-5</testIntResult>
</testIntResponse>
</soap:Body>
</soap:Envelope>


Again I added debug info to the code:
+ (id) testInt:(CFTypeRef) in_parameters
{
id result = NULL;
testInt* _invocation = [[testInt alloc] init];
[_invocation setParameters: in_parameters];
result = [[_invocation resultValue] retain];
NSLog(@"debug: isComplete: %d, isFault: %d, true: %d", [_invocation isComplete], [_invocation isFault], YES);
[_invocation release];
return result;
}


and again it failed: debug: isComplete: 1, isFault: 1, true: 1

My call in this case was:
[Service1Service testInt:[[NSDictionary alloc] init]];

That is, an empty dictionary, so no parameters. I tried passing nil, but then it just crashed

For the authentication I called:
NSDictionary *serviceDict = (NSDictionary*) [myServiceService TestAuthentication:param];
NSLog(@"Entries: %d", [serviceDict count]);


and I got: "Entries: 0"

So either way isFault returns YES, and either way I get an empty NSDictionary back. Why is this, and how do I get it to return correctly? (you'd think it'd be easy enough calling an "int function()" ;-) )

Cheers

	Nik
_______________________________________________

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


  • Follow-Ups:
    • Re: Complex data for webservices
      • From: Jeff LaMarche <email@hidden>
References: 
 >Complex data for webservices (From: Niklas Saers <email@hidden>)
 >Re: Complex data for webservices (From: Niklas Saers <email@hidden>)

  • Prev by Date: Re: Cropping an NSBitmapImageRep to a given NSRect?
  • Next by Date: Crash when dispaying document in iChat Theater
  • Previous by thread: Re: Complex data for webservices
  • Next by thread: Re: Complex data for webservices
  • Index(es):
    • Date
    • Thread