Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Help needed with wsdl2java tool

920952Mar 1 2012
I am creating web service using axis2 , with top down approach. Initially thought of using the SOAP based webservices and created the wsdl like below.
<wsdl:message name="CreateObjInput">
<wsdl:part name="CreateObjRequest" element="tns:CreateObjectRequest">
</wsdl:part>
</wsdl:message>

<wsdl:message name="CreateObjOutput">
<wsdl:part name="CreateObjResponse" element="tns:CreateObjectResponse">
</wsdl:part>
</wsdl:message>


<wsdl:operation name="CreateObjectOperation">
<wsdl:input name="CreateObjInput" message="tns:CreateObjInput" />
<wsdl:output name="CreateObjOutput" message="tns:CreateObjOutput" />
</wsdl:operation>



<wsdl:operation name="CreateObjectOperation">
<soap:operation soapAction="http://xyz.com/CreateObject" style="" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>

Wsdl2java generated the service interface like below (Using Axis data bindings)

public CreateObjectResponse createObjectOperation(CreateObjectRequest request)


Now at the closure of project decided to convert the service as RESTful service. So I changed the wsdl like below very minimal change.

<wsdl:message name="CreateObjInput">
<wsdl:part name="CreateObjRequest" element="tns:CreateObjectRequest">
</wsdl:part>
</wsdl:message>

<wsdl:message name="CreateObjOutput">
<wsdl:part name="CreateObjResponse" element="tns:CreateObjectResponse">
</wsdl:part>
</wsdl:message>

<wsdl:operation name="CreateObjectOperation">
<wsdl:input name="CreateObjInput" message="tns:CreateObjInput" wsaw:Action="urn:createObjectRequest"/>
<wsdl:output name="CreateObjOutput" message="tns:CreateObjOutput" wsaw:Action="urn:createObjectOperationResponse"/>
</wsdl:operation>

<wsdl:operation name="CreateObjectOperation">
<http:operation location="createObjectOperation" />
<wsdl:input>
<mime: type="text/xml" part="CreateObjRequest" />
</wsdl:input>
<wsdl:output>
<mime: type="text/xml" part="CreateObjResponse" />
</wsdl:output>
</wsdl:operation>

and the wsdl2java command generated the interface like below.

public CreateObjectResponse createObjectOperation(CreateObjectOperation createObjectOperation)

I tried many ways to get the interface definition like in the firstcase but didn't succeeded. This is causing the classname changes in the entire project.
Didn't understand why its generating interface like this though the wsdl is the same except wsaw actions included.

Can any one help me the get the inteface generated in compatible with the first case..

Thanks,
Sridhar
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 29 2012
Added on Mar 1 2012
0 comments
153 views