You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Blake Dournaee <bl...@sarvega.com> on 2004/05/11 23:15:10 UTC

Question about Service() Constructor

All,

 

Given a WSDL, how does one properly find the name of the service? That is, I
have a WSDL and am making a call to the Service() constructor that takes two
arguments:

 

1.	The WSDL (stream or file)
2.	A QName.

 

I am stuck on how to properly populate the QName. At this point I am
guessing.

 

In my WSDL, the <service> element has an attribute called name, e.g:

 

<wsdl:service name="TesterService">

 

   <wsdl:port binding="impl:TesterSoapBinding" name="Tester">

 

      <wsdlsoap:address location="http://localhost:8080/axis/Tester.jws"/>

 

   </wsdl:port>

 

</wsdl:service>

 

 

So my call looks like:

 

try {

 

    QName serviceName = new QName("TesterClient");

    Service service = new Service(wsdl,serviceName);

 

 

    } catch (Exception xp) {

      System.out.println("Error building Service object");

      xp.printStackTrace();

    }

 

 

But this gives me an exception:

 

og4j:WARN No appenders could be found for logger
(org.apache.axis.i18n.ProjectResourceBundle).

og4j:WARN Please initialize the log4j system properly.

rror building Service object

avax.xml.rpc.ServiceException: Error processing WSDL document:

avax.xml.rpc.ServiceException: Error processing WSDL document:

avax.xml.rpc.ServiceException: Cannot find service:  TesterClient

       at org.apache.axis.client.Service.initService(Service.java:261)

       at org.apache.axis.client.Service.<init>(Service.java:217)

       at TesterClient.main(TesterClient.java:41)

 

 

I am not even getting off the ground on this. Can someone help me figure out
how to properly name my Service?

 

Thanks,

 

Blake

 

 


RE: Question about Service() Constructor

Posted by Blake Dournaee <bl...@sarvega.com>.
Thanks dims, I've got it now.

I'm a bit confused as to why the toolkit can't pull the service name out of
the WSDL as well? It seems like the WSDL is being parsed twice in this
respect. In short, I'm populating a class with information strictly from the
WSDL.

Blake

-----Original Message-----
From: Davanum Srinivas [mailto:davanum@gmail.com] 
Sent: Tuesday, May 11, 2004 7:33 PM
To: axis-user@ws.apache.org
Subject: Re: Question about Service() Constructor

Blake,

Can you post the WSDL itself? typically you pick up the
targetNamespace as the uri for constructuing the QName. You can check
out my samples/client/DynamicInvoker code

-- dims (Davanum Srinivas)


----- Original Message -----
From: Blake Dournaee <bl...@sarvega.com>
Date: Tue, 11 May 2004 16:14:57 -0700
Subject: RE: Question about Service() Constructor
To: axis-user@ws.apache.org



















All,



 



I've updated this to include a guess
at the namespace part of the QName. Still the same problem:



 



try {



 



      String uri
= new String("http://localhost:8080/axis/Tester.jws");



      String
localPart = new String("TesterClient");



 



      QName
serviceName = new QName(uri,localPart);



      Service
service = new Service(wsdl,serviceName);



 



 



    } catch (Exception xp)
{



     
System.out.println("Error building Service object");



     
xp.printStackTrace();



    }



 



Error building Service object



javax.xml.rpc.ServiceException: Error
processing WSDL document:



javax.xml.rpc.ServiceException: Error
processing WSDL document:



