|
Hi, it looks like the test case is wrong. Code generated for operation OrderPizzaBroken is ok, header is generated. Code generated for operation OrderPizzaBroken is wrong, but this is because the wsdl is wrong: there is no part called callerID defined in tns:OrderPizzaRequest. See below:
<wsdl:operation name="OrderPizza"> <soap:operation soapAction=""/> <wsdl:input> <soap:header message="tns:OrderPizzaRequest" part="callerID" use="literal" /> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> I also tried eBay wsdl, but its so huge, too hard for me to identify the specific problem reported by this Jira. Could you update the test case please? Or let me know if I did anything wrong with the testcase. Thanks. Ok, I've got it. I modified the attached wsdl slightly and now I can reproduce the problem Chris reported. Attached is update WSDL file
i believe r545220 has resolved the issue
Ok, after deep investigate the issue, i found that there's nothing related to the namespace, the method name in the CodeGenTest is really misleading. it *MUST* changed to the FromAnotherMessagePart not FromAnotherNamespace.
As per the spec, if the header from another message part, then it's optional to generate a parameter. As you can see be default cxf wsdl2java generate the same method signature as the JAXWS RI, i.e we don't generate the extra parameter for the soap:header from another message part. However in cxf wsdl2java we have a flag to generate the optional parameter THAT is : -exsh true |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The summary is as follows:
If a type that should be passed in the SOAP header is defined in its own message
rather than the request message, then CXF does not generate a parameter for that
type in the interface. There is no simple way to access that data from the header.
On the other hand, if the type is defined as a separate part of the same request
message (instead of in its own message), then the interface is generated correctly.
The attached example demonstrates a broken operation and a working one.
It is recommended you look at the wsdl to see the difference:
src/main/resources/pizza.wsdl
Then run "mvn install" and look at the generated PizzaPortType interface:
target/generated/src/main/java/com/mypizzaco/service/PizzaPortType.java
Note the difference in the method signatures of the two operations. If CXF
were working correctly, both signatures should be the same.