我从Soap客户端请求得到了这个:
例外:SoapFault异常:[soap:Client]服务器无法读取请求.---> XML文档中存在错误(2,273).--->字符串'2010-5-24'不是有效的AllXsd值.在/path/filinet.php:21堆栈跟踪:#0 [内部函数]:SoapClient - > __ call('SubIdDetailsByO ...',数组)#1 /path/filinet.php(21):SoapClient-> SubIdDetailsByOfferId(数组)#2 {main}
好像我发送的值不正确,如何在php中的AllXsd格式化我的值?
这是我的代码:
<?php
$start = isset($_GET['start']) ? $_GET['start'] : date("Y-m-d");
$end = isset($_GET['end']) ? $_GET['end'] : date("Y-m-d");
//define parameter array
$param = array('userName'=>'user', 'password'=>'pass', 'startDate' => $start, 'endDate' => $end, 'promotionId' => '');
//Get wsdl path
$serverPath = "https://webservices.filinet.com/affiliate/reports.asmx?WSDL";
//Declare Soap client
$client = new SoapClient($serverPath);
try {
//make the call
$result = $client->SubIdDetailsByOfferId($param);
//If error found display error
if(isset($fault))
{
echo "Error: ". $fault;
}
//If no …Run Code Online (Sandbox Code Playgroud) 我想知道如何实时更新XML文件.我有这个文件例如:
<?xml version="1.0" encoding="UTF-8"?>
<Cars>
<car make="Toyota" model="95" hp="78" price="120"/>
<car make="kia" model="03" hp="80" price="300"/>
</Cars>
Run Code Online (Sandbox Code Playgroud)
我该怎么做才能像这样更新价格值?:
<?xml version="1.0" encoding="UTF-8"?>
<Cars>
<car make="Toyota" model="95" hp="78" price="50"/>
<car make="kia" model="03" hp="80" price="100"/>
</Cars>
Run Code Online (Sandbox Code Playgroud)
我搜索过网络,但我找到的只是如何解析,以及如何编写整个文件XmlSerializer,但不是如何修改.我也用Java 发现了这个,但是我没能在Android上实现它,因为我对android-xml世界很新.
根据 Lumen 5.3 文档:
使用迁移
一种选择是在每次测试后回滚数据库并在下一次测试之前迁移它。Lumen 提供了一个简单的 DatabaseMigrations trait,它会自动为你处理这个问题。只需在您的测试类上使用 trait:
Run Code Online (Sandbox Code Playgroud)<?php use Laravel\Lumen\Testing\DatabaseMigrations; use Laravel\Lumen\Testing\DatabaseTransactions; class ExampleTest extends TestCase { use DatabaseMigrations; /** * A basic functional test example. * * @return void */ public function testBasicExample() { $this->get('/foo'); } }使用事务
另一种选择是将每个测试用例包装在一个数据库事务中。同样,Lumen 提供了一个方便的 DatabaseTransactions trait 来自动处理这个:
Run Code Online (Sandbox Code Playgroud)<?php use Laravel\Lumen\Testing\DatabaseMigrations; use Laravel\Lumen\Testing\DatabaseTransactions; class ExampleTest extends TestCase { use DatabaseTransactions; /** * A basic functional test example. * * @return void */ public function testBasicExample() { $this->get('/foo'); } }
如您所见,解释文本几乎相同,代码示例完全相同,除了 trait …
当我尝试向 hazelcast 主题发送消息时,出现以下异常。使用 hazelcast 客户端连接 hazelcast 节点 (hazelcast 3.6)
有什么想法这可能是什么吗?它几乎是我正在使用的基本开箱即用服务器和客户端配置。
Caused by: java.util.concurrent.ExecutionException: com.hazelcast.client.HazelcastClientNotActiveException: Partition does not have owner. partitionId : 25
at com.hazelcast.client.spi.impl.ClientInvocationFuture.resolveResponse(ClientInvocationFuture.java:146)
at com.hazelcast.client.spi.impl.ClientInvocationFuture.get(ClientInvocationFuture.java:100)
at com.hazelcast.client.util.ClientDelegatingFuture.get(ClientDelegatingFuture.java:118)
at com.hazelcast.client.util.ClientDelegatingFuture.get(ClientDelegatingFuture.java:105)
at com.hazelcast.client.proxy.ClientReliableTopicProxy.addWithBackoff(ClientReliableTopicProxy.java:128)
at com.hazelcast.client.proxy.ClientReliableTopicProxy.publish(ClientReliableTopicProxy.java:102)
... 10 more
Caused by: com.hazelcast.client.HazelcastClientNotActiveException: Partition does not have owner. partitionId : 25
at com.hazelcast.client.spi.impl.ClientInvocation.notifyException(ClientInvocation.java:180)
at com.hazelcast.client.spi.impl.ClientInvocation.invoke(ClientInvocation.java:137)
at com.hazelcast.client.proxy.ClientRingbufferProxy.addAsync(ClientRingbufferProxy.java:163)
at com.hazelcast.client.proxy.ClientReliableTopicProxy.addWithBackoff(ClientReliableTopicProxy.java:128)
at com.hazelcast.client.proxy.ClientReliableTopicProxy.publish(ClientReliableTopicProxy.java:102)
at com.rbccm.sabre.dataloader.infra.msg.hazelcast.HzTopicPublisher.publish(HzTopicPublisher.java:34)
at com.rbccm.sabre.dataloader.infra.monitor.MonitorMessagePublisher.publishExpectedFiles(MonitorMessagePublisher.java:21)
at com.rbccm.sabre.dataloader.infra.DefaultLoadSequence.execute(DefaultLoadSequence.java:41)
at com.rbccm.sabre.dataloader.DataLoaderServiceImpl.load(DataLoaderServiceImpl.java:30)
at com.rbccm.sabre.dataloader.controller.DataLoaderController.load(DataLoaderController.java:80)
at com.rbccm.sabre.dataloader.controller.ControllerRequestConsumer.consume(ControllerRequestConsumer.java:51)
at com.rbccm.processmanager.common.pubsub.ProcessEventQueueHandler$1.run(ProcessEventQueueHandler.java:52)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown …Run Code Online (Sandbox Code Playgroud) xml ×2
.net ×1
android ×1
c# ×1
character ×1
datagridview ×1
hazelcast ×1
java ×1
laravel ×1
lumen ×1
php ×1
soap ×1
unicode ×1
unit-testing ×1
xml-parsing ×1