javax.xml.rpc.ServiceException: Cannot
find service:  {http://localhost:8080/axis/Tester.jws}TesterClient



       
at org.apache.axis.client.Service.initService(Service.java:261)



       
at org.apache.axis.client.Service.<init>(Service.java:217)



       
at TesterClient.main(TesterClient.java:44)



 



 



 



Does anyone have any ideas?



 



Thanks,



 



Blake



 






________________________________






From: Blake Dournaee
[mailto:blake@sarvega.com] 

Sent: Tuesday, May 11, 2004 2:15
PM

To: axis-user@ws.apache.org

Subject: Question about Service()
Constructor







 



All,



 



Given a WSDL, how does one properly find the name of the
service? That is, I have a WSDL and am making a call to the Service()
constructor that takes two arguments:



 



 The WSDL (stream or file)
 
A QName.




 



I am stuck on how to properly populate the QName. At this
point I am guessing.



 



In my WSDL, the <service> element has an attribute
called name, e.g:



 



<wsdl:service name="TesterService">



 



   <wsdl:port
binding="impl:TesterSoapBinding" name="Tester">



 



      <wsdlsoap:address
location="http://localhost:8080/axis/Tester.jws"/>



 



   </wsdl:port>



 



</wsdl:service>



 



 



So my call looks like:



 



try {



 



    QName serviceName = new
QName("TesterClient");



    Service service = new
Service(wsdl,serviceName);



 



 



    } catch (Exception xp) {



     
System.out.println("Error building Service object");



      xp.printStackTrace();



    }



 



 



But this gives me an exception:



 



og4j:WARN No appenders could be found for logger
(org.apache.axis.i18n.ProjectResourceBundle).



og4j:WARN Please initialize the log4j system properly.



rror building Service object



avax.xml.rpc.ServiceException: Error processing WSDL
document:



avax.xml.rpc.ServiceException: Error processing WSDL
document:



avax.xml.rpc.ServiceException: Cannot find service:  TesterClient



       at
org.apache.axis.client.Service.initService(Service.java:261)



       at
org.apache.axis.client.Service.<init>(Service.java:217)



       at
TesterClient.main(TesterClient.java:41)



 



 



I am not even getting off the ground on this. Can someone
help me figure out how to properly name my Service?



 



Thanks,



 



Blake


Re: Question about Service() Constructor

Posted by Davanum Srinivas <da...@gmail.com>.
Blake,

Can you post the WSDL itself? typically you pick up the
targetNamespace as the uri for constructuing the QName. You can check
out my samples/client/DynamicInvoker code

-- dims (Davanum Srinivas)


----- Original Message -----
From: Blake Dournaee <bl...@sarvega.com>
Date: Tue, 11 May 2004 16:14:57 -0700
Subject: RE: Question about Service() Constructor
To: axis-user@ws.apache.org



















All,



 



I've updated this to include a guess
at the namespace part of the QName. Still the same problem:



 



try {



 



      String uri
= new String("http://localhost:8080/axis/Tester.jws");



      String
localPart = new String("TesterClient");



 



      QName
serviceName = new QName(uri,localPart);



      Service
service = new Service(wsdl,serviceName);



 



 



    } catch (Exception xp)
{



     
System.out.println("Error building Service object");



     
xp.printStackTrace();



    }



 



Error building Service object



javax.xml.rpc.ServiceException: Error
processing WSDL document:



javax.xml.rpc.ServiceException: Error
processing WSDL document:



javax.xml.rpc.ServiceException: Cannot
find service:  {http://localhost:8080/axis/Tester.jws}TesterClient



       
at org.apache.axis.client.Service.initService(Service.java:261)



       
at org.apache.axis.client.Service.<init>(Service.java:217)



       
at TesterClient.main(TesterClient.java:44)



 



 



 



Does anyone have any ideas?



 



Thanks,



 



Blake



 






________________________________






From: Blake Dournaee
[mailto:blake@sarvega.com] 

Sent: Tuesday, May 11, 2004 2:15
PM

To: axis-user@ws.apache.org

Subject: Question about Service()
Constructor







 



All,



 



Given a WSDL, how does one properly find the name of the
service? That is, I have a WSDL and am making a call to the Service()
constructor that takes two arguments:



 



 The WSDL (stream or file)
 
A QName.




 



I am stuck on how to properly populate the QName. At this
point I am guessing.



 



In my WSDL, the <service> element has an attribute
called name, e.g:



 



<wsdl:service name="TesterService">



 



   <wsdl:port
binding="impl:TesterSoapBinding" name="Tester">



 



      <wsdlsoap:address
location="http://localhost:8080/axis/Tester.jws"/>



 



   </wsdl:port>



 



</wsdl:service>



 



 



So my call looks like:



 



try {



 



    QName serviceName = new
QName("TesterClient");



    Service service = new
Service(wsdl,serviceName);



 



 



    } catch (Exception xp) {



     
System.out.println("Error building Service object");



      xp.printStackTrace();



    }



 



 



But this gives me an exception:



 



og4j:WARN No appenders could be found for logger
(org.apache.axis.i18n.ProjectResourceBundle).



og4j:WARN Please initialize the log4j system properly.



rror building Service object



avax.xml.rpc.ServiceException: Error processing WSDL
document:



avax.xml.rpc.ServiceException: Error processing WSDL
document:



avax.xml.rpc.ServiceException: Cannot find service:  TesterClient



       at
org.apache.axis.client.Service.initService(Service.java:261)



       at
org.apache.axis.client.Service.<init>(Service.java:217)



       at
TesterClient.main(TesterClient.java:41)



 



 



I am not even getting off the ground on this. Can someone
help me figure out how to properly name my Service?



 



Thanks,



 



Blake

RE: Question about Service() Constructor

Posted by Blake Dournaee <bl...@sarvega.com>.
Anne -

 

D'oh!

 

Thanks for pointing out my silly mistake. It works now.

 

Blake

 

  _____  

From: Anne Thomas Manes [mailto:anne@manes.net] 
Sent: Tuesday, May 11, 2004 7:37 PM
To: axis-user@ws.apache.org
Subject: RE: Question about Service() Constructor

 

Blake,

 

You get the service name from the WSDL:

 

<wsdl:service name="TesterService">

 

Use "TesterService" rather than "TesterClient".

 

Anne

 

  _____  

From: Blake Dournaee [mailto:blake@sarvega.com] 
Sent: Tuesday, May 11, 2004 7:15 PM
To: axis-user@ws.apache.org
Subject: RE: Question about Service() Constructor

 

All,

 

I've updated this to include a guess at the namespace part of the QName.
Still the same problem:

 

try {

 

      String uri = new String("http://localhost:8080/axis/Tester.jws");

      String localPart = new String("TesterClient");

 

      QName serviceName = new QName(uri,localPart);

      Service service = new Service(wsdl,serviceName);

 

 

    } catch (Exception xp) {

      System.out.println("Error building Service object");

      xp.printStackTrace();

    }

 

Error building Service object

javax.xml.rpc.ServiceException: Error processing WSDL document:

javax.xml.rpc.ServiceException: Error processing WSDL document:

javax.xml.rpc.ServiceException: Cannot find service:
{http://localhost:8080/axis/Tester.jws}TesterClient

        at org.apache.axis.client.Service.initService(Service.java:261)

        at org.apache.axis.client.Service.<init>(Service.java:217)

        at TesterClient.main(TesterClient.java:44)

 

 

 

Does anyone have any ideas?

 

Thanks,

 

Blake

 

  _____  

From: Blake Dournaee [mailto:blake@sarvega.com] 
Sent: Tuesday, May 11, 2004 2:15 PM
To: axis-user@ws.apache.org
Subject: Question about Service() Constructor

 

All,

 

Given a WSDL, how does one properly find the name of the service? That is, I
have a WSDL and am making a call to the Service() constructor that takes two
arguments:

 

1.	The WSDL (stream or file)
2.	A QName.

 

I am stuck on how to properly populate the QName. At this point I am
guessing.

 

In my WSDL, the <service> element has an attribute called name, e.g:

 

<wsdl:service name="TesterService">

 

   <wsdl:port binding="impl:TesterSoapBinding" name="Tester">

 

      <wsdlsoap:address location="http://localhost:8080/axis/Tester.jws"/>

 

   </wsdl:port>

 

</wsdl:service>

 

 

So my call looks like:

 

try {

 

    QName serviceName = new QName("TesterClient");

    Service service = new Service(wsdl,serviceName);

 

 

    } catch (Exception xp) {

      System.out.println("Error building Service object");

      xp.printStackTrace();

    }

 

 

But this gives me an exception:

 

og4j:WARN No appenders could be found for logger
(org.apache.axis.i18n.ProjectResourceBundle).

og4j:WARN Please initialize the log4j system properly.

rror building Service object

avax.xml.rpc.ServiceException: Error processing WSDL document:

avax.xml.rpc.ServiceException: Error processing WSDL document:

avax.xml.rpc.ServiceException: Cannot find service:  TesterClient

       at org.apache.axis.client.Service.initService(Service.java:261)

       at org.apache.axis.client.Service.<init>(Service.java:217)

       at TesterClient.main(TesterClient.java:41)

 

 

I am not even getting off the ground on this. Can someone help me figure out
how to properly name my Service?

 

Thanks,

 

Blake

 

 


RE: Question about Service() Constructor

Posted by Anne Thomas Manes <an...@manes.net>.
Blake,
 
You get the service name from the WSDL:
 
<wsdl:service name="TesterService">
 
Use "TesterService" rather than "TesterClient".
 
Anne
 
  _____  

From: Blake Dournaee [mailto:blake@sarvega.com] 
Sent: Tuesday, May 11, 2004 7:15 PM
To: axis-user@ws.apache.org
Subject: RE: Question about Service() Constructor
 
All,
 
I've updated this to include a guess at the namespace part of the QName.
Still the same problem:
 
try {
 
      String uri = new String("http://localhost:8080/axis/Tester.jws");
      String localPart = new String("TesterClient");
 
      QName serviceName = new QName(uri,localPart);
      Service service = new Service(wsdl,serviceName);
 
 
    } catch (Exception xp) {
      System.out.println("Error building Service object");
      xp.printStackTrace();
    }
 
Error building Service object
javax.xml.rpc.ServiceException: Error processing WSDL document:
javax.xml.rpc.ServiceException: Error processing WSDL document:
javax.xml.rpc.ServiceException: Cannot find service:
{http://localhost:8080/axis/Tester.jws}TesterClient
        at org.apache.axis.client.Service.initService(Service.java:261)
        at org.apache.axis.client.Service.<init>(Service.java:217)
        at TesterClient.main(TesterClient.java:44)
 
 
 
Does anyone have any ideas?
 
Thanks,
 
Blake
 
  _____  

From: Blake Dournaee [mailto:blake@sarvega.com] 
Sent: Tuesday, May 11, 2004 2:15 PM
To: axis-user@ws.apache.org
Subject: Question about Service() Constructor
 
All,
 
Given a WSDL, how does one properly find the name of the service? That is, I
have a WSDL and am making a call to the Service() constructor that takes two
arguments:
 
1.	The WSDL (stream or file)
2.	A QName.
 
I am stuck on how to properly populate the QName. At this point I am
guessing.
 
In my WSDL, the <service> element has an attribute called name, e.g:
 
<wsdl:service name="TesterService">
 
   <wsdl:port binding="impl:TesterSoapBinding" name="Tester">
 
      <wsdlsoap:address location="http://localhost:8080/axis/Tester.jws"/>
 
   </wsdl:port>
 
</wsdl:service>
 
 
So my call looks like:
 
try {
 
    QName serviceName = new QName("TesterClient");
    Service service = new Service(wsdl,serviceName);
 
 
    } catch (Exception xp) {
      System.out.println("Error building Service object");
      xp.printStackTrace();
    }
 
 
But this gives me an exception:
 
og4j:WARN No appenders could be found for logger
(org.apache.axis.i18n.ProjectResourceBundle).
og4j:WARN Please initialize the log4j system properly.
rror building Service object
avax.xml.rpc.ServiceException: Error processing WSDL document:
avax.xml.rpc.ServiceException: Error processing WSDL document:
avax.xml.rpc.ServiceException: Cannot find service:  TesterClient
       at org.apache.axis.client.Service.initService(Service.java:261)
       at org.apache.axis.client.Service.<init>(Service.java:217)
       at TesterClient.main(TesterClient.java:41)
 
 
I am not even getting off the ground on this. Can someone help me figure out
how to properly name my Service?
 
Thanks,
 
Blake
 
 

RE: Question about Service() Constructor

Posted by Blake Dournaee <bl...@sarvega.com>.
All,

 

I've updated this to include a guess at the namespace part of the QName.
Still the same problem:

 

try {

 

      String uri = new String("http://localhost:8080/axis/Tester.jws");

      String localPart = new String("TesterClient");

 

      QName serviceName = new QName(uri,localPart);

      Service service = new Service(wsdl,serviceName);

 

 

    } catch (Exception xp) {

      System.out.println("Error building Service object");

      xp.printStackTrace();

    }

 

Error building Service object

javax.xml.rpc.ServiceException: Error processing WSDL document:

javax.xml.rpc.ServiceException: Error processing WSDL document:

javax.xml.rpc.ServiceException: Cannot find service:
{http://localhost:8080/axis/Tester.jws}TesterClient

        at org.apache.axis.client.Service.initService(Service.java:261)

        at org.apache.axis.client.Service.<init>(Service.java:217)

        at TesterClient.main(TesterClient.java:44)

 

 

 

Does anyone have any ideas?

 

Thanks,

 

Blake

 

  _____  

From: Blake Dournaee [mailto:blake@sarvega.com] 
Sent: Tuesday, May 11, 2004 2:15 PM
To: axis-user@ws.apache.org
Subject: Question about Service() Constructor

 

All,

 

Given a WSDL, how does one properly find the name of the service? That is, I
have a WSDL and am making a call to the Service() constructor that takes two
arguments:

 

1.	The WSDL (stream or file)
2.	A QName.

 

I am stuck on how to properly populate the QName. At this point I am
guessing.

 

In my WSDL, the <service> element has an attribute called name, e.g:

 

<wsdl:service name="TesterService">

 

   <wsdl:port binding="impl:TesterSoapBinding" name="Tester">

 

      <wsdlsoap:address location="http://localhost:8080/axis/Tester.jws"/>

 

   </wsdl:port>

 

</wsdl:service>

 

 

So my call looks like:

 

try {

 

    QName serviceName = new QName("TesterClient");

    Service service = new Service(wsdl,serviceName);

 

 

    } catch (Exception xp) {

      System.out.println("Error building Service object");

      xp.printStackTrace();

    }

 

 

But this gives me an exception:

 

og4j:WARN No appenders could be found for logger
(org.apache.axis.i18n.ProjectResourceBundle).

og4j:WARN Please initialize the log4j system properly.

rror building Service object

avax.xml.rpc.ServiceException: Error processing WSDL document:

avax.xml.rpc.ServiceException: Error processing WSDL document:

avax.xml.rpc.ServiceException: Cannot find service:  TesterClient

       at org.apache.axis.client.Service.initService(Service.java:261)

       at org.apache.axis.client.Service.<init>(Service.java:217)

       at TesterClient.main(TesterClient.java:41)

 

 

I am not even getting off the ground on this. Can someone help me figure out
how to properly name my Service?

 

Thanks,

 

Blake