Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to retrieve an array of result #4

Open
buptstehc opened this issue May 4, 2012 · 13 comments
Open

how to retrieve an array of result #4

buptstehc opened this issue May 4, 2012 · 13 comments

Comments

@buptstehc
Copy link

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
Copy link
Collaborator

uvesten commented May 7, 2012

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
Copy link

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
Copy link

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

@utkuerturk
Copy link

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
Copy link

Hi,

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

Regards,

Teoni Valois

On Wed, May 9, 2012 at 6:22 PM, yeteryayeter <
[email protected]

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:
#4 (comment)

@buptstehc
Copy link
Author

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.

@teonivalois
Copy link

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, [email protected] 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:
#4 (comment)

@utkuerturk
Copy link

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
Copy link

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
Copy link

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
Copy link

Hi yeteryayeter,

This issue is not occurring with my services.

@seecoolguy
Copy link

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_AUFNR>
< P_LMNGA>1</P_LMNGA>
< P_PERNR>33</P_PERNR>
< P_VORNR>0100</P_VORNR>
< RETURN>
< item/>
< /RETURN>
< /urn:ZHS_PROCESS_CONFIRMATION>
< /soapenv:Body>
< /soapenv:Envelope>

Thank you for your time!

@ahmadabudawod
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants