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 Ryuusei Murakami <mu...@aswindow.co.jp> on 2004/02/10 09:50:59 UTC

newbie question for java2wsdl

Hi.

I'm trying to create a WSDL file by using java2wsdl.
However, I'm getting following problems.
why i can create WSDL ?

org.jagent.service.directory.soap.SOAPServiceDirectoryService uses
some javax.agent.* interfaces, and these are put on WEB-INF/classes.

---
AXIS_LIB=/cygdrive/g/axis-1_1/lib

CLASSPATH=.:${AXIS_LIB}/axis.jar:${AXIS_LIB}/axis-ant.jar:${AXIS_LIB}/commons-discovery.jar:
${AXIS_LIB}/commons-logging.jar:${AXIS_LIB}/jaxrpc.jar:${AXIS_LIB}/log4j-1.2.8.jar:
${AXIS_LIB}/saaj.jar:${AXIS_LIB}/wsdl4j.jar

# java -cp ${CLASSPATH} org.apache.axis.wsdl.Java2WSDL -o
	SOAPServiceDirectoryService.wsdl
	-l http://localhost:8080/axis/servlet/AxisServlet
	-n SOAPServiceDirectoryService 	
        org.jagent.service.directory.soap.SOAPServiceDirectoryService

--- wsdd is following
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="SOAPServiceDirectoryService" provider="java:RPC">
<parameter name="className"
value="org.jagent.service.directory.soap.SOAPServiceDirectoryService" />
<parameter name="allowedMethods" value="*" />
<parameter name="scope" value="session" />
</service>
</deployment>
---

--- error is following
- The class javax.agent.service.directory.ServiceDescription is
  defined in a java or javax package and cannot be converted into an
  xml schema type.  An xml schema anyType will be used to define
  this class in the wsdl file.
- The class javax.agent.service.ActionStatus is defined in a java or
  javax package and cannot be converted into an xml schema type.
  An xml schema anyType will be used to define this class in the
  wsdl file.

WSDLException: faultCode=OTHER_ERROR: Can't find prefix for
'http://directory.service.agent.javax'. Namespace prefixes must be set
on the Definition object usig the addNamespace(...) method.:
        at com.ibm.wsdl.util.xml.DOMUtils.getPrefix(Unknown Source)
        at com.ibm.wsdl.util.xml.DOMUtils.getQualifiedValue(Unknown Source)
        at om.ibm.wsdl.util.xml.DOMUtils.printQualifiedAttribute(Unknown
Source)
        at com.ibm.wsdl.xml.WSDLWriterImpl.printParts(Unknown Source)
        at com.ibm.wsdl.xml.WSDLWriterImpl.printMessages(Unknown Source)
        at com.ibm.wsdl.xml.WSDLWriterImpl.printDefinition(Unknown Source)
        at com.ibm.wsdl.xml.WSDLWriterImpl.writeWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
        at org.apache.axis.wsdl.fromJava.Emitter.emit(Emitter.java:267)
        at org.apache.axis.wsdl.fromJava.Emitter.emit(Emitter.java:334)
        at org.apache.axis.wsdl.Java2WSDL.run(Java2WSDL.java:504)
        at org.apache.axis.wsdl.Java2WSDL.main(Java2WSDL.java:542)


-- 
% ASWINDOW,co.,inc.
% Ryuusei Murakami / murakami@aswindow.co.jp
% http://www.aswindow.co.jp/


Re: newbie question for java2wsdl

Posted by Dhanush Gopinath <dh...@mahindrabt.com>.
I think the problem is in your java command. It points to the Axis Servlet here. Actually it should point to your webservice deployed. 

it should be something like this 

# java -cp ${CLASSPATH} org.apache.axis.wsdl.Java2WSDL -o
SOAPServiceDirectoryService.wsdl
-l http://localhost:8080/axis/services/YOUR SERVICE
-n SOAPServiceDirectoryService 
        org.jagent.service.directory.soap.SOAPServiceDirectoryService

The above package org.jagent.... may also need a -p option before that , if its the package structure you are following

