各位有谁用过SOAP能提供些实例吗??

各位有谁用过SOAP能提供些实例吗??,第1张

SOAP只是一种传输协议.底层是XML+Http

给你一个完整的soap包的内容

<?xml version="1.0" encoding="utf-8"?>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soapenv:Header>

<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">

<wsse:UsernameToken>

<wsse:Username>User</wsse:Username>

<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Password</wsse:Password>

</wsse:UsernameToken>

</wsse:Security>

</soapenv:Header>

<soapenv:Body>

<request xsi:type="freezelimit:request" xmlns:freezelimit="http://eximbank.gov.cn/ngbs/cms/freezelimit">

<大迅派ptyextkey>er</ptyextkey>

<reference>sdf</reference>

<amount>5</amount>

<currency>45</currency>

</request>

</soapenv:Body>

</滚贺soapenv:Envelope>昌链

补充:想产生SOAP的话.你看看WebService吧.WebService的通讯就是SOAP的.

soap在团判Thinkphp中歼锋的使用实例,代码如下氏或晌:

<?php

//Soap接口服务端

class Server extends Think{

private static $soap

public static function Init(){//URL采用普通模式

$host = $_SERVER['HTTP_HOST']

$module = MODULE_NAME

$action = ACTION_NAME

if((bool)$_GET['ws']){

self::$soap = new SoapServer("http://".$host."/index.php?m=".$module."&a=".$action)

self::$soap->setClass($module."Action")

self::$soap->handle()

}else{


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/tougao/12206102.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-21
下一篇 2023-05-21

发表评论

登录后才能评论

评论列表(0条)

保存