怎么根据wsdl写相应的接口
wsdl:
<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://openmas.chinamobile.com/pulgin" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ax21="http://entity.openmas.chinamobile.com/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://openmas.chinamobile.com/pulgin">
<wsdl:documentation>Please Type your service description here</wsdl:documentation>
<wsdl:types>
<xs:schema xmlns:ax22="http://entity.openmas.chinamobile.com/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://openmas.chinamobile.com/pulgin">
<xs:import namespace="http://entity.openmas.chinamobile.com/xsd" />
<xs:element name="getSystemTime">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="d" nillable="true" type="xs:dateTime" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getSystemTimeResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NotifyMms">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="messageId" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NotifyMmsDeliveryReport">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="deliveryReport" nillable="true" type="ax22:DeliveryReport" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NotifySms">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="messageId" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NotifySmsDeliveryReport">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="deliveryReport" nillable="true" type="ax22:DeliveryReport" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://entity.openmas.chinamobile.com/xsd">
<xs:complexType name="DeliveryReport">
<xs:sequence>
<xs:element minOccurs="0" name="messageDeliveryStatus" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="messageId" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="receivedAddress" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="sendAddress" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="statusCode" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="NotifyMmsDeliveryReportRequest">
<wsdl:part name="parameters" element="ns:NotifyMmsDeliveryReport" />
</wsdl:message>
<wsdl:message name="NotifyMmsRequest">
<wsdl:part name="parameters" element="ns:NotifyMms" />
</wsdl:message>
<wsdl:message name="getSystemTimeRequest">
<wsdl:part name="parameters" element="ns:getSystemTime" />
</wsdl:message>
<wsdl:message name="getSystemTimeResponse">
<wsdl:part name="parameters" element="ns:getSystemTimeResponse" />
</wsdl:message>
<wsdl:message name="NotifySmsDeliveryReportRequest">
<wsdl:part name="parameters" element="ns:NotifySmsDeliveryReport" />
</wsdl:message>
<wsdl:message name="NotifySmsRequest">
<wsdl:part name="parameters" element="ns:NotifySms" />
</wsdl:message>
<wsdl:portType name="SmsServicePortType">
<wsdl:operation name="NotifyMmsDeliveryReport">
<wsdl:input message="ns:NotifyMmsDeliveryReportRequest" wsaw:Action="urn:NotifyMmsDeliveryReport" />
</wsdl:operation>
<wsdl:operation name="NotifyMms">
<wsdl:input message="ns:NotifyMmsRequest" wsaw:Action="urn:NotifyMms" />
</wsdl:operation>
<wsdl:operation name="getSystemTime">
<wsdl:input message="ns:getSystemTimeRequest" wsaw:Action="urn:getSystemTime" />
<wsdl:output message="ns:getSystemTimeResponse" wsaw:Action="urn:getSystemTimeResponse" />
</wsdl:operation>
<wsdl:operation name="NotifySmsDeliveryReport">
<wsdl:input message="ns:NotifySmsDeliveryReportRequest" wsaw:Action="urn:NotifySmsDeliveryReport" />
</wsdl:operation>
<wsdl:operation name="NotifySms">
<wsdl:input message="ns:NotifySmsRequest" wsaw:Action="urn:NotifySms" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SmsServiceSoap11Binding" type="ns:SmsServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<wsdl:operation name="NotifyMmsDeliveryReport">
<soap:operation soapAction="urn:NotifyMmsDeliveryReport" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
</wsdl:operation>
<wsdl:operation name="NotifyMms">
<soap:operation soapAction="urn:NotifyMms" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
</wsdl:operation>
<wsdl:operation name="getSystemTime">
<soap:operation soapAction="urn:getSystemTime" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="NotifySmsDeliveryReport">
<soap:operation soapAction="urn:NotifySmsDeliveryReport" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
</wsdl:operation>
<wsdl:operation name="NotifySms">
<soap:operation soapAction="urn:NotifySms" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="SmsServiceSoap12Binding" type="ns:SmsServicePortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<wsdl:operation name="NotifyMmsDeliveryReport">
<soap12:operation soapAction="urn:NotifyMmsDeliveryReport" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
</wsdl:operation>
<wsdl:operation name="NotifyMms">
<soap12:operation soapAction="urn:NotifyMms" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
</wsdl:operation>
<wsdl:operation name="getSystemTime">
<soap12:operation soapAction="urn:getSystemTime" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="NotifySmsDeliveryReport">
<soap12:operation soapAction="urn:NotifySmsDeliveryReport" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
</wsdl:operation>
<wsdl:operation name="NotifySms">
<soap12:operation soapAction="urn:NotifySms" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="SmsServiceHttpBinding" type="ns:SmsServicePortType">
<http:binding verb="POST" />
<wsdl:operation name="NotifyMmsDeliveryReport">
<http:operation location="SmsService/NotifyMmsDeliveryReport" />
<wsdl:input>
<mime:content type="text/xml" part="NotifyMmsDeliveryReport" />
</wsdl:input>
</wsdl:operation>
<wsdl:operation name="NotifyMms">
<http:operation location="SmsService/NotifyMms" />
<wsdl:input>
<mime:content type="text/xml" part="NotifyMms" />
</wsdl:input>
</wsdl:operation>
<wsdl:operation name="getSystemTime">
<http:operation location="SmsService/getSystemTime" />
<wsdl:input>
<mime:content type="text/xml" part="getSystemTime" />
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="getSystemTime" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="NotifySmsDeliveryReport">
<http:operation location="SmsService/NotifySmsDeliveryReport" />
<wsdl:input>
<mime:content type="text/xml" part="NotifySmsDeliveryReport" />
</wsdl:input>
</wsdl:operation>
<wsdl:operation name="NotifySms">
<http:operation location="SmsService/NotifySms" />
<wsdl:input>
<mime:content type="text/xml" part="NotifySms" />
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SmsService">
<wsdl:port name="SmsServiceHttpSoap11Endpoint" binding="ns:SmsServiceSoap11Binding">
<soap:address location="http://10.70.165.111:8181/smsService/services/SmsService.SmsServiceHttpSoap11Endpoint/" />
</wsdl:port>
<wsdl:port name="SmsServiceHttpSoap12Endpoint" binding="ns:SmsServiceSoap12Binding">
<soap12:address location="http://10.70.165.111:8181/smsService/services/SmsService.SmsServiceHttpSoap12Endpoint/" />
</wsdl:port>
<wsdl:port name="SmsServiceHttpEndpoint" binding="ns:SmsServiceHttpBinding">
<http:address location="http://10.70.165.111:8181/smsService/services/SmsService.SmsServiceHttpEndpoint/" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
要实现的方法(CXF写webservice)
public void NotifySmsDeliveryReport(DeliveryReport deliveryReport)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
wsdl2java 类库有提供这样的工具哇
不用写,直接生成就行了.
java有命令..
C#也有命令...
一秒搞定
恕我愚昧,不用webservice是直接http请求吗? 另外一个就是合作方给的webservice,我们肯定是得去实现的。
这年头还用webservice
http://my.oschina.net/hlevel/blog/281026