生病的吉娃娃

欢迎使用WSBLog,有什么问题或意见请给我反馈,谢谢。

导航菜单

« QR Code二维条码开源项目,招募志愿开发者 [QR Code开源项目]Flash客户端讲解(1) »

[QR Code开源项目]服务器端解码程序接口定义

现在的QR Code服务器端解码程序以Web Service对外公开接口,以后可能会增加别的接口,比如Form Post的接口。

Web Service的URL为:
http://qr.oucsoft.com/service/Decoder.asmx

目前的WSDL服务描述可以直接查看:

http://qr.oucsoft.com/service/Decoder.asmx?WSDL

也就是如下:

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://qrcode.oucsoft.com/service" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://qrcode.oucsoft.com/service" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://qrcode.oucsoft.com/service">
      <s:element name="DecodeHex">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="strHex" type="s:string" />
            <s:element minOccurs="1" maxOccurs="1" name="imgWidth" type="s:int" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="DecodeHexResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="DecodeHexResult" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
  </wsdl:types>
  <wsdl:message name="DecodeHexSoapIn">
    <wsdl:part name="parameters" element="tns:DecodeHex" />
  </wsdl:message>
  <wsdl:message name="DecodeHexSoapOut">
    <wsdl:part name="parameters" element="tns:DecodeHexResponse" />
  </wsdl:message>
  <wsdl:portType name="DecoderSoap">
    <wsdl:operation name="DecodeHex">
      <wsdl:input message="tns:DecodeHexSoapIn" />
      <wsdl:output message="tns:DecodeHexSoapOut" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="DecoderSoap" type="tns:DecoderSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    <wsdl:operation name="DecodeHex">
      <soap:operation soapAction="http://qrcode.oucsoft.com/service/DecodeHex" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="Decoder">
    <wsdl:port name="DecoderSoap" binding="tns:DecoderSoap">
      <soap:address location="http://qr.oucsoft.com/service/Decoder.asmx" />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>


——我们可以看出,里面有一个叫做Decoder的Service,而Decoder里面现在仅有一个函数:DecoderHex。使用VS.Net的朋友,可以直接用Web引用引入IDE中查看。

而DecodeHex它接受的输入参数有两个:一个由黑白图像数据转换来的16进制字符串,一个是图像宽度(现在的图像宽度只能接受8的倍数)。DecodeHex的输出结果只有一个字符串。

可见,QR Code解码接口的定义非常的简单。

在后续的文章里,我会以Flash解码客户端为例,说明怎么生成QR Code解码服务接受的参数。

发表评论:

Verificaton_Code

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点.

网站目录

Google

日历

最新评论

最近发表

Powered By WSBLog 1.6 Beta Build 60420

Copyright 2004-2006 wubuku.com. Some Rights Reserved.