我创建了一个Web服务“患者”,并将其托管在Axis上以获取WSDL:
WSDL代码
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://ws.apache.org/axis2" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://ws.apache.org/axis2">
<wsdl:documentation>getPatientDetails</wsdl:documentation>
<wsdl:types>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://ws.apache.org/axis2">
<xs:element name="getPatientDetails">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="args0" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getPatientDetailsResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="RequestMessage">
<wsdl:part name="parameters" element="ns:getPatientDetails"/>
</wsdl:message>
<wsdl:message name="ResponseMessage">
<wsdl:part name="parameters" element="ns:getPatientDetailsResponse"/>
</wsdl:message>
<wsdl:portType name="getPatientDetailsPortType">
<wsdl:operation name="getPatientDetails">
<wsdl:input message="ns:RequestMessage" wsaw:Action="urn:getPatientDetails"/>
<wsdl:output message="ns:ResponseMessage" wsaw:Action="urn:getPatientDetailsResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="getPatientDetailsSoap11Binding" type="ns:getPatientDetailsPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="getPatientDetails">
<soap:operation soapAction="urn:getPatientDetails" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="getPatientDetailsSoap12Binding" type="ns:getPatientDetailsPortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="getPatientDetails">
<soap12:operation soapAction="urn:getPatientDetails" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="getPatientDetailsHttpBinding" type="ns:getPatientDetailsPortType">
<http:binding verb="POST"/>
<wsdl:operation name="getPatientDetails">
<http:operation location="getPatientDetails"/>
<wsdl:input>
<mime:content type="text/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="getPatientDetails">
<wsdl:port name="getPatientDetailsHttpSoap11Endpoint" binding="ns:getPatientDetailsSoap11Binding">
<soap:address location="http://localhost:8080/axis2/services/getPatientDetails.getPatientDetailsHttpSoap11Endpoint/"/>
</wsdl:port>
<wsdl:port name="getPatientDetailsHttpSoap12Endpoint" binding="ns:getPatientDetailsSoap12Binding">
<soap12:address location="http://localhost:8080/axis2/services/getPatientDetails.getPatientDetailsHttpSoap12Endpoint/"/>
</wsdl:port>
<wsdl:port name="getPatientDetailsHttpEndpoint" binding="ns:getPatientDetailsHttpBinding">
<http:address location="http://localhost:8080/axis2/services/getPatientDetails.getPatientDetailsHttpEndpoint/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
但是,当我尝试将WSDL导入TIBCO业务时,我遇到了问题: WSDL适用于SoapUI工具,java代码工作正常。