Re: Fault Strings

Alex Graveley <[email protected]> 22 Apr 2002 14:55:31 -0400
Newsgroups gmane.comp.gnome.ximian.soup
Message-ID <1019501757.10784.78.camel@luna>
Hi,

On Mon, 2002-04-22 at 14:41, Scott Hutton wrote:
> On Apr 21, Alex Graveley wrote:
> | SOUP_MESSAGE_IS_ERROR only tells you if the HTTP response was
> | unsuccessful, not whether a successful response contains a SOAP fault.
> 
> So, what's the proper way to obtain the fault string/code, etc.?
> 
>  -Scott

if (SOUP_MESSAGE_IS_ERROR(msg)) {
	g_print ("SOUP Error: %d \"%s\"\n", 
		 msg->errorcode,
		 msg->errorphase);
	exit (1);
}

parser = soup_parser_new_from_buffer (&msg->response);

fault = soup_parser_get_fault (parser);
if (fault) {
	g_print ("SOAP Fault: %s\n", soup_fault_get_string (fault));
	exit (1);
}

... process successful message ...

-Alex

-- 
"Make it go faster! Maybe if I click it, it will go faster..."


_______________________________________________
Soup-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/soup-list