我正在尝试使用Apache CXF-2.5.2 WSDL2Java从wsdl生成java代码。 这是我的WSDL文件:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:tns="http://soa.mytest.com/services/wsdl/test1" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns0="http://soa.mytest.com/test/messages/test1" name="TestManifestPT" targetNamespace="http://soa.mytest.com/services/wsdl/test1" xmlns:jms="http://www.tibco.com/namespaces/ws/2004/soap/binding/JMS" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:jndi="http://www.tibco.com/namespaces/ws/2004/soap/apis/jndi">
<wsdl:types>
<xs:schema xmlns:tns="http://soa.mytest.com/test/messages/test1" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soa.mytest.com/test/messages/test1" version="1.2.0" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:complexType name="TestManifest">
<xs:complexContent>
<xs:extension base="tns:Notification"/>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="Message" abstract="true">
<xs:attribute name="version" type="tns:Version"/>
</xs:complexType>
<xs:complexType name="Notification">
<xs:complexContent>
<xs:extension base="tns:Message"/>
</xs:complexContent>
</xs:complexType>
<xs:simpleType name="Version">
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:element name="TestManifest" type="tns:TestManifest"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="TestManifest">
<wsdl:part name="body" element="ns0:TestManifest"/>
</wsdl:message>
<wsdl:portType name="TestManifestPT">
<wsdl:operation name="TestManifest">
<wsdl:input message="tns:TestManifest"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SOAPService_Binding1" type="tns:TestManifestPT">
<soap:binding style="document" transport="http://www.tibco.com/namespaces/ws/2004/soap/binding/JMS"/>
<jms:binding messageFormat="text"/>
<wsdl:operation name="TestManifest">
<wsdl:documentation/>
<soap:operation style="document" soapAction="TestManifest"/>
<wsdl:input>
<soap:body use="literal" parts="body"/>
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="TestManifestPT">
<wsdl:port name="SOAPService_Binding1" binding="tns:SOAPService_Binding1">
<soap:address location=""/>
<jndi:context/>
<jms:connectionFactory>GenericConnectionFactory</jms:connectionFactory>
<jms:targetAddress destination="queue">INSTRUMENT.BULK.REQUEST</jms:targetAddress>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
对于“Testmanifest”操作,生成的java代码没有输入参数。
package com.mytest.soa.services.testmaster.testbulkresponse.wsdl.test1;
import javax.jws.Oneway;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.xml.ws.RequestWrapper;
import org.apache.cxf.annotations.DataBinding;
/**
* This class was generated by Apache CXF 2.5.2
* 2012-06-07T12:00:34.142+05:30
* Generated source version: 2.5.2
*
*/
@WebService(targetNamespace = "http://soa.mytest.com/services/testmaster/TestBulkResponse/wsdl/test1", name = "TestManifestPT")
@DataBinding(org.apache.cxf.xmlbeans.XmlBeansDataBinding.class)
public interface TestManifestPT {
@Oneway
@RequestWrapper(localName = "TestManifest", targetNamespace = "http://soa.mytest.com/test/messages/test1", className = "com.mytest.soa.test.messages.test1.TestManifestDocument")
@WebMethod(operationName = "TestManifest", action = "TestManifest")
public void testManifest();
}
与Axis2-1.6.1一起使用时,使用相同的wsdl,使用输入参数生成函数“testManifest”。 任何帮助表示赞赏。提前谢谢。