SOAPFault details is null.

59 views
Skip to first unread message

Brian

unread,
Jun 14, 2010, 1:01:53 PM6/14/10
to WSDL2ObjC Discussion Group
I'm trying to pull out the details of a fault a call is returning.

Here is the response
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/
envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>SessionFault_FaultMessageException</faultstring>
<detail>
<ns1:SessionFault xmlns:ns1="http://test.testing123.com/service/
data">
<ns1:Operation>0</ns1:Operation>
<ns1:Reason>Error</ns1:Reason>
<ns1:Message>Invalid Data</ns1:Message>
</ns1:SessionFault>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

Here is the code that's parsing the data after the call:
...if ([mine isKindOfClass:[SOAPFault class]])
{
SOAPFault *f = mine;
NSLog(@"it's a fault: code:%@; string:%@; actor:%@; detail:%@",
f.faultcode, f.faultstring, f.faultactor, f.detail);
NSLog(@"sfs: %@", f.simpleFaultString);
}

The console log shows:
2010-06-14 12:41:54.684 Test[19207:207] it's a fault:
code:soapenv:Client; string:SessionFault_FaultMessageException; actor:
(null); detail:(null)
2010-06-14 12:41:54.685 Test[19207:207] sfs:
SessionFault_FaultMessageException

I would've expected "detail:(null)" to show the xml within the
<detail> tags. Do you see any reason why it isn't?

Regards,
Brian


pmilosev

unread,
Jun 14, 2010, 1:59:12 PM6/14/10
to WSDL2ObjC Discussion Group
Hi Brian

The parsing of the details is not handled properly yet here (string is
assumed to be provided in details).
Please check the Issue 97: http://code.google.com/p/wsdl2objc/issues/detail?id=97

There I have provided link to my fork of the project where I have
fixed this issue.
Please note that I have noticed that there is a bug in my code when
Java NullPointerException is thrown
on the server side. Will get it fixed in the next few days.

Also I am looking forward on merging my fork to the main project.

regards

Brian

unread,
Jun 15, 2010, 10:59:06 AM6/15/10
to WSDL2ObjC Discussion Group
Thanks so much.

Do you suggest I pull in the changes to the affected files
(Binding_M.template, USAdditions_H.template, USAdditions_M.template)
or should I just pull the entire NCA fork?

Regards,
Brian

Brian

unread,
Jun 15, 2010, 4:17:16 PM6/15/10
to WSDL2ObjC Discussion Group
I went ahead and pulled the git project and had that version of
wsdl2objc rebuild the objective c classes off the wsdl. I copied
these new files into my project and rebuilt. I think I've still got a
problem: detail is showing as null. To make sure I wasn't missing
anything, I put a NSLog call right before the soapFault assignment in
deserializeNode:expectedExceptions. I see my message in the log.
Here's the xml I received from the SOAP service I'm calling:

2010-06-15 16:04:24.648 HT[25859:5b53] ResponseBody:
<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/
envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Client</
faultcode><faultstring>SessionFault_FaultMessageException</
faultstring><detail><ns1:SessionFault xmlns:ns1="http://
test.testing123.com/service/data"><ns1:Operation>0</
ns1:Operation><ns1:Reason>Error</ns1:Reason><ns1:Message>Invalid Data</
ns1:Message></ns1:SessionFault></detail></soapenv:Fault></
soapenv:Body></soapenv:Envelope>

Is there anything about this response that seems invalid?

Regards,
Brian
On Jun 14, 1:59 pm, pmilosev <pmilo...@gmail.com> wrote:

Brian

unread,
Jun 15, 2010, 4:54:59 PM6/15/10
to WSDL2ObjC Discussion Group
After digging around some more, I think the problem is that the code
in deserializeFaultDetails was trying to create a instance of a class
whose definition doesn't exist. The fault classes got prefixed with
"tns1_", so when I try to create a instance of tns1_ + eName, things
begin to proceed as I expect. I still need to go through and make
sure the instance got set up correctly, but I wanted to let you know.

Regards,
Brian

pmilosev

unread,
Jun 16, 2010, 7:57:38 AM6/16/10
to WSDL2ObjC Discussion Group
sorry for my late reply but I visit this page on every few days :)

Regarding your first question ... My branch is made after this commit
from hasiilly "Ensure that we always select SOAP 1.2 if it's
available, superceding SOAP 1.1"
If you think you need some newer changes you can go with the main
branch and just patch-in my changes (not so many of them).
Otherwise you can use the NCA branch.

As I said there is a bug in my code as well .. it only properly passes
the exceptions defined into the WSDL.
Currently I get a crash if Java exception is thrown (I guess something
similar have happened to you as well).
If you have a fix for this issue pls post the patch.
Otherwise I will fix this issue in the next period (by the end of the
next week ... since currently I am working on a WSS XML-Siganture
support).

regards

Daniel Ninaus

unread,
Nov 22, 2011, 10:06:24 AM11/22/11
to wsdl2obj...@googlegroups.com
Hello!

will there be an update or how can i fix this in my code?

thanks for the answer

Reeyan Lee

unread,
Nov 22, 2011, 7:44:08 PM11/22/11
to wsdl2obj...@googlegroups.com
Hello

I don't have information when to update. I was one of the user who used the framework to make WebServices client on iOS and while investigating the issue I found it.
I think as the time being you can fix the code for yourself. I think the author of the framework already knew it.


--
You received this message because you are subscribed to the Google Groups "WSDL2ObjC Discussion Group" group.
To view this discussion on the web visit https://groups.google.com/d/msg/wsdl2objc-discuss/-/p8KjWcYqQwoJ.
To post to this group, send email to wsdl2obj...@googlegroups.com.
To unsubscribe from this group, send email to wsdl2objc-disc...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/wsdl2objc-discuss?hl=en.

Daniel Ninaus

unread,
Nov 23, 2011, 5:37:19 AM11/23/11
to wsdl2obj...@googlegroups.com
Hello!

Thanks for your answer. It looks like that if have to fix it on my own. I hope I can do this correctly.
Reply all
Reply to author
Forward
0 new messages