Hi...

I tried using Proxy but it doesn't help, I got the same error " Prefix cannot 
be null when creating QName"

I thing I'm doing something wrong.
My webservice is deployed in Tomcat, and the client's classes generated from 
the wsdl file are in the client application lib directory. is it ok like that?

I noticed that the wsdl generated in the webbrowser (using my app URL?wsdl) is 
not the same when using XFile ' wsdlGen ', and when using  " wsgen " to 
generate client's code, generated classes when using web-browser wsdl are not 
the same when using the XFire generated one.
One more thing when generating wsdl with XFire tool I got at the end of the 
file something like :


   <wsdl:service name="LdapServiceService">

      <wsdl:port binding="impl:ldapserviceSoapBinding" name="ldapservice">

         <wsdlsoap:address 
location="http://localhost:8080/ldap/services/ldapservice"/>

      </wsdl:port>

   </wsdl:service>

You can see that the service name is LdapServiceService and it is defined in my 
services.xml LdapService, where this name comes from?

I attached to this message XFire generated wsdl file, and the one generated in 
web browser, hope this will clarify my problem

Thank you in advance for your help


  ----- Original Message ----- 
  From: Mohammed El ammaria 
  To: user@xfire.codehaus.org 
  Sent: Sunday, April 01, 2007 9:45 AM
  Subject: Re: [xfire-user] prefix cannot be "null" when creating a QName


  I didnt finde out your problem, I suggest to use different methode to invoke 
