English 中文(简体)
SoapVar/Param和SSOAP中反复出现的内容
原标题:SoapVar/Param and nested, repeated elements in SOAP
  • 时间:2011-01-31 20:22:09
  •  标签:
  • php
  • soap

我的目标是能够提出可以包含诸如下列内容的肥皂要求:

<flexFields>
  <names>
    <names>IAG Group</names>
    <names>Ticket #</names>
  </names>
</flexFields>

然而,肥皂和肥皂的每一种组合 我早就能够思考一下,这还是使我无法重复被nes的名字。 我可以找到一个这样的子点:

$flexFields = array(
   names => new SoapVar(
      new SoapVar(array( names => IAG Group ),SOAP_ENC_OBJECT),
    SOAP_ENC_OBJECT)
);

这产生了:

<flexFields xsi:type="ns2:SoapNamedValues">
  <names xsi:type="names">
    <names xsi:type="xsd:string">IAG Group</names>
  </names>
</flexFields>

但任何企图 如果我使用SOAP_ENC_OBJECT,或如果我使用SOAP_ENC_ARRAY,就把每个项目列入另一个项目,那么我就不得不重复这些名字。

我知道,我只能人工制造我想要的东西,并装上XSD_ANYXML,但这正接近于利用SOAP图书馆的目的。

人人都能树立一个榜样,说明如何妥善平衡肥皂/肥皂+阵列,以便实际工作? 或者,我是否试图使用PHP sSOAP图书馆?

最佳回答

我也遇到了BOGUS的标签问题。 我的解决办法是使用一种替代阵容的阿雷奥目标。 之后,所有物体均转化成SapVar物体。 图书馆似乎确实希望处理任何地方的物体。 我在此有更完整的文字:

问题回答

我也存在同样的问题:

$Names=array();
$Names[]=new SoapVar("IAG Group",XSD_STRING,null,null, names );
$Names[]=new SoapVar("Ticket #",XSD_STRING,null,null, names );
$BigNames=new SoapVar($Names,SOAP_ENC_OBJECT,null,null, Names );

由此产生了SapVar物体(Names),并将其放置在BigNames的物体上,并产生了类似产出:

<Names>
    <names>IAG Group</names>
    <names>Ticket #</names>  
</Names>

那么,你就可以为灵活田地制造另一个SapVar物体,但出于某种原因,你可以把一个SapVar物体直接放在另一个地方,必须储存在一个阵列......

我想这样做:

$FlexFields=new SoapVar($BigNames,SOAP_ENC_OBJECT,null,null, FlexFields );

这项工作:

$FF=array($BigNames);
$FlexFields=new SoapVar($FF,SOAP_ENC_OBJECT,null,null, FlexFields );




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签