SOAP development Manual

Similar documents
Easy Data Centralization with Webster. User Guide

Getting started with OWASP WebGoat 4.0 and SOAPUI.

3.5 LAN HDD Enclosure User s Manual

Real-Time Connectivity Specifications For. 270/271 and 276/277 Inquiry Transactions. United Concordia Dental (UCD)

SNMP Web Management. User s Manual For SNMP Web Card/Box

Web Services API Developer Guide

EUR-Lex 2012 Data Extraction using Web Services

2- Electronic Mail (SMTP), File Transfer (FTP), & Remote Logging (TELNET)

TDP43ME NetPS. Network Printer Server. Control Center. for Ethernet Module

Gigaset IP and IP-PRO Phones Provisioning / Remote Management. last modifications by J. Stahl, Bocholt, January the 18 th 2011

QUANTIFY INSTALLATION GUIDE

MGC WebCommander Web Server Manager

Rotorcraft Health Management System (RHMS)

Lesson 4 Web Service Interface Definition (Part I)

BIT COMMANDER. Serial RS232 / RS485 to Ethernet Converter

Pcounter Web Administrator User Guide - v Pcounter Web Administrator User Guide Version 1.0

IriScene Remote Manager. Version 4.8 FRACTALIA Software

Knowledge Base Article: Article 218 Revision 2 How to connect BAI to a Remote SQL Server Database?

F2103 GPRS DTU USER MANUAL

What is Distributed Annotation System?

NetSupport DNA Configuration of Microsoft SQL Server Express

Active Directory Management. Agent Deployment Guide

IVI Configuration Store

Cloud Services ADM. Agent Deployment Guide

Excel To Component Interface Utility

WebSphere Business Monitor V7.0: Clustering Single cluster deployment environment pattern

NetSupport DNA Configuration of Microsoft SQL Server Express

What is SOAP MTOM? How it works?

Setting up an MS SQL Server for IGSS

Stored Documents and the FileCabinet

Oracle Essbase Integration Services. Readme. Release

Legal Notes. Regarding Trademarks KYOCERA Document Solutions Inc.

Rev 7 06-OCT Site Manager Installation Guide

User s Guide [Security Operations]

Abstract. Avaya Solution & Interoperability Test Lab

HireDesk API V1.0 Developer s Guide

Enabling SSL and Client Certificates on the SAP J2EE Engine

User Manual of Web Client

TestElite - Troubleshooting

Fairsail REST API: Guide for Developers

Working Folder Linkage Setup Guide

Avatier Identity Management Suite

Data Access Guide. BusinessObjects 11. Windows and UNIX

Two-Factor Authentication

CipherLab 5100 Time Attendance Utility Manual

Acronis Backup & Recovery: Events in Application Event Log of Windows

Install MS SQL Server 2012 Express Edition

Introduction to Web Services

How to Use Certificates for Additional Security

SSL VPN Technology White Paper

Use of Commercial Backup Software with Juris (Juris 2.x w/msde)

WEB CONFIGURATION. Configuring and monitoring your VIP-101T from web browser. PLANET VIP-101T Web Configuration Guide

V2.0 Attendance System Hardware Suite Guide Instructions Manual

Enhanced Connector Applications SupportPac VP01 for IBM WebSphere Business Events 3.0.0

Creating SOAP and REST Services and Web Clients with Ensemble

Deploying Windows Streaming Media Servers NLB Cluster and metasan

e-filing Secure Web Service User Manual

TIBCO Spotfire Automation Services Installation and Configuration

FortiAnalyzer VM (VMware) Install Guide

Bitrix Site Manager. Quick Guide To Using The AD/LDAP Module

Two Factor Authentication in SonicOS

STORAGE SYSTEM DATALOGGER DATABASE

USB Card Reader Plug-in Installation Guide. Xerox WorkCentre 5325/5330/5335 Xerox WorkCentre 7120 Xerox WorkCentre 7425/7428/7435

