And if I add further details from the auto-generated deploy.wsdd to my 
server-config.wsdd, I get proper local names and namespaces on my custom tags. 
However I can't stop Axis adding the exceptionName and hostname.

Any folks seen this please? I seem to be having a conversation with myself - 
very worrying!  ;-)

-----Original Message-----
From: Chris Nappin [mailto:[EMAIL PROTECTED] 
Sent: 26 August 2005 09:51
To: [email protected]
Subject: RE: How to throw custom exceptions?

Okay, I've been trying to get a bit further by using wsdl2java to generate the 
exceptions for me, so it can put in all the Axis-specifics.

I have defined a custom in my wsdl as follows:

<xsd:element name="MyFirstException">
   <xsd:complexType>
    <xsd:sequence>
     <xsd:element name="text" type="xsd:string" minOccurs="1" maxOccurs="1" 
nillable="false"/>
    </xsd:sequence>
   </xsd:complexType>
  </xsd:element>

When running my service Axis returns the following response:

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope 
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
    <soapenv:Body>
        <soapenv:Fault>
            <faultcode>soapenv:Server.generalException</faultcode>
            <faultstring/>
            <detail>
                <com.test.MyFirstException>
                    <text>Test!</text>
                </com.test.MyFirstException>
                <ns1:exceptionName 
xmlns:ns1="http://xml.apache.org/axis/";>com.test.MyFirstException</ns1:exceptionName>
                <ns2:hostname 
xmlns:ns2="http://xml.apache.org/axis/";>PC55-ABMUK</ns2:hostname>
            </detail>
        </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>

This is a step forward, as I now have custom fields (text) in the "detail" 
block. However, is there any way of stopping Axis generating the 
"exceptionName" and "hostname" fields?

Cheers,

  Chris.

________________________________________
From: Chris Nappin [mailto:[EMAIL PROTECTED] 
Sent: 25 August 2005 16:42
To: [email protected]
Subject: How to throw custom exceptions?


Hi,

  I'm having trouble throwing custom exceptions in an interoperable way in Axis 
1.2.1. I've read previous mailing list messages and looked at the 
"samples/faults" files but haven't got very far. I've been unable to get any 
custom data into the "detail" section of the fault.

Can someone please clarify:

1. What should my exception look like - does it extend Exception, 
RemoteException or ApacheFault? Does it need to be Serializable? Does Axis 
support the JAX-RPC way of having exceptions as immutable beans (constructors 
for setting properties, getters for reading, no setters)?
2. What should my service signature look like - simply "throws 
MyCustomException"?
3. What extra needs to go into my server-config.wsdd - I've tried adding an 
operation section with a fault, and a typeMapping.
4. I have lots of details of my custom fault in my wsdl, but if we don't use 
wsdl2java then Axis won't actually use that, right?

Thanks, 

Chris Nappin
Technical Architect
 
ABM United Kingdom Limited
Telephone: +44 (0) 115 977 6999
Facsimile: +44 (0) 115 977 6850
Web: http://www.abm-uk.com
 
ABM for Intelligent Solutions

  
CONFIDENTIALITY & PRIVILEGE NOTICE
This e-mail is confidential to its intended recipient. It may also be 
privileged. Neither the confidentiality nor any privilege attaching to this 
e-mail is waived lost or destroyed by reason that it has been mistakenly 
transmitted to a person or entity other than its intended recipient. If you are 
not the intended recipient please notify us immediately by telephone or fax at 
the numbers provided above or e-mail by Reply To Author and return the printed 
e-mail to us by post at our expense. We believe, but do not warrant, that this 
e-mail and any attachments are virus-free, but you should check. We may monitor 
traffic data of both business and personal e-mails. We are not liable for any 
opinions expressed by the sender where this is a non-business e-mail. If you do 
not receive all the message, or if you have difficulty with the transmission, 
please telephone us immediately.

 
CONFIDENTIALITY & PRIVILEGE NOTICE

This e-mail is confidential to its intended recipient. It may also be 
privileged. Neither the confidentiality nor any privilege attaching to this 
e-mail is waived lost or destroyed by reason that it has been mistakenly 
transmitted to a person or entity other than its intended recipient. If you are 
not the intended recipient please notify us immediately by telephone or fax at 
the numbers provided above or e-mail by Reply To Author and return the printed 
e-mail to us by post at our expense. We believe, but do not warrant, that this 
e-mail and any attachments are virus-free, but you should check. We may monitor 
traffic data of both business and personal e-mails. We are not liable for any 
opinions expressed by the sender where this is a non-business e-mail. If you do 
not receive all the message, or if you have difficulty with the transmission, 
please telephone us immediately.


 
CONFIDENTIALITY & PRIVILEGE NOTICE

This e-mail is confidential to its intended recipient. It may also be 
privileged. Neither the confidentiality nor any privilege attaching to this 
e-mail is waived lost or destroyed by reason that it has been mistakenly 
transmitted to a person or entity other than its intended recipient. If you are 
not the intended recipient please notify us immediately by telephone or fax at 
the numbers provided above or e-mail by Reply To Author and return the printed 
e-mail to us by post at our expense. We believe, but do not warrant, that this 
e-mail and any attachments are virus-free, but you should check. We may monitor 
traffic data of both business and personal e-mails. We are not liable for any 
opinions expressed by the sender where this is a non-business e-mail. If you do 
not receive all the message, or if you have difficulty with the transmission, 
please telephone us immediately.

Reply via email to