Regards 
Dhanush

  ----- Original Message ----- 
  From: Ryuusei Murakami 
  To: axis-user@ws.apache.org 
  Sent: Tuesday, February 10, 2004 2:20 PM
  Subject: newbie question for java2wsdl

  Hi.

  I'm trying to create a WSDL file by using java2wsdl.
  However, I'm getting following problems.
  why i can create WSDL ?

  org.jagent.service.directory.soap.SOAPServiceDirectoryService uses
  some javax.agent.* interfaces, and these are put on WEB-INF/classes.

  ---
  AXIS_LIB=/cygdrive/g/axis-1_1/lib

  CLASSPATH=.:${AXIS_LIB}/axis.jar:${AXIS_LIB}/axis-ant.jar:${AXIS_LIB}/commons-discovery.jar:
  ${AXIS_LIB}/commons-logging.jar:${AXIS_LIB}/jaxrpc.jar:${AXIS_LIB}/log4j-1.2.8.jar:
  ${AXIS_LIB}/saaj.jar:${AXIS_LIB}/wsdl4j.jar

  # java -cp ${CLASSPATH} org.apache.axis.wsdl.Java2WSDL -o
  SOAPServiceDirectoryService.wsdl
  -l http://localhost:8080/axis/servlet/AxisServlet
  -n SOAPServiceDirectoryService 
          org.jagent.service.directory.soap.SOAPServiceDirectoryService

  --- wsdd is following
  <deployment xmlns="http://xml.apache.org/axis/wsdd/"
  xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
  <service name="SOAPServiceDirectoryService" provider="java:RPC">
  <parameter name="className"
  value="org.jagent.service.directory.soap.SOAPServiceDirectoryService" />
  <parameter name="allowedMethods" value="*" />
  <parameter name="scope" value="session" />
  </service>
  </deployment>
  ---

  --- error is following
  - The class javax.agent.service.directory.ServiceDescription is
    defined in a java or javax package and cannot be converted into an
    xml schema type.  An xml schema anyType will be used to define
    this class in the wsdl file.
  - The class javax.agent.service.ActionStatus is defined in a java or
    javax package and cannot be converted into an xml schema type.
    An xml schema anyType will be used to define this class in the
    wsdl file.

  WSDLException: faultCode=OTHER_ERROR: Can't find prefix for
  'http://directory.service.agent.javax'. Namespace prefixes must be set
  on the Definition object usig the addNamespace(...) method.:
          at com.ibm.wsdl.util.xml.DOMUtils.getPrefix(Unknown Source)
          at com.ibm.wsdl.util.xml.DOMUtils.getQualifiedValue(Unknown Source)
          at om.ibm.wsdl.util.xml.DOMUtils.printQualifiedAttribute(Unknown
  Source)
          at com.ibm.wsdl.xml.WSDLWriterImpl.printParts(Unknown Source)
          at com.ibm.wsdl.xml.WSDLWriterImpl.printMessages(Unknown Source)
          at com.ibm.wsdl.xml.WSDLWriterImpl.printDefinition(Unknown Source)
          at com.ibm.wsdl.xml.WSDLWriterImpl.writeWSDL(Unknown Source)
          at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
          at org.apache.axis.wsdl.fromJava.Emitter.emit(Emitter.java:267)
          at org.apache.axis.wsdl.fromJava.Emitter.emit(Emitter.java:334)
          at org.apache.axis.wsdl.Java2WSDL.run(Java2WSDL.java:504)
          at org.apache.axis.wsdl.Java2WSDL.main(Java2WSDL.java:542)

  -- 
  % ASWINDOW,co.,inc.
  % Ryuusei Murakami / murakami@aswindow.co.jp
  % http://www.aswindow.co.jp/

*********************************************************
Disclaimer

This message (including any attachments) contains 
confidential information intended for a specific 
individual and purpose, and is protected by law. 
If you are not the intended recipient, you should 
delete this message and are hereby notified that 
any disclosure, copying, or distribution of this
message, or the taking of any action based on it, 
is strictly prohibited.

*********************************************************
Visit us at http://www.mahindrabt.com