This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Services and the fly likes Why Getting Fault Code in SOAP Response Message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Why Getting Fault Code in SOAP Response Message" Watch "Why Getting Fault Code in SOAP Response Message" New topic
Author

Why Getting Fault Code in SOAP Response Message

somia razzaq
Ranch Hand

Joined: Jan 26, 2010
Posts: 44
Hi !!!
I am using SAAJ to display the request and response maessages generated by my web service. I am successful to get soap request message but at respose, i get the following fault message. why this happens? where i am wrong. Kindly help me.

Response:

<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<S:Fault xmlns:ns3="http://www.w3.org/2003/05/soap-envelope"><faultcode>S:Client</faultcode><faultstring>Cannot find dispatch method for {}</faultstring></S:Fault>
</S:Body>
</S:Envelope>

Best Wishes!!!
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
The value Client in the <faultcode> element indicates that there was something wrong with the request message; most likely it is malformed in some way.
To find the cause of this error, I suggest using soapUI to create and send a valid request message to the service and then compare it to the request message you construct in the code using SAAJ.
Best wishes!
somia razzaq
Ranch Hand

Joined: Jan 26, 2010
Posts: 44
Ivan Krizsan wrote:Hi!
The value Client in the <faultcode> element indicates that there was something wrong with the request message; most likely it is malformed in some way.
To find the cause of this error, I suggest using soapUI to create and send a valid request message to the service and then compare it to the request message you construct in the code using SAAJ.
Best wishes!




I use soapUI to test soap request and response messages. Given following:

Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sim="http://j2ee.netbeans.org/wsdl/simple_WSDL">
<soapenv:Header/>
<soapenv:Body>
<sim:simple_WSDLOperation>
<Age>?</Age>
<Name>?</Name>
</sim:simple_WSDLOperation>
</soapenv:Body>
</soapenv:Envelope>


Response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sim="http://j2ee.netbeans.org/wsdl/simple_WSDL" xmlns:sim1="http://xml.netbeans.org/schema/simple_schema">
<soapenv:Header/>
<soapenv:Body>
<sim:simple_WSDLOperationResponse>
<student_object>
<sim1:Age>?</sim1:Age>
<sim1:Name>?</sim1:Name>
</student_object>
</sim:simple_WSDLOperationResponse>
</soapenv:Body>
</soapenv:Envelope>

I have error in both. Can you tell me about this error and how i remove it ?

Best Wishes.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
It looks like you receive a good response when using soapUI. The next step, as I said before, would be to compare the request from soapUI with the request from your client. My guess is that there is something wrong with your client and it sends bad requests to the service, which then returns a fault.
Best wishes!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why Getting Fault Code in SOAP Response Message