asp 如何访问java的短信接口
对方程序是java做的,提供了一个地址,还有用户名,密码 说往这里传参数就可以发短信,
我用ie直接访问此地址,看到的是一个xml文件
asp这边需要如何传递短信的一些参数还有用户名密码给对方呢
希望别贴教程,点拨一下最好,因为我从网上找了一些范例,但总是只返回状态200 ok 没有任何返回值,也没有发送成短信,所以不知道为什么了
用户名密码是用来识别是谁要调用此接口发短信
对方提供的url地址 http://10.13.255.196/SmsDownlinkReceive/services/DownlinkServiceImpl?wsdl
下面是用ie访问这个地址后的xml文件
<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions targetNamespace="http://service.downlink.sms.mdcl.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://service.downlink.sms.mdcl.com" xmlns:intf="http://service.downlink.sms
.mdcl.com" xmlns:tns1="http:
//exception.downlink.sms.mdcl.com" xmlns:wsdl
="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xml
ns:xsd="http://www.w3.org/2001/XMLSchema">
<!--
WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
- <wsdl:types>
<schema elementFormDefault="qualified" targetNamespace="http://service.downlink.sms.mdcl.com" xmlns="http
://www.w3.org/2001/XMLSchema">
<import namespace="http://exception.downlink.sms.mdcl.com" />
<element name="getSmsStateById">
<complexType>
<sequence>
<element name="smsId" type="xsd:string" />
</sequence>
</complexType>
</element>
<element name="getSmsStateByIdResponse">
<complexType>
<sequence>
<element name="getSmsStateByIdReturn" type="xsd:string" />
</sequence>
</complexType>
</element>
<element name="fault" type="tns1:SmsException" />
<element name="sendSms">
<complexType>
<sequence>
<element name="userName" type="xsd:string" />
<element name="password" type="xsd:string" />
<element name="importance" type="xsd:int" />
<element name="mobile" type="xsd:string" />
<element name="smsBody" type="xsd:string" />
<element name="allowStartTime" type="xsd:int" />
<element name="allowEndTime" type="xsd:int" />
<element name="deadLineTime" type="xsd:dateTime" />
<element name="appointTime" type="xsd:dateTime" />
<element name="smsType" type="xsd:string" />
<element name="feeDept" type="xsd:string" />
</sequence>
</complexType>
</element>
<element name="sendSmsResponse">
<complexType>
<sequence>
<element name="sendSmsReturn" type="xsd:string" />
</sequence>
</complexType>
</element>
</schema>
<schema elementFormDefault="qualified" targetNamespace="http://exception.downlink.sms.mdcl.com" xmlns="h
ttp://www.w3.org/2001/XMLSchema">
<complexType name="SmsException">
<sequence>
<element name="errorMessage" nillable="true" type="xsd:string" />
<element name="errorCode" nillable="true" type="xsd:string" />
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="sendSmsResponse">
<wsdl:part element="intf:sendSmsResponse" name="parameters" />
</wsdl:message>
<wsdl:message name="getSmsStateByIdResponse">
<wsdl:part element="intf:getSmsStateByIdResponse" name="parameters" />
</wsdl:message>
<wsdl:message name="SmsException">
<wsdl:part element="intf:fault" name="fault" />
</wsdl:message>
<wsdl:message name="sendSmsRequest">
<wsdl:part element="intf:sendSms" name="parameters" />
</wsdl:message>
<wsdl:message name="getSmsStateByIdRequest">
<wsdl:part element="intf:getSmsStateById" name="parameters" />
</wsdl:message>
<wsdl:portType name="DownlinkServiceImpl">
<wsdl:operation name="getSmsStateById">
<wsdl:input message="intf:getSmsStateByIdRequest" name="getSmsStateByIdRequest" />
<wsdl:output message="intf:getSmsStateByIdResponse" name="getSmsStateByIdResponse" />
<wsdl:fault message="intf:SmsException" name="SmsException" />
</wsdl:operation>
<wsdl:operation name="sendSms">
<wsdl:input message="intf:sendSmsRequest" name="sendSmsRequest" />
<wsdl:output message="intf:sendSmsResponse" name="sendSmsResponse" /><wsdl:fault message="intf:SmsException" name="SmsException" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="DownlinkServiceImplSoapBinding" type="intf:DownlinkServiceImpl">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="getSmsStateById">
<wsdlsoap:operation soapAction="" />
<wsdl:input name="getSmsStateByIdRequest">
<wsdlsoap:body use="literal" />
</wsdl:input>
<wsdl:output name="getSmsStateByIdResponse">
<wsdlsoap:body use="literal" />
</wsdl:output>
<wsdl:fault name="SmsException">
<wsdlsoap:fault name="SmsException" use="literal" />
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="sendSms">
<wsdlsoap:operation soapAction="" />
<wsdl:input name="sendSmsRequest">
<wsdlsoap:body use="literal" />
</wsdl:input>
<wsdl:output name="sendSmsResponse">
<wsdlsoap:body use="literal" />
</wsdl:output>
<wsdl:fault name="SmsException">
<wsdlsoap:fault name="SmsException" use="literal" />
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="DownlinkServiceImplService">
<wsdl:port binding="intf:DownlinkServiceImplSoapBinding" name="DownlinkServiceImpl">
<wsdlsoap:address location="http://10.13.255.196/SmsDownlinkReceive/services/DownlinkServiceImpl" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>------解决方案--------------------
1 装一个 XMLSpy软件,访问所给的url地址,建一个ws soap请求(得到正确的请求格式), 看下正确的返回值格式
2 装一个pocketsoap组件, 按上述请求格式构造请求, 按上述返回格式解析返回值