Skip to content

农村电子商务平台数据提交客户端

Notifications You must be signed in to change notification settings

binatify/wsclient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

wsclient

农村电子商务平台 日报,月报,年报数据提交客户端(Golang 版本)。

Usage

Use go get github.com/binatify/wsclient

package main

import (
    "fmt"

    "github.com/binatify/wsclient"
)

type serviceStation struct{}

func main() {
    client := wsclient.NewClient(nil)

    var in serviceStation

    body, err := client.Do(in)

    fmt.Println(in)
    fmt.Println(string(body))
}

WSAL SOAP协议声明

通过链接可以访问 syncServiceStation 服务的声明。

以 Restful 方式提交数据:

  • POST 请求
  • 设置对应的 Header 信息:
    req.Header.Set("Content-Type", "text/xml;charset=UTF-8")
    req.Header.Set("Accept", "application/soap+xml, application/dime, multipart/related, text/*")
    req.Header.Set("User-Agent", "Axis/1.4")
    req.Header.Set("Host", "211.88.20.132:8040")
    req.Header.Set("SOAPAction", "http://www.cvicse.com/service/syncServiceStationOperation")
  • Body 格式:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
    <syncServiceStationOperationRequest xmlns="http://www.cvicse.com/service/">
      <in xmlns="">
        <serviceStation>
          <userId>xxx</userId>
          <rptDate>2017-12-08</rptDate>
          <serviceStationReport>
            <code>xx</code>
            <name>xx</name>
            <countyType>1</countyType>
            <buyOrder>5</buyOrder>
            <saleOrder>28</saleOrder>
            <serviceStationCommodity>
              <commId>5</commId>
              <money>123</money>
            </serviceStationCommodity>
            <serviceStationCommodity>
              <commId>28</commId>
              <money>123</money>
            </serviceStationCommodity>
          </serviceStationReport>
        </serviceStation>
      </in>
    </syncServiceStationOperationRequest>
  </soapenv:Body>
</soapenv:Envelope>

About

农村电子商务平台数据提交客户端

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages