Hi Deepak

Please try the following within the SoapFaultException catch block (copied from the soap-fault-trace example):

            System.err.println("SOAP Fault");
            System.err.println("----------");
            System.err.println(e.getFault());
            List details = se.getFault().getDetails();
            if (details.size()>  0) {
                System.err.println();
                System.err.println("Details");
                System.err.println("-------");
                for (Iterator iterator = details.iterator(); 
iterator.hasNext();) {
                    System.err.println(iterator.next());
                }
            }

If you want to use a custom SoapFaultResolver, you will need to call client.setSoapFaultResolver(...) before calling client.call(city).

If this doesn't help, you'll need to get a copy of the request and response messages for further diagnosis. You can do this by either:

  1. Using JiBX/WS interceptors - see example [1], or
  2. Using a monitoring proxy, such as Apache TCPMon

cheers
Nigel

[1] http://jibx.svn.sourceforge.net/viewvc/jibx/jibxws/trunk/examples/http-servlet-interceptor/build/src/org/jibx/ws/example/interceptor/client/HelloClient.java?revision=450&content-type=text%2Fplain


On 15/03/11 07:14, Deepak Singh wrote:
Hi Nigel,

Changing the code as suggested by you again produces SoapFaultException. Details as follows,

try{
IBindingFactory fac = BindingDirectory.getFactory(GetCityDetails.class);
SoapClient client = new SoapClient("http://webservices.ticketvala.com/axis2/services/WSTicketvala";, fac);
client.setOperationName("urn:wsGetCity");
GetCityDetails city = new GetCityDetails();
Authenticate aut = new Authenticate();
aut.setGid("1");
aut.setPwd("faregugly@mmyt");
aut.setUid("faregugly");
city.setAuth(aut);
client.addInFaultDetailsHandler(new ExceptionReader());
Line 31- Object obj = client.call(city);
client.setSoapFaultResolver(new SoapFaultResolver() {
@Override
public Object handleFault(SoapFault arg0) {
System.out.println(arg0.getFaultCode().getUri());
return null;
}
});
}catch(SoapFaultException se) {
System.out.println("Error "+se.getFault()+" "+se.getFault().getFaultString()+" "+se.getMessage());
se.printStackTrace();
}catch(Exception e) {
e.printStackTrace();
}
}

Running this program produces the following output

Error soapenv:Server - unknown  unknown  unknown
org.jibx.ws.soap.SoapFaultException: unknown
at org.jibx.ws.soap.client.SoapClient.handleFault(SoapClient.java:428)
at org.jibx.ws.soap.client.SoapClient.call(SoapClient.java:418)
at com.jibx.gwt.shared.TestJibx.main(TestJibx.java:31)

Kindly suggest how to resolve this.

Thanks
Deepak



