Hi Gurus,
My scenario is client side is using axis1.2 and service running on server
side is using axis2.3.
When I tried to generate client stubs by using axis1.2 wsdl2java, I got
below exception message. XMLStreamExceptionFault is the thrown exception of
web service method.
{http://service.ws.apache.org/axis2/xsd} XMLStreamExceptionFault already
exists
java.io.IOException: ERROR: Missing <soap:fault> element inFault
"pingFFault" in operation "pingFFault", in binding pingF
at
org.apache.axis.wsdl.symbolTable.SymbolTable.faultsFromSOAPFault(SymbolTable
java:2849)
...
..
I have couple of questions.
First, I discussed with some other guys, they told me the root cause is that
axis1.2 could not recognize axis2 exception definition/description. If their
comment is true, I wonder if there is a way to fix this issue. Such as,
change the axis2 web service configuration to conform to axis1.2.
Second, when I ran my command to generate the stubs via the auto generated
WSDL, if I use the URI, for example,
localhost:8080/aixs2/service/MyService?WSDL, it failed at very late stage
and got above exception message. But if I save the content as a wsdl file
and generate the stubs via the file, it reported that I need define some
xmlns for prefix. I wonder why the former way does not require this why the
latter has to.
Third, what does " XMLStreamExceptionFault already exists" mean? I will get
this duplicated message if more than one method throw the same exception. I
wonder if this is due to Axis1.2 as well.
Any discussion will be much appreciated. Thanks in advance.
FYI. Below is the web service method and service.xml
import org.apache.axiom.om.OMElement;
import org.apache.axis2.AxisFault;
import javax.xml.stream.XMLStreamException;
public class MyService {
public OMElement echo(OMElement element) throws XMLStreamException {
//Praparing the OMElement so that it can be attached to another OM
Tree.
//First the OMElement should be completely build in case it is not
fully built and still
//some of the xml is in the stream.
element.build();
//Secondly the OMElement should be detached from the current OMTree
so that it can
// be attached some other OM Tree. Once detached the OmTree will
remove its
// connections to this OMElement.
element.detach();
return element;
}
public void ping(OMElement element) throws XMLStreamException {
//Do some processing
}
public void pingF(OMElement element) throws AxisFault{
throw new AxisFault("Fault being thrown");
}
}
<service>
<description>
This is a sample Web Service with two operations,echo and ping.
</description>
<parameter name="ServiceClass" locked="false">
userguide.example1.MyService
</parameter>
<operation name="echo">
<messageReceiver
class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
<actionMapping>urn:echo</actionMapping>
</operation>
<operation name="ping">
<messageReceiver
class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
<actionMapping>urn:ping</actionMapping>
</operation>
</service>
Regards,
Anson
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]