Hello all.
I have the following wsdl file (attached at the end of the message), that
uses a "soap:header" in the operation "begin" of the PortType
"MyServicePortType".
Axis2's wsd2java generates all code reporting no errors, but the code
generated doesn't compile. The problem is that in the Skeleton, it generates al
method like this:
public voidBegunDocument begin (BeginDocument param){
//Todo fill this with the necessary business logic
return null;
}
As it can be seen, the metod has two return types: "void" and "BegunDocument"
with no separation between them.
I can remove "void" and the code will compile, but all the rest of the
classes asume that "begin" returns "void" instead of "BegunDocument" (specially
disturbing in the stub, wich returns nothing).
If I remove the "soap:header" line in the wsdl file, the code is generated
correctly, not only in the skeleton, but also in the stub.
I'm able to modify the code generated by wsdl2java so it can return the
correct values, or even take the code generated by the wsdl without
soap:header. But, will the headers be sent and received correctly? Is my wsdl
wrong? Sould I wait for Axis2 0.94 release and try again?
Thank you so much in advance,
Rubén
P.S.: Following you can find the wsdl code.
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tns="http://www.my-enterprise.org/2005/10/srvc"
xmlns:srvc="http://www.my-enterprise.org/schemas/2005/10/srvc"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://www.my-enterprise.org/2005/10/srvc">
<wsdl:types>
<xs:schema>
<xs:import
namespace="http://www.my-enterprise.org/schemas/2005/10/srvc"
schemaLocation="srvc.xsd"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="HeaderMessage">
<wsdl:part element="srvc:header" name="hdr"/>
</wsdl:message>
<wsdl:message name="BeginMessage">
<wsdl:part element="srvc:begin" name="content"/>
</wsdl:message>
<wsdl:message name="BegunMessage">
<wsdl:part element="srvc:begun" name="content"/>
</wsdl:message>
<wsdl:portType name="MyServicePortType">
<wsdl:operation name="begin">
<wsdl:input message="tns:BeginMessage"/>
<wsdl:output message="tns:BegunMessage"/>
</wsdl:operation>
</wsdl:portType>
<!-- SOAP 1.1 over HTTP bindings -->
<wsdl:binding name="MyServicePortTypeSOAPBinding"
type="tns:MyServicePortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="begin">
<soap:operation soapAction="begin" style="rpc"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
<soap:header part="hdr"
message="tns:HeaderMessage" use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
</wsdl:definitions>