yor service (Look http://xfire.codehaus.org/Client+API).

  I hope that will help.


  2007/4/1, Youssef <[EMAIL PROTECTED]>:
    Hi.. 

    Thank you for replying on my message.
    I'm new to XFire, that's why I started with a small test : Java Swing GUI 
to authenticate user, the authentification process is a webservice method  
returning true.

    Here's the code for the GUI ActionListener ( after removing all comments)

    The following line is throwing the exception :
    client1.invoke("login", new Object[]{username, password});

    public void actionPerformed(ActionEvent e) { 

    try { 

    if(e.getSource() == loginBtn) { 

    if(usernameTxt.getText() != null && usernameTxt.getText().length() > 0 && 
passwordTxt.getPassword() != null && passwordTxt.getPassword().length >0){ 
    String username = 

    usernameTxt.getText(); 
    String password = 

    new String(passwordTxt.getPassword()); 

    try{ 
    Client client1 = 

    new Client(new URL( "http://localhost:8080/ldap/services/ldapservice?WSDL"; 
)); 
    client1.invoke(

    "login", new Object[]{username, password}); 
    }

    catch(Exception exp){ 
    System.

    out.println("exception "+exp); 
    }

    }


    else{ 
    Boot.showError(

    "Error", "Username and password cannot be blank", new Exception()); 
    }

    } 


    else if(e.getSource() == cancelBtn) { 

    usernameTxt.setText(""); 

    passwordTxt.setText(""); 
    }

    }


    catch(Exception ioExp) { 
    Boot.showError(

    "Error", ioExp.getMessage(), ioExp); 
    }

    }

    and here is the Exception in Tomcat :

    INFO: Server startup in 140094 ms

    - No beans defined in application context 
[org.codehaus.xfire.transport.http.XFireConfigurableServlet$GenericWebApplicationContextX;hashCode=13787395]

    - JDK 1.4+ collections available

    - Commons Collections 3.x available

    - Unable to locate MessageSource with name 'messageSource': using default 
[EMAIL PROTECTED]

    - Unable to locate ApplicationEventMulticaster with name 
'applicationEventMulticaster': using default [EMAIL PROTECTED]

    - Unable to locate ThemeSource with name 'themeSource': using default 
[EMAIL PROTECTED]

    - Pre-instantiating singletons in factory 
[org.springframework.beans.factory.support.DefaultListableBeanFactory defining 
beans []; root of BeanFactory hierarchy]

    - Loading XML bean definitions from class path resource 
[org/codehaus/xfire/spring/xfire.xml]

    - Loading XML bean definitions from class path resource 
[org/codehaus/xfire/spring/customEditors.xml]

    - Loading XML bean definitions from class path resource 
[META-INF/xfire/services.xml]

    - 11 beans defined in application context 
[org.codehaus.xfire.spring.GenericApplicationContext;hashCode=24548764]

    - Unable to locate MessageSource with name 'messageSource': using default 
[EMAIL PROTECTED]

    - Unable to locate ApplicationEventMulticaster with name 
'applicationEventMulticaster': using default [EMAIL PROTECTED]

    - Pre-instantiating singletons in factory 
[org.springframework.beans.factory.support.DefaultListableBeanFactory defining 
beans 
[xfire.customEditorConfigurer,xfire.serviceRegistry,xfire.transportManager,xfire,xfire.typeMappingRegistry,xfire.aegisBindingProvider,xfire.serviceFactory,xfire.servletController,xfire.messageServiceFactory,xfire.messageBindingProvider
 ,org.codehaus.xfire.spring.ServiceBean]; parent: 
org.springframework.beans.factory.support.DefaultListableBeanFactory defining 
beans []; root of BeanFactory hierarchy]

    - Exposing service with name {ldapservice}ldapservice

    - Fault occurred!

    java.lang.IllegalArgumentException

    : prefix cannot be "null" when creating a QName 
    at javax.xml.namespace.QName.<init>(Unknown Source)

    at com.ctc.wstx.stax.ns.NsInputElementStack.getQName(

    NsInputElementStack.java:389) 
    at com.ctc.wstx.stax.stream.BasicStreamReader.getName(

    BasicStreamReader.java:574) 
    at org.codehaus.xfire.soap.handler.ReadHeadersHandler.checkForFault(

    ReadHeadersHandler.java:107) 
    at org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(

    ReadHeadersHandler.java:67) 
    at org.codehaus.xfire.handler.HandlerPipeline.invoke(

    HandlerPipeline.java:131) 
    at org.codehaus.xfire.transport.DefaultEndpoint.onReceive(

    DefaultEndpoint.java:64) 
    at org.codehaus.xfire.transport.AbstractChannel.receive(

    AbstractChannel.java:38) 
    at org.codehaus.xfire.transport.http.XFireServletController.invoke(

    XFireServletController.java:304) 
    at org.codehaus.xfire.transport.http.XFireServletController.doService(

    XFireServletController.java:129) 
    at org.codehaus.xfire.transport.http.XFireServlet.doPost(

    XFireServlet.java:116) 
    at javax.servlet.http.HttpServlet.service(

    HttpServlet.java:709) 
    at javax.servlet.http.HttpServlet.service(

    HttpServlet.java:802) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(

    ApplicationFilterChain.java:252) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(

    ApplicationFilterChain.java:173) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(

    StandardWrapperValve.java:213) 
    at org.apache.catalina.core.StandardContextValve.invoke(

    StandardContextValve.java:178) 
    at org.apache.catalina.core.StandardHostValve.invoke(

    StandardHostValve.java:126) 
    at org.apache.catalina.valves.ErrorReportValve.invoke(

    ErrorReportValve.java:105) 
    at org.apache.catalina.core.StandardEngineValve.invoke(

    StandardEngineValve.java:107) 
    at org.apache.catalina.connector.CoyoteAdapter.service(

    CoyoteAdapter.java:148) 
    at org.apache.coyote.http11.Http11Processor.process(

    Http11Processor.java:869) 
    at 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(

    Http11BaseProtocol.java:664) 
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(

    PoolTcpEndpoint.java:527) 
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(

    LeaderFollowerWorkerThread.java:80) 
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(

    ThreadPool.java:684) 
    at java.lang.Thread.run(Unknown Source)

      ----- Original Message ----- 
      From: Mohammed El ammaria 
      To: user@xfire.codehaus.org 
      Sent: Saturday, March 31, 2007 9:12 PM
      Subject: Re: [xfire-user] prefix cannot be "null" when creating a QName


      I'm not sur that your ptoblem is linked to xfire, wath 's in your 
Console.java  line :156 ?

      Mohamed


      2007/3/31, Youssef Moussa < [EMAIL PROTECTED]>: 
        Hi..

        Please help to resolve this error. I'm missing something but what I 
don't know. I'm using xfire 1.4, tomcat 5


        When trying to invoke a method in my webservice, I'm getting the 
following error:
        SEVERE: Error:prefix cannot be "null" when creating a QName

        org.codehaus.xfire.fault.XFireFault: prefix cannot be "null" when 
creating a QName

        at org.codehaus.xfire.fault.Soap11FaultSerializer.readMessage(

        Soap11FaultSerializer.java:31
        ) 
        at org.codehaus.xfire.fault.SoapFaultSerializer.readMessage(

        SoapFaultSerializer.java:28) 
        at org.codehaus.xfire.soap.handler.ReadHeadersHandler.checkForFault(

        ReadHeadersHandler.java:111) 
        at org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(

        ReadHeadersHandler.java:67) 
        at org.codehaus.xfire.handler.HandlerPipeline.invoke(

        HandlerPipeline.java:131) 
        at org.codehaus.xfire.client.Client.onReceive(

        Client.java:387) 
        at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(

        HttpChannel.java:139) 
        at org.codehaus.xfire.transport.http.HttpChannel.send(

        HttpChannel.java:48) 
        at org.codehaus.xfire.handler.OutMessageSender.invoke(

        OutMessageSender.java:26) 
        at org.codehaus.xfire.handler.HandlerPipeline.invoke(

        HandlerPipeline.java:131) 
        at org.codehaus.xfire.client.Invocation.invoke(

        Invocation.java:75) 
        at org.codehaus.xfire.client.Client.invoke(

        Client.java:335) 
        at org.codehaus.xfire.client.Client.invoke(

        Client.java:349) 
        at com.imetrik.ims.console.Console.actionPerformed(

        Console.java:156) 


        client:

        Client client1 = 

        new Client(new URL(" 
http://localhost:8080/ldap/services/ldapservice?WSDL ")); 
        client1.invoke(

        "login", new Object[]{username, password}); 




        It is a simple service to authenticate users.



        java code: 

        package

        com.imetrik.ims.webservice; 

        public

        interface LdapService{ 


        public boolean login(String username, String password); 
        }

        the implementation :


        public boolean login(String username, String password) { 

        // TODO Auto-generated method stub 

        boolean success = false; 

        if(username != null && username.length() > 0 && password != null && 
password.length() > 0){ 

        if(username.equalsIgnoreCase("test") && 
password.equalsIgnoreCase("test")) 
        success = 

        true; 
        System.out.println(

        "inside login username = "+username +" password = " + password ); 
        }


        return success; 
        }



         my service.xml: 
        <beans

        xmlns=" http://xfire.codehaus.org/config/1.0";> 


        <service> 

        <name>ldapservice</name> 

        <namespace>ldapservice</namespace> 

        <serviceClass>com.imetrik.ims.webservice.LdapService</serviceClass> 

        
<implementationClass>com.imetrik.ims.webservice.LdapServiceImpl</implementationClass>
 

        </service> 

        </beans>

        Thank you in advance




      -- 
      Mohammed El AMMARIA 



  -- 
  Mohammed El AMMARIA 

Attachment: ldapservice.wsdl
Description: Binary data

Attachment: browser_ldapservice.wsdl
Description: Binary data

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to