jkichline / sudzc

http://sudzc.com
71 stars 34 forks source link

how to retrieve an array of result #4

Open buptstehc opened 12 years ago

buptstehc commented 12 years ago

Hi, I noticed that sudzc only retrieve the first element in the returned array result. so how can i did it for all? thanks!

uvesten commented 12 years ago

Hi there!

I've been using SudzC with arrays extensively, and it works.

If you want help with your problem, you'll need to be much more specific. When doesn't it work? Is it SOAP 1.1 or 1.2 you're working with? Do you have a test case you could upload?

Also, are you sure that the array in question contains more than one element?

utkuerturk commented 12 years ago

Hi ,

I have the same problem with buptstehc.

I used sudzc several times with .net web service and its perfect. But now I try to use with java web service and got error. The error is sudzc can't deserialize the list object and return nil. If I log the result it shows only first element.

I tried the solutions of this page but it doesn't work.

http://code.google.com/p/sudzc/issues/detail?id=19

Thanks

teonivalois commented 12 years ago

Fixed that on https://github.com/teonivalois/sudzc and already asked for a Pull Request. :) It's working like a charm!

utkuerturk commented 12 years ago

Hi teonivalois,

Thanks for your reply , I generated the objective c codes from your repository but result is same. You can see the result screen shot at http://b1205.hizliresim.com/x/b/5lngx.png .

And response xml is :

http://b1205.hizliresim.com/x/b/5lnx1.png

I think the problem is there isn't a root tag for array.

teonivalois commented 12 years ago

Hi,

Are you using ARC? Can you post the URL here?

Regards,

Teoni Valois

On Wed, May 9, 2012 at 6:22 PM, yeteryayeter < reply@reply.github.com

wrote:

Hi teonivalois,

Thanks for your reply , I generated the objective c codes from your repository but result is same. You can see the result screen shot at http://b1205.hizliresim.com/x/b/5lngx.png .

And response xml is :

http://b1205.hizliresim.com/x/b/5lnx1.png

I think the problem is there isn't a root tag for array.


Reply to this email directly or view it on GitHub: https://github.com/jkichline/sudzc/issues/4#issuecomment-5612135

buptstehc commented 12 years ago

Hi, uvesten! I am using objective-c with ARC. I found the weird thing in the generated SoapRequest.m:

if([deserializeTo respondsToSelector: @selector(initWithNode:)]) { element = [element childAtIndex:0]; output = [deserializeTo initWithNode: element];

So I think this is the problem where it is.

teonivalois commented 12 years ago

It was solved in my version: http://github.com/teonivalois/sudzc

PS.: Desculpe a brevidade. Esta mensagem foi enviada através do meu dispositivo móvel.

Atenciosamente, Teoni Valois

Em 09/05/2012, às 22:16, buptstehcreply@reply.github.com escreveu:

Hi, uvesten! I am using objective-c with ARC. I found the weird thing in the generated SoapRequest.m:

  • (void)connectionDidFinishLoading:(NSURLConnection *)connection. This method just deserialize the first element of the 'Body' received from soap response.

if([deserializeTo respondsToSelector: @selector(initWithNode:)]) { element = [element childAtIndex:0]; output = [deserializeTo initWithNode: element];

So I think this is the problem where it is.


Reply to this email directly or view it on GitHub: https://github.com/jkichline/sudzc/issues/4#issuecomment-5615971

utkuerturk commented 12 years ago

Hi teonivalois, sorry for late response

I tried some changes on service side but I had no success and I don't use Arc

You can find the service information and sample project on below.

service url : http://deneme-ws.btopcu.cloudfoundry.com/JAX-WS/Gateway

I call method in deailViewControllers viewDidload method.

ProjectLink: https://rapidshare.com/files/285801436/ChopTest.zip

Additional info: if you regenerate the code you have to make some changes.

1- CH_TestWSImplService change the service url ( remove the ":80" )

self.serviceUrl = @"http://deneme-ws.btopcu.cloudfoundry.com/JAX-WS/Gateway";

2- soap.m , createEnvelope method add "ws" ( first 2 character of namespace )

change xmlns=\"%@\">", ns]; to xmlns:ws=\"%@\">", ns];

[s appendFormat: @"ws:%@%@/ws:%@", method,[params stringByReplacingOccurrencesOfString:@"&" withString:@"&"], method];

Thanks

teonivalois commented 12 years ago

Hi,

Simply go to your CH_TestWSImplService.m line 60 and change the [... desserializeTo: nil] parameter to [... desserializeTo: [CH_responseBean alloc]] and it will work! :)

utkuerturk commented 12 years ago

Hi ,

Thanks for answer , you solved my problem. And yes it is really too simple.

Last question how can i fix this issue in sudzc source code.

teonivalois commented 12 years ago

Hi yeteryayeter,

This issue is not occurring with my services.

seecoolguy commented 12 years ago

teonivalois, thanks for forking this project. I have a question on the user of parameters. My envelope to a soap call 1.1 should appear like the following sample below, how do I create the parameters to go with my function? the sudzc generated code looks like this:

- (SoapRequest*) ZHS_PROCESS: (id) _target action: (SEL) _action
    {
    NSMutableArray* _params = [NSMutableArray array];

    NSString* _envelope = [Soap createEnvelope: @"ZHS_PROCESS" forNamespace: self.namespace withParameters: _params withHeaders: self.headers];

    SoapRequest* _request = [SoapRequest create: _target action: _action service: self soapAction: @"http://www.sap.com/ZHS_PROCESS" postData: _envelope deserializeTo: nil];

    [_request send];

    return _request;
}

< soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sap-com:document:sap:rfc:functions"> < soapenv:Header/> < soapenv:Body> < urn:ZHS_PROCESS> < P_AUFNR>172635 < P_LMNGA>1 < P_PERNR>33 < P_VORNR>0100 < RETURN> < item/> < /RETURN> < /urn:ZHS_PROCESS_CONFIRMATION> < /soapenv:Body> < /soapenv:Envelope>

Thank you for your time!

ahmadabudawod commented 10 years ago

Dear teonivalois Please could you tell me what do you mean by [CH_responseBean alloc]]
i tried used [nsmutabledicationry dictionary] but didn't work. What is the class should i replaced with nill