On Mon, Mar 14, 2011 at 1:36 PM, <[email protected] <mailto:[email protected]>> wrote:

    Send jibx-users mailing list submissions to
    [email protected]
    <mailto:[email protected]>

    To subscribe or unsubscribe via the World Wide Web, visit
    https://lists.sourceforge.net/lists/listinfo/jibx-users
    or, via email, send a message with subject or body 'help' to
    [email protected]
    <mailto:[email protected]>

    You can reach the person managing the list at
    [email protected]
    <mailto:[email protected]>

    When replying, please edit your Subject line so it is more specific
    than "Re: Contents of jibx-users digest..."


    Today's Topics:

      1. Re: Starting Jibx (Nigel Charman)


    ----------------------------------------------------------------------

    Message: 1
    Date: Mon, 14 Mar 2011 21:05:55 +1300
    From: Nigel Charman <nigel.charman.nz
    <http://nigel.charman.nz>@gmail.com <http://gmail.com>>
    Subject: Re: [jibx-users] Starting Jibx
    To: JiBX users <[email protected]
    <mailto:[email protected]>>
    Message-ID: <[email protected]
    <mailto:[email protected]>>
    Content-Type: text/plain; charset="utf-8"

    Hi Deepak

    Since this is a SOAP service, you should use SoapClient rather than
    PoxClient.  The POX interface simply transports Plain Old XML payloads
    without the additional SOAP constructs (see
    http://jibx.sourceforge.net/jibxws/pox.html).

    The following WSDL implies that the SOAP service is requiring a
    SOAPAction header set to "urn:wsGetCity".

    <wsdl:operation name="wsGetCity">
    <wsdl:input message="tns:wsGetCityMessage"
    wsaw:Action="urn:wsGetCity"/>

    To set this header, you'll need to change your code from:

        Client client = new
    PoxClient("http://webservices.ticketvala.com/axis2/services/WSTicketvala";,
    fac);
        ...

    to

        SoapClient client = new
    SoapClient("http://webservices.ticketvala.com/axis2/services/WSTicketvala";,
    fac);
        client.setOperationName("urn:wsGetCity");
        ...

    If this still fails with a SOAPFault, catch the SoapFaultException and
    call getFault() and getMessage() for details of the fault.

    cheers
    Nigel

    On 14/03/11 09:50, Deepak Singh wrote:
    > Hi Dennis,
    >
    > I downloaded the latest jibx-ws-0.9.1 and tried my webservices with
    > this one. Details is as follows,
    >
    > I have a wsdl file at
    > http://webservices.ticketvala.com/axis2/services/WSTicketvala?wsdl
    > Pls hit the url above to see the wsdl file. here there are different
    > methods to invoke. I try with single method wsGetCity.
    >
    > I need to invoke this method to get the response. Xml for
    request and
    > response is as follows,
    >
    > request.xml
    >
    > <wsGetCity>
    >
    > **
    >
    > <wsGetCityRQ>
    >
    > <wsAuthenticate>
    >
    > <userId>xyz</userId>
    >
    > <groupId>1</groupId>
    >
    > <password>xyz</password>
    >
    > </wsAuthenticate>
    >
    > </wsGetCityRQ>
    >
    > </wsGetCity>
    >
    >
    > similarly response.xml has its own format.
    >
    >
    > I created datamodel and binding file for request.xml as follows,
    >
    > public class GetCityDetails {
    >
    > public GetCityDetails() {
    >
    > }
    >
    > private Authenticate auth;
    >
    >
    > public Authenticate getAuth() {
    >
    > return auth;
    >
    > }
    >
    >
    > public void setAuth(Authenticate auth) {
    >
    > this.auth = auth;
    >
    > }
    >
    > }
    >
    >
    > public class Authenticate {
    >
    >
    > public Authenticate() {
    >
    >
    > }
    >
    >
    > private String uid;
    >
    > private String gid;
    >
    > private String pwd;
    >
    > public String getUid() {
    >
    > return uid;
    >
    > }
    >
    > public void setUid(String uid) {
    >
    > this.uid = uid;
    >
    > }
    >
    > public String getGid() {
    >
    > return gid;
    >
    > }
    >
    > public void setGid(String gid) {
    >
    > this.gid = gid;
    >
    > }
    >
    > public String getPwd() {
    >
    > return pwd;
    >
    > }
    >
    > public void setPwd(String pwd) {
    >
    > this.pwd = pwd;
    >
    > }Exception
    >
    > }
    >
    >
    > binding.xml
    >
    > <?xml version="1.0" encoding="UTF-8"?>
    >
    > <binding>
    >
    > <mapping name="wsGetCity" class="com.jibx.gwt.shared.GetCityDetails"
    > ordered="false">
    >
    > <structure name="wsGetCityRQ" usage="optional">
    >
    > <structure name="wsAuthenticate" field="auth" usage="optional">
    >
    > <value name="userId" field="uid" usage="optional"></value>
    >
    > <value name="groupId" field="gid" usage="optional"></value>
    >
    > <value name="password" field="pwd" usage="optional"></value>
    >
    > </structure>
    >
    > </structure>
    >
    > </mapping>
    >
    > </binding>
    >
    >
    > I run the jibx compiler jibx 1.2.2 as eclipse plugin and compilation
    > successful.
    >
    >
    > Now i create the client to invoke the method wsGetCity
    >
    >
    > IBindingFactory fac =
    BindingDirectory.getFactory(GetCityDetails.class);
    >
    > Client client = new
    >
    PoxClient("http://webservices.ticketvala.com/axis2/services/WSTicketvala";,
    > fac);
    >
    > GetCityDetails city = new GetCityDetails();
    >
    > Authenticate aut = new Authenticate();
    >
    > aut.setGid("1");
    >
    > aut.setPwd("faregugly@mmyt");
    >
    > aut.setUid("faregugly");
    >
    > city.setAuth(aut);
    >
    > client.call(city);
    >
    >
    > Now at the last line, client.call(city), i get the exception as
    > org.jibx.ws.transport.WsTransportException: 500 Internal Server
    Error
    >
    > I tried with SoapClient also but got SoapFault exception.
    >
    > Kindly request you to find out my mistake. Am i passing correct
    url to
    > PoxClient ?
    >
    > Also, is this the correct way to consume webservice methods at
    client
    > side?
    >
    > Kindly explain the concept a bit.
    >
    > Thanks
    > Deepak
    >
    > On Sat, Mar 12, 2011 at 11:57 AM, Dennis Sosnoski
    <[email protected] <mailto:[email protected]>
    > <mailto:[email protected] <mailto:[email protected]>>> wrote:
    >
    >     Hi Deepak,
    >
    >     If you have existing schemas for your documents you'll probably
    >     want to start with code generation from schema:
    > http://jibx.sourceforge.net/fromschema/index.html
    >
    >     JiBX does not currently support direct code generation from
    WSDL -
    >     you'd instead need to first extract the schemas from the WSDL
    >     yourself, then use JiBX to generated the data model code
    from the
    >     schemas. Once you have the data model you can use it with
    Axis2 or
    >     JiBX/WS for the actual web services handling. CXF support is
    also
    >     possible, though that needs to be documented. I'll try to do
    a new
    >     release of JiBX/OTA sometime soon which includes a CXF
    implementation.
    >
    >       - Dennis
    >
    >     Dennis M. Sosnoski
    >     Java SOA and Web Services Consulting
    > <http://www.sosnoski.com/consult.html>
    >     Axis2/CXF/Metro SOA and Web Services Training
    > <http://www.sosnoski.com/training.html>
    >     Web Services Jump-Start <http://www.sosnoski.com/jumpstart.html>
    >
    >
    >     On 03/10/2011 07:38 PM, Deepak Singh wrote:
    >>     Hi,
    >>     I am new to this group and this is my first post.
    >>     I have two web services , one is RestFull and another is SOAP
    >>     based wsdl.
    >>     Currently i am using xmlBeans for Restful and Jaxb for wsdl
    data
    >>     binding. Now i plan to use Jibx.
    >>     After going through the tutorial, i am bit confused which
    >>     approach should i take as it provides many ways to use jibx.
    >>     Kindly suggest the easiest way to do this binding.
    >>     I am using Spring.
    >>     Thanks
    >>
    >>
>> ------------------------------------------------------------------------------
    >>     Colocation vs. Managed Hosting
    >>     A question and answer guide to determining the best fit
    >>     for your organization - today and in the future.
    >> http://p.sf.net/sfu/internap-sfd2d
    >>
    >>
    >>     _______________________________________________
    >>     jibx-users mailing list
    >> [email protected]
    <mailto:[email protected]>
    <mailto:[email protected]
    <mailto:[email protected]>>
    >> https://lists.sourceforge.net/lists/listinfo/jibx-users
    >>
    >
    >
    >
    >
    
------------------------------------------------------------------------------
    > Colocation vs. Managed Hosting
    > A question and answer guide to determining the best fit
    > for your organization - today and in the future.
    > http://p.sf.net/sfu/internap-sfd2d
    >
    >
    > _______________________________________________
    > jibx-users mailing list
    > [email protected]
    <mailto:[email protected]>
    > https://lists.sourceforge.net/lists/listinfo/jibx-users
    -------------- next part --------------
    An HTML attachment was scrubbed...

    ------------------------------

    
------------------------------------------------------------------------------
    Colocation vs. Managed Hosting
    A question and answer guide to determining the best fit
    for your organization - today and in the future.
    http://p.sf.net/sfu/internap-sfd2d

    ------------------------------

    _______________________________________________
    jibx-users mailing list
    [email protected]
    <mailto:[email protected]>
    https://lists.sourceforge.net/lists/listinfo/jibx-users


    End of jibx-users Digest, Vol 58, Issue 7
    *****************************************



------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d


_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to