I did get the same error : Guessing fault java type from qname: 
nl.borsoft.www.FacadeException.
It is happening with a standalone java client dynamically looking up the web 
service endpoint. And if there is a custom type in the  element of the WSDL 
file which can't be mapped to a known java package and class name.
I generated a WSDL file and mapping file with wscompile. 

  | <types>
  |     <schema targetNamespace="bla bla" etc. etc.
  |             <complexType name="FacadeException">
  |                     <sequence>
  |                             <element name="message" type="string" 
nillable="true" />
  |                     </sequence>
  |             </complexType>
  |             <element name="FacadeException" type="tns:FacadeException" />
  |     </schema>
  | </types>
  | <portType name="TapeFacadeEndpoint">
  |     <operation name="getXMLByNumber" parameterOrder="String_1">
  |             <input message="tns:TapeFacadeEndpoint_getXMLByNumber" />
  |             <output message="tns:TapeFacadeEndpoint_getXMLByNumberResponse" 
/>
  |             <fault name="FacadeException" message="tns:FacadeException" />
  |     </operation>
  | </portType>
  | <binding name="TapeFacadeEndpointBinding" type="tns:TapeFacadeEndpoint">
  |     <soap:binding transport="http://schemas.xmlsoap.org/soap/http"; 
style="rpc" />
  |     <operation name="getXMLByNumber">
  |             <soap:operation soapAction="" />
  |             <input>
  |                     <soap:body use="literal" 
namespace="http://www.borsoft.nl/daisy"; />
  |             </input>
  |             <output>
  |                     <soap:body use="literal" 
namespace="http://www.borsoft.nl/daisy"; />
  |             </output>
  |             <fault name="FacadeException">
  |                     <soap:fault name="FacadeException" use="literal" />
  |             </fault>
  |     </operation>
  | </binding>
  | <service name="DaisyService">
  |     <port name="TapeFacadeEndpointPort" 
binding="tns:TapeFacadeEndpointBinding">
  |             <soap:address location="REPLACE_WITH_ACTUAL_URL" />
  |     </port>
  | </service>
  | 
In this case my problem was the same because I published 1 method of my session 
facade as a web service. My session facade throws a custom FacadeException as 
an application exception. So my web service interface did the same.

  | public interface TapeFacadeEndpoint extends Remote {
  |     
  |     public abstract String getXMLByNumber(String number) throws 
RemoteException, FacadeException;
  | 
  | }
  | 
Deploying the web service worked fine. But now the java client wants to make a 
call. I followed the example of the WIKI with dynamically looking up a web 
service.

  | URL url = new URL("http://myhost:8080/DaisyEJB/DaisyService?wsdl";);
  | QName qname = new QName("http://www.borsoft.nl/daisy";, "DaisyService");
  | ServiceFactory factory = ServiceFactory.newInstance();
  | Service service = factory.createService(url, qname);
  | TapeFacadeEndpoint endpoint = (TapeFacadeEndpoint) 
service.getPort(TapeFacadeEndpoint.class);
  | System.out.println(endpoint.getXMLByNumber(number));
  | 
The XML is coming back because I return a XML document in a String variable. 
But also every time the same warning comes. What I did understand was that it 
has to do with JAX-RPC not knowing the mapping file.
So I read that JBoss has an alternative to ServiceFactory. And yes they have. 
The createService method can take more parameters. One of them is an URL to the 
mapping file. I placed the mapping file on a valid URL location and did the 
following.

  | URL url = new URL("http://localhost:8080/DaisyEJB/DaisyService?wsdl";);
  | URL mappingURL = new URL("http://hostname/whatever/mapping.xml";);
  | QName qname = new QName("http://www.borsoft.nl/daisy";, "DaisyService");
  | 
  | ServiceFactoryImpl factory = new ServiceFactoryImpl();
  | Service service = factory.createService(url, mappingURL, null, qname, null);
  | 
  | TapeFacadeEndpoint endpoint = (TapeFacadeEndpoint) 
service.getPort(TapeFacadeEndpoint.class);
  | System.out.println(endpoint.getXMLByNumber(number));
  | 
Now the call to the endpoint does not complain about not knowing the exception 
because there is a valid mapping in the mapping file. I did fill 2 parameters 
with null because of not knowing the exact purpose and guessing that the 
software was smart enough to react on a null parameter. Yes now you have not a 
JAX-RPC only dynamic lookup but a JBoss addition on JAX-RPC. But smart ;-)
I'm not very experienced on web services but step by step you learn. I think it 
is also possible to generate client stubs with wscompile just like wsdl2java 
from Axis. Then there is a solution of a J2EE client deployed in an EAR file 
(never done this).

O btw a lot of examples never use the fault element. Mostly I see only input 
and output and on the remote interface only throwing a RemoteException. If you 
look at http://www.xmethods.net and try a lot of wsdl files you rarely see the 
use of the fault element.
So in my mind the thought arises "Am I doing the things the right way with 
throwing a custom exception?"

You don't have to use the mapping file with dynamic lookup if you don't have 
custom types in your WSDL.

Johan

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3857989#3857989

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3857989


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to