[wsf-c-dev] Fault handling in data service
Manoj
manoj at wso2.com
Tue Mar 4 21:47:11 PST 2008
Samisa Abeysinghe wrote:
> Manoj wrote:
>> Samisa Abeysinghe wrote:
>>> Manoj wrote:
>>>> Manoj wrote:
>>>>> hi all,
>>>>>
>>>>> There are some cases which we need to do fault handling in our PHP
>>>>> dataservice.
>>>>>
>>>>> Eg
>>>>> 1)when there are no data in the table.
>>>>> 2)when the table doesn't exist.
>>>>> 3)when the database doesn't exist.
>>>>> 4)queries which are return null values.
>>>>>
>>>>> The JAVA people sending custom errors massages for those
>>>>> faults.They don't do AXIS level fault handling. Can anybody
>>>>> explain the way which we need to handle those faults.
>>>
>>> We can send a SOAP fault with a custom fault reason.
>>>
>>> Samisa...
>>>
>> Hi samisa,
>>
>> In according to nandika's idea currently we send the custom fault
>> reason inside the <error> element. Is that good enough?
>>
>> Eg: Response = <ds:customer-addresses
>> xmlns:ds="http://wso2.org/projects/wsf/php/ds"><error>table not
>> found</error></ds:customer-addresses>
>
> Is there a complete SOAP message captured with a full fault.
>
> Samisa...
>
I attached the full fault with this.
-------------- next part --------------
==============
Listen Port: 8080
Target Host: 127.0.0.1
Target Port: 80
==== Request ====
POST /samples/DataService/MyService.php HTTP/1.1
User-Agent: Axis2/C
Content-Length: 469
Content-Type: application/soap+xml;charset=UTF-8;action="urn:ds"
Host: 127.0.0.1:8080
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:To>http://localhost:8080/samples/DataService/MyService.php</wsa:To>
<wsa:Action>urn:ds</wsa:Action>
<wsa:MessageID>45294cae-ea69-1dc1-2b53-001676d512ae</wsa:MessageID>
</soapenv:Header>
<soapenv:Body>
<customerAddress>
<firstName>Carine</firstName>
<lastName>Schmitt</lastName>
</customerAddress>
</soapenv:Body></soapenv:Envelope>==== Response ====
HTTP/1.1 200 OK
Date: Wed, 05 Mar 2008 04:04:36 GMT
Server: Apache/2.2.8 (Unix) PHP/5.2.5
X-Powered-By: PHP/5.2.5
Content-Length: 711
Content-Type: application/soap+xml;charset=UTF-8
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Action>urn:ds</wsa:Action>
<wsa:From>
<wsa:Address>http://localhost:8080/samples/DataService/MyService.php</wsa:Address>
</wsa:From>
<wsa:MessageID>45342476-ea69-1dc1-269f-001676d512ae</wsa:MessageID>
<wsa:RelatesTo wsa:RelationshipType="http://www.w3.org/2005/08/addressing/reply" xmlns:wsa="http://www.w3.org/2005/08/addressing">45294cae-ea69-1dc1-2b53-001676d512ae</wsa:RelatesTo>
</soapenv:Header>
<soapenv:Body>
<ds:customer-addresses xmlns:ds="http://wso2.org/projects/wsf/php/ds">
<error>table not found</error>
</ds:customer-addresses>
</soapenv:Body></soapenv:Envelope>
==============
More information about the Wsf-c-dev
mailing list