HP Quality Center. Upgrade Preparation Guide

Integration Guide. Microsoft Active Directory Rights Management Services (AD RMS) Microsoft Windows Server 2008

United Concordia (UCD) Real Time Claim Submission & Adjudication Connectivity Specifications

LabVIEW Internet Toolkit User Guide

SMTP-32 Library. Simple Mail Transfer Protocol Dynamic Link Library for Microsoft Windows. Version 5.2

Upgrading from MSDE to SQL Server 2005 Express Edition with Advanced Services SP2

WIZnet S2E (Serial-to-Ethernet) Device s Configuration Tool Programming Guide

How-to: Single Sign-On

How To Use Gfi Mailarchiver On A Pc Or Macbook With Gfi From A Windows 7.5 (Windows 7) On A Microsoft Mail Server On A Gfi Server On An Ipod Or Gfi.Org (

State of Michigan Data Exchange Gateway. Web-Interface Users Guide

AXL Troubleshooting. Overview. Architecture

OA101 Fingerprint Time attendance system Preface

HP ProLiant Cluster for MSA1000 for Small Business Hardware Cabling Scheme Introduction Software and Hardware Requirements...

Documentation to use the Elia Infeed web services

Operating System Installation Guide

Using SQL Server Management Studio

Xerox DocuShare Security Features. Security White Paper

Chapter 4 Management. Viewing the Activity Log

MS InfoPath 2003 MS InfoPath 2007 Microsoft Office InfoPath 2003 minimally runs on the following operating systems:

TROUBLESHOOTING INFORMATION

HP A-IMC Firewall Manager

Feature and Technical

Active Directory Adapter with 64-bit Support Installation and Configuration Guide

2- Electronic Mail (SMTP), File Transfer (FTP), & Remote Logging (TELNET)

How to use EasyDDNS by HIKVISION. All rights reserved. 1

Active Directory Management. Agent Deployment Guide

ChromQuest 5.0 Chromatography Data System

About This Document 3. Integration and Automation Capabilities 4. Command-Line Interface (CLI) 8. API RPC Protocol 9.

U.S. FDA Title 21 CFR Part 11 Compliance Assessment of SAP Records Management

Novell ZENworks 10 Configuration Management SP3

FREQUENTLY ASKED QUESTIONS

Aradial Installation Guide

Hands-on Network Traffic Analysis Cyber Defense Boot Camp

McAfee One Time Password

Transcription:

ZKSoftware Inc SOAP development Manual Version: 2.0 2006.12

1 ZK Web Server SOAP definition and description...2 1.1Summarize...2 1 SOAP Summary...2 2 with the XML relation...2 3 SOAP envelopes...3 5. Based on the WEBSERVER SOAP realization...4 1.2Agreement...4 1.3 prepare developments...5 2. Function...7 2.1 Download Attendance log...7 2.2 Download User information...7 2.3 Download User Fingerprint Template...8 2.4 Upload User Information...8 2.5 Upload User Fingerprint Template...8 2.6 Delete User...8 2.7 Get MachineTime...9 2.8 Setting Time to Machine...9 2.9 Setting Parameter to Machine...9 2.10 Communication Password (security code)...9 2.11 Upgrade firmware...9 2.12 Clear data...10 2.13 Refresh device s database...10 2.14 Reboot device...10 3 Use MS SOAP-TOOLKIT 3.0...10 1

Release history Date Revision Change 2006.12 1.0 First release 1 ZK Web Server SOAP definition and description 1.1Summarize 1 SOAP Summary SOAP is a lightweight protocol intended for exchanging structured information in a decentralized, distributed environment. SOAP uses XML technologies to define an extensible messaging framework, which provides a message construct that can be exchanged over a variety of underlying protocols. The framework has been designed to be independent of any particular programming model and other implementation specific semantics. Second, SOAP can be used over any from transport message and RPC all kind of system SOAP include three parts SOAP envelope structure has defined an whole framework that may express any content which the message contain, who process these contents, and these contents may be optional or necessary. SOAP encoding rule define a series of mechanisms that exchange data type of the application. SOAP RPC defines an agreement that express the remote procedure call and the respond. Although these three parts all together are described as a SOAP part, but their function are in intersection. Special, the encapsulation and coding rule are defined in the different namespace, this module definition method increased the simplicity to the SOAP envelope, beside of the SOAP encoding rule and the SOAPRPC agreement, this standard also defined two binding agreements, which describes how to transmit the SOAP message which is contained in the HTTP message whether there are HTTP extension the framework or not. 2 with the XML relation all SOAP message base on XML (more information please refer to the documents which related XML), for a SOAP application message, the SOAP definition attribute and the attribute must include the correct namespace. The SOAP application must be able to process SOAP namespace of the message which it received, and it may process SOAP message that is without the SOAP namespace, they are same as result, just like it own the correct namespace. SOAP defined two namespace (more related XML namespace information please t refer to related XML documents) the soap envelope namespace sign is " Http://schemas.xmlsoap.org/soap/envelope/ the soap encoding rule namespace sign is " Http://schemas.xmlsoap.org/soap/encoding/ 2

SOAP message cannot contain the documents type statement, also cannot include the message handling instruction. SOAP uses The " ID" Type " Id" attribute to assign only sign to attribute, simultaneously this attribute is partial and do not need to verify. SOAP uses The " Uri-reference" Type " Href" attribute to assign this value citation, simultaneously this attribute is partial and do not need to verify. So it comply with the XML standard, the XMLSchema standard and the XML connection language standard style. Besides of SOAP the mustunderstand attribute and the SOAPactor attribute, generally allow the attribute and their value appears in the XML documents example or Schema (two effects is same). In other words, the default value or the fix value is stated by DTD or Schema, and set its value in the XML documents example is in semantic affinity. 3 SOAP envelopes SOAP message is a XML document; include an essential SOAP envelope, optional header and an mandatory SOAP body. In residual part of this standard, when mention SOAP message that refer to this XML documents. In this defined attribute and attribute namespace sign is: Http://schemas.xmlsoap.org/soap/envelope/" A SOAP message including below part: 1. In the XML documents to express this message, the envelope is the top layer attribute. 2. All quarters which use SOAP exchange information is dispersible and without prearrange, SOAP header has provided with the mechanism that add certain essential element which is about this SOAP message (feature) to the SOAP message. SOAP defines a few attribute that indicate this essential element (feature) whether could be optional or who processes it. 3. SOAP body is a generic container in that it can contain the message finally the receiver wants. SAOP defines an element named Fault for representing errors within the Body element when things go wrong. This is essential because without a standard error representation. 4.SOAP Syntax rule Envelopes 1. Attribute name is "Envelope" 2. must appear in the SOAP message SOAP. 3. may include the namespace statement and append attribute, if include append attribute, must limit the namespace of the these attribute, like as these, "Envelope" may include append sub-attribute, also these namespace must be limited and follow the SOAP body. SOAP Header 1. Attribute name is "Header" 2. May appear in the SOAP message, if it appear, must be the first sub- attribute of the SOAP envelop. 3. SOAP header may include many items, each item is direct sub- attribute of the SAOP attribute, and all direct sub-attribute of the SOAP header must be limit namespace. 3

xxxx SOAP body 1. Attribute name is"body" 2. Must appear in the SOAP message and be direct sub-attribute of the SOAP envelop attribute, which must follow the SOAP attribute behind,soap body may include many item, each item is direct sub- attribute of the SAOP body attribute, all direct sub-attribute of the SOAP body may be limit namespace, SOAP defines an element named Fault for representing errors. 5. Based on the WEBSERVER SOAP realization ZK fingerprint machine s SOAP interface base on the built-in WebServer foundation, realized a lightweight simple, extensible, and rich XML messaging framework for defining higher-level application protocols. Note 1. Character set This SOAP interface supports the character set that is the ISO8859-X series character coding, also the single byte character set, simultaneously also supports partial double byte character coding,like Chinese and so on (Chinese and so on double byte character set possibly not to support in MS SOAP SDK, when use Chinese and so on double byte character set, please refer to relative MS SOAP SDK technology documents which about Chinese solution) 2. XML Formats this SOAP interface support XML the standard WELL FORMAT formats, namely do not support high-level cannot write is: XML the characteristic, like DTD data verification mode, regarding the SOAP " Header " in SOAP any content will be neglected. this SOAP XML code format produces by the attribute value form, the wrong code 1.2Agreement All parameter is transferred by <Arg/> form. All return value is indicated by <Row> form. All SOAP provide with POST method. the agreement about return value: Regarding all SET method, which return form <Row RetCode= xx RetValue= xxxx ></Row> RetCode is return status code, RetValue is the description character strings to returns condition wrong code If the format provided by SOAP-XML is different with WELL FORMAT or the name of visiting way does not exist, the system will return 500 universality server faults. E.g The 404 error occur when visiting name make mistake took HTTP head to return 404 Serve Name iwsservice This Serve Name indicate that Web Server supply SAOP server HTTP Head Pursuant the SOAP-HTTP head rule, the description is follow POST /iwsservice HTTP/1.0 Need SOAP sever 4

Content-Type: text/xml Need to indicate that the XML is SOAP resolution format. Content-Length: nnnnn Need to point out the size of SAOP request. SOAPAction: uri:someuri Extension HTTP protocol show SOAP function field. Maybe following URI is empty E.g Ability to accept format is SOAPAction: SOAPAction: SOAPAction: uri:someuri URI may be any legal domain name After the Server responded the SAOP request, return HTTP/1.0 200 OK 200 indicate successfully Server: ZKWEBSERVER Content-Type: text/xml Return XML-SOAP data 1.3 prepare developments There is a built-in WevServer in the equipment with the SOAP interface. Therefore only needs to develop the SOAP client end communication. 1. May login the Microsoft official website to download the newest SDK, install the SDK, how to use the Microsoft SDK, please refer to Microsoft help. 2. download to the data structure and read the function descriptions, such as, reads the T&A record following form, may very clear see, the XML header, the XML structure body, and conclusion part. <?xml version="1.0" standalone="no"?> <SOAP-ENV:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> i. <GetAttLogResponse> ii. iii... </GetAttLogResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> 3. Please understood the sending and receiving of the SOAP request, its essential is the TCP/IP connection request, and receive data. 4. Please understood XML DOM object use, the Microsoft SOAP SDK provided the object function to process, contain the XML resolution, analyze and read in the node and so on. 5. the development flow chart as follow, please refer: 5

SoapConnector, XMLDOMNodeList, XMLDOMElement SoapReader etc ini Begin connect,ini Property, Action,URL,send XML to server N Conn and send succ Do Other Y Read soap stream N Read data Do Other Y Read DOM Data handle Store the data Complete one connect and data handle 6. Term explanation: Element, refers to XML some row, node. May regard the database operation the record volume as the some corresponding row, please refer to understood. Value: Up to corresponding attribute value. Like as Microsoft SOAP SDK SoapSerializer has the function WriteString to be allowed to give some attribute to read in a value, please refer understood. 6

7. Development flow no matter is the transmission or receive, all its essential is TCP\IP (or the HTTP request) transmits. The middle transmission data all is the XML character data. The service end and the client process XML flow t, the client end may depend on the SOAP SDK to produce the XML transmission request, to receive XML, analyzes the XML node, simply completes communication, for the application, only needs to understand the SOAP the simple application method. 2. Function 2.1 Download Attendance log Order GetAttLog Element PIN Value Transfer ALL in, return all Attendance Log. Otherwise, return the user s attendance logs which user NO. has been transferred. Meanings about node returning value PIN Personal identity number Time second Attendance Time. verified Matching Way. status State, E.g checkin\out workcode Work code reserved1 Key word invalid reserved2 Key word invalid Note:All Download function,if hava data,it result data,else,it result null note in xml. 2.2 Download User information Order GetUserInfo Element PIN Value Transfer ALL in, return all user information. Otherwise, return the user s user information which user NO. has been transferred. Meanings about node return value PIN Personal identity number Name User name Password Password Group User s group privilege Privilege Privilege Card Card Number PIN2 Personal identity Number (only above 5 digit is voild). TZ1 User Time Zone 1 7

TZ2 User Time Zone 2 TZ3 User Time Zone 3 2.3 Download User Fingerprint Template Order GetUserTemplate Element PIN Value Transfer ALL in, return all user template,transfer user No. in return the user s fingerprint template which user NO. has been transferred. Meanings about node return value PIN Personal identity number FingerID Fingerprint No. Size Size of fingerprint template, Note: take binary system to note. Valid The fingerprint template whether take effect, 1 is valid, 0 is not invalid. Template Fingerprint template 2.4 Upload User Information Order SetUserInfo Element It has same returning node and sequence as GetUserInfo. Value Transfer user No. name etc in, the Node is same configure and sequence as Get User Info return node Meanings about node returning value Note:All SOAP request successfully and execute successfully or fail.it will return a note,include error code,content,the content will tell you what about it. When you upload user successfully,please use command of RefreshDB to resfresh the device s database.please refer the describe the command RefreshDB. 2.5 Upload User Fingerprint Template Order SetUserTemplate Element It has same returning node and sequence as GetUser Template. Value Transfer user No. name etc in, the Node is same configure and sequence as Get User Template returning Note: When you upload user successfully,please use command of RefreshDB to resfresh the device s database.please refer the describe the command RefreshDB. 2.6 Delete User Order DeleteUser Element PIN Value Transfer User NO. Note: 8

When you upload user successfully,please use command of RefreshDB to resfresh the device s database.please refer the describe the command RefreshDB. 2.7 Get MachineTime Order GetDate Element Nothing If the value is empty, the performance is successful, otherwise it s failed. Value: Nothing Meanings about node returning Value Date: Time: Return Date. Return Time. 2.8 Setting Time to Machine Order SetDate Element Date, Time Value Transfer in Date Transfer in Time. 2.9 Setting Parameter to Machine Order SetOption Element Name, Value Value Datep :configure name Value: Transfer parameter. Note: open for you. The parameter name are open by zksoftware.if you need,please contract with us,we will confirm and 2.10 Communication Password (security code) use the SOAP service to obtain data from the equipment, should first establish the connection password, each time requestment all needs to verify password.. Method key Element Value Value Equipment communication password. Note this method work in other way to request, this method must add in the SOAP request every time, the data do not be returned until verify security code successfully, otherwise fail to return data. 2.11 Upgrade firmware Method: Update 9

Element: Value Value: Value introduce the parameter Meaning: Update firmware to equipment. The firmware code must use the BASE64 code, introduce it through VALUE. Note: It must use the firmware firmware that it was supply by zksoftware.please do not use other file. 2.12 Clear data Method: ClearData Element: Value Value: Value introduce the parameter Meaning: Value is a flag at here,if Value input in 1,it will clear user information and template,if input 2, Clear template,if input 3,cleanr transaction. Note: This command will delete the data and can not restore. 2.13 Refresh device s database Method: RefreshDB Element: this command not need input in value Note: When you upload,delete data for assure the data was refresh,please use this command to refresh device s database. 2.14 Reboot device Method: Restart Element: this command not need input in value,of course,every command need communication key. Note: If the command execute successfully,it will return a xml data,include error code and content. 3 Use MS SOAP-TOOLKIT 3.0 1. Download SOAP-TOOKIT SDK there is downloading package in the Microsoft website, current version is 3.0 2. After installing this SDK May utilize VC VB DELPHI CB develop SOAP protocol 3. Follow is a SOAPTOOLKIT example by VC. 10

#include "stdafx.h" #import "C:\WINNT\system32\msxml4.dll" using namespace MSXML2; #import "C:\Program Files\Common Files\MSSoap\Binaries\mssoap30.dll" exclude("istream", "IErrorInfo", "ISequentialStream", "_LARGE_INTEGER","_ULARGE_INTEGER", "tagstatstg", "_FILETIME") using namespace MSSOAPLib30; void Add() { ISoapSerializerPtr Serializer=NULL; ISoapReaderPtr Reader=NULL; ISoapConnectorPtr Connector=NULL; Connector.CreateInstance( uuidof(httpconnector30)); // Assign SOAP request Connector->Property["EndPointURL"] ="http://192.168.1.5/iwsservice"; Connector->Connect(); // Begin a SOAP message. Connector->Property["SoapAction"] = "uri:zksoftware"; Connector->BeginMessage(); Serializer.CreateInstance( uuidof(soapserializer30)); Serializer->Init(_variant_t((IUnknown*)Connector->InputStream)); // create a SOAP message XML description Serializer->StartEnvelope("","",""); Serializer->StartBody(""); // method name of SOAP request 11

Serializer->StartElement("SetUserInfo","http://www.zksoftware/Service/message/","",""); Serializer->StartElement("Arg","","",""); //this method parameter value Serializer->SoapAttribute("PIN","","11",""); Serializer->SoapAttribute("Privilege","","14",""); Serializer->SoapAttribute("Name","","Soap",""); Serializer->SoapAttribute("Card","","119119",""); Serializer->SoapAttribute("Group","","1",""); Serializer->SoapAttribute("PIN2","","11",""); Serializer->EndElement(); Serializer->EndElement(); Serializer->EndBody(); Serializer->EndEnvelope(); // Send the message to the XML Web service. Connector->EndMessage(); if(connector->outputstream!=null) { Reader.CreateInstance( uuidof(soapreader30)); Reader->Load(_variant_t((IUnknown*)Connector->OutputStream), ""); printf("xml:%s \n",(char *)Reader->Dom->xml); MSXML2::IXMLDOMDocumentPtr pdoc; HRESULT hr = pdoc.createinstance( uuidof(msxml2::domdocument30)); MSXML2::IXMLDOMElementPtr childnode; 12

{ pdoc->loadxml(reader->dom->xml); childnode = (MSXML2::IXMLDOMElementPtr)(pDoc->selectSingleNode("//Row")); while(childnode!=null) MSXML2::DOMNodeType nodetype; childnode->get_nodetype(&nodetype); BSTR var; VARIANT varval; childnode->get_nodename(&var); childnode->get_nodetypedvalue(&varval); printf("\ntag:%s %s\n", (char*)(_bstr_t)var,(char*)(_bstr_t)varval); //Node attributes. Put into link table. MSXML2::IXMLDOMNamedNodeMapPtr pattrs = NULL; MSXML2::IXMLDOMNodePtr pattritem; childnode->get_attributes(&pattrs); long ncount pattrs->get_length(&ncount); for(int i = 0 ; i < ncount ; i++) { pattrs->get_item(i,&pattritem); // through the function get_nodename,get_nodetypedvalue get attribute name and attribute value printf("%s=",(char*)(_bstr_t)pattritem->nodename); printf("%s\n", (char*)(_bstr_t)pattritem->nodetypedvalue); 13

} childnode=childnode->nextsibling; } getchar(); } } int main(int argc, char* argv[]) { CoInitialize(NULL); Add(); CoUninitialize(); return 0; } 14