我想要做的是用SOAP和PHP将从表单捕获的值加载到CRM系统。我一直在阅读SOAP一段时间,我不明白如何去做,其他人知道吗?用PHP发送一条SOAP消息
0
A
回答
0
为了做到这一点,从sourceforge下载一个简单的soap工具包(如'NuSOAP')可能是最简单的。
然后您可以编写类似下面的(例如提交的ISBN号码):
<?php
// include the SOAP classes
require_once('nusoap.php');
// define parameter array (ISBN number)
$param = array('isbn'=>'0385503954');
// define path to server application
$serverpath ='http://services.xmethods.net:80/soap/servlet/rpcrouter';
//define method namespace
$namespace="urn:xmethods-BNPriceCheck";
// create client object
$client = new soapclient($serverpath);
// make the call
$price = $client->call('getPrice',$param,$namespace);
// if a fault occurred, output error info
if (isset($fault)) {
print "Error: ". $fault;
}
else if ($price == -1) {
print "The book is not in the database.";
} else {
// otherwise output the result
print "The price of book number ". $param[isbn] ." is $". $price;
}
// kill object
unset($client);
?>
这段代码是直接取自,这也是一个很好的资源,查看 http://developer.apple.com/internet/webservices/soapphp.html
希望这可以帮助。
0
你可能找到了一个解决方案,因为然后 - 但也许以下帮助这个别人浏览:
皂server.php:
<?php
class MySoapServer {
public function getMessage()
{
return "Hello world!";
}
public function add ($n1,$n2)
{
return $n1+n2;
}
}
$option = array ('uri' => 'http://example.org/stacky/soap-server');
$server = new SoapServer(null,$option);
$server->setClass('MySoapServer');
$server->handle();
?>
和皂client.php
<?php
$options = array ('uri' => 'http://example.org/stacky/soap-server',
'location' => 'http://localhost/soap-server.php');
$client = new SoapClient(null,$options);
echo $client ->getMessage();
echo "<br>";
echo $client ->add(41,1);
?>
相关问题
- 1. 发送SOAP消息
- 2. Facebook发送一条消息
- 3. 发送到SOAP 1.1唯一端点时,SOAP 1.2消息无效
- 4. 发送和接收SOAP消息
- 5. NServiceBus:发送第一条消息是慢
- 6. PrintWriter仅发送第一条消息
- 7. 用PHP发送PHP消息会话
- 8. 发送消息给Twitter创建一条错误消息
- 9. 在将SOAP消息发送到.NET中的WebService之前获取SOAP消息
- 10. SOAP教程php发送和接收消息
- 11. 发送了一条信息PHP + AJAX
- 12. Java:ObjectInputStream,发送3条消息,仅收到2条消息
- 13. 只发送一次消息,而不是定期发送消息
- 14. 如何使用PHP发送HTML消息?
- 15. 使用PHP发送SMS消息
- 16. 使用php发送Whatsapp消息
- 17. PHP表单发布不发送消息
- 18. 发送SOAP消息使用KSOAP2使用Android
- 19. 原因:javax.xml.ws.soap.SOAPFaultException:发送到SOAP 1.1唯一端点时,SOAP 1.2消息无效
- 20. 发送消息
- 21. 获取用户使用discord.py发送的最后一条消息?
- 22. 发送服务器多条消息? C#
- 23. 哪个HTTP方法用于发送SOAP消息?
- 24. SOAP消息不是使用wso2 ESB REST API发送的
- 25. 如何使用BotKit在Slack上随机发送一条消息?
- 26. 发送一条消息给iOS的XMPPFramework使用
- 27. 使用SOAP创建XML消息PHP
- 28. 试图一次只发送一条SMS消息
- 29. 发送通用消息
- 30. 用C发送消息#