Hi,

It's a simple matter of WSDL conventions (that is, your WSDL isn't 
"wrong", but WSDL allows you to specify one thing in many ways, and 
wsdl2java can only support so many). Try this instead:

<wsdl:types>
  <xsd:schema targetNamespace="http://ws.apache.org/muse/test/wsrf";>
    <xsd:element name="UpdateRequest">
      <xsd:complexType>
        <xsd:sequence>
          <!-- parameter list goes here -->
          <xsd:element name="YourParameterName" type="xsd:string"/>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
</wsdl:types>

...

<wsdl:message name="UpdateRequestMessage">
  <wsdl:part name="UpdateRequest" element="tns:UpdateRequest"/>
</wsdl:message>

<wsdl:message name="UpdateResponseMessage">
  <wsdl:part name="UpdateResponse"/>
</wsdl:message>


Notice that the response has no type - this equals 'void'. If you use 
'xsd:anyType', you'll get a DOM Element.

You'll also want to update the wsa:Action on the operation so that it is a 
little more unique (by appending an 'UpdateRequest', for example). This 
will just make it easier as you add more operations, because each 
operation needs a unique wsa:Action.








"Grady, Brendan \(Mission Systems\)" <[EMAIL PROTECTED]> 
12/15/2006 11:44 AM
Please respond to
[email protected]


To
<[email protected]>
cc

Subject
Simple wsdl2java Question






Hello,
 
I am encountering what I expect to be a simple error, but my lack of 
experience with WSDL is holding me back.
 
Basically, I am trying to expose an asynchronous "UpdateRequest" operation 
on the wsn-producer tutorial that takes a String as a parameter and 
returns void.  i.e. In MyCapability.java, I want to implement a method 
with the following signature:  public void UpdateRequest(String ...)
 
What I have added to the sample wsn-producer.wsdl (attached) thus far:
 
<!-- Block 1 -->
 <wsdl:message name="UpdateRequestMessage">
  <wsdl:part name="UpdateRequest" 
        type="xsd:string">
  </wsdl:part>
 </wsdl:message>
 
 <wsdl:message name="UpdateResponseMessage">
  <wsdl:part name="Void" 
        type="xsd:anyType">
  </wsdl:part>
 </wsdl:message>
<!-- End Block 1 -->
 
<!-- Block 2 -->
<wsdl:portType name="WsResourcePortType"
.....
  <wsdl:operation name="UpdateRequest">
   <wsdl:input wsa:Action="http://ws.apache.org/muse/test/wsrf";
            name="UpdateRequestMessage" message="tns:UpdateRequestMessage" 
/>
   <wsdl:output wsa:Action="http://ws.apache.org/muse/test/wsrf";
            name="UpdateResponseMessage" 
message="tns:UpdateResponseMessage" /> 
  </wsdl:operation>
.....
</wsdl:portType>
<!-- End Block 2 -->
 
<!-- Block 3 -->
<wsdl:binding name="WsResourceBinding"
.....
  <wsdl:operation name="UpdateRequest">
   <wsdl-soap:operation soapAction="UpdateRequest" /> 

   <wsdl:input name="UpdateRequestMessage">
       <wsdl-soap:body use="encoded" encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/"; />
   </wsdl:input>
 
   <wsdl:output name="UpdateResponseMessage">
       <wsdl-soap:body use="encoded" encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/"; />
   </wsdl:output>
  </wsdl:operation>
....
</wsdl:binding>
<!-- End Block 3 -->
 
 
The command that I am running is:  wsdl2java -wsdl 
.\wsdl\wsn-producer.wsdl -verbose (called from the base of my project 
directory with subdirectory wsdl which contains the sample wsdl and all of 
the imported wsdl's and xsd's)
 
The error that I am receiving is:
 
C:\Documents and Settings\gradybr\Desktop\ExposedUpdate>wsdl2java -wsdl 
.\wsdl\wsn-producer.wsdl -verbose
 
SEVERE: [ID = 'CodeGenFailed'] Code generation failed, see the exception 
information below.
 
An exception was caught: [ID = 'NullTypeQName'] The QName describing the 
type declaration is null.
 
The exception generated the following stacktrace:
 
java.lang.NullPointerException: [ID = 'NullTypeQName'] The QName 
describing thetype declaration is null.
        at 
org.apache.muse.ws.wsdl.WsdlUtils.getTypeDeclaration(WsdlUtils.java:663)
        at 
org.apache.muse.tools.inspector.ResourceInspector.createJavaMethod(ResourceInspector.java:329)
        at 
org.apache.muse.tools.inspector.ResourceInspector.getOperations(ResourceInspector.java:532)
        at 
org.apache.muse.tools.inspector.ResourceInspector.run(ResourceInspector.java:849)
        at 
org.apache.muse.tools.generator.analyzer.SimpleAnalyzer.inspect(SimpleAnalyzer.java:367)
        at 
org.apache.muse.tools.generator.analyzer.SimpleAnalyzer.analyze(SimpleAnalyzer.java:313)
        at 
org.apache.muse.tools.generator.Wsdl2Java.run(Wsdl2Java.java:142)
        at 
org.apache.muse.tools.generator.Wsdl2Java.main(Wsdl2Java.java:259)
 
 
I am new to Muse and Web Services in general.  I have followed the 
tutorial and have the wsn-producer (beginning with the WSDL) example up 
and running correctly.
 
Thanks for any help,
Brendan Grady
 ---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to