0

如果我使用soap-ui,我可以获取数据,但我需要使用php soapclient,它没有获取数据。

soap-ui 上的输出

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://webservice.bc/Interaction">
   <SOAP-ENV:Body>
      <ns1:QueryInteractionResponse>
         <productWarningArray>
            <ProductWarning>
               <Product>
                  <id>10008</id>
               </Product>
               <Color>
                  <id>4</id>
               </Color>
               <Value>Besinler, asetilsalisilik asitin emilimini yavaşlatır. Hızlı analjezi gerekliyse besinlerle birlikte verilmemelidir. Uzun süreli asetilsalisilik asit kullanımında, besinler, mide mukozasını korumaya yardımcı olur.</Value>
            </ProductWarning>
            <ProductWarning>
               <Product>
                  <id>10008</id>
               </Product>
               <Color>
                  <id>4</id>
               </Color>
               <Value>Besinler, psödoefedrinin emilimini yavaşlatır.</Value>
            </ProductWarning>
            <ProductWarning>
               <Product>
                  <id>2322</id>
               </Product>
               <Color>
                  <id>1</id>
               </Color>
               <Value>Besinler sildenafil absorbsiyonunu geciktirir.</Value>
            </ProductWarning>
         </productWarningArray>
      </ns1:QueryInteractionResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

这是真的……

<Value>Besinler, asetilsalisilik asitin emilimini yavaşlatır. Hızlı analjezi gerekliyse besinlerle birlikte verilmemelidir. Uzun süreli asetilsalisilik asit kullanımında, besinler, mide mukozasını korumaya yardımcı olur.</Value>

但是当我使用 php soapclient

$client = new SoapClient("http://webservice.bc/web.wsdl", array(
                        'exceptions'=>true,
                        'cache_wsdl'=>WSDL_CACHE_NONE,
                        'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 5,
                        'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
                        'encoding'=>' utf-8'
                    //  'features' => SOAP_SINGLE_ELEMENT_ARRAYS

                ));
                $result = $client->QueryInteraction($requestData);
                echo "<pre>";
                print_r($result);

它没有得到价值...

Array
(
    [productWarningArray] => stdClass Object
        (
            [ProductWarning] => Array
                (
                    [0] => stdClass Object
                        (
                            [Product] => stdClass Object
                                (
                                    [id] => 10008
                                )

                            [Color] => stdClass Object
                                (
                                    [id] => 4
                                )

                            [Value] => stdClass Object
                                (
                                )

                        )

                    [1] => stdClass Object
                        (
                            [Product] => stdClass Object
                                (
                                    [id] => 10008
                                )

                            [Color] => stdClass Object
                                (
                                    [id] => 4
                                )

                            [Value] => stdClass Object
                                (
                                )

                        )

                    [2] => stdClass Object
                        (
                            [Product] => stdClass Object
                                (
                                    [id] => 2322
                                )

                            [Color] => stdClass Object
                                (
                                    [id] => 1
                                )

                            [Value] => stdClass Object
                                (
                                )

                        )

                )

        )

)

它的空...

[Value] => stdClass Object
                            (
                            )

我该如何解决这个问题?

谢谢你...

4

1 回答 1

0

解决了 :)

将值元素类型段落更改为字符串时,soap 服务器端解决了问题。

<complexType name="ProductInteraction" >
            <sequence >
                <element name="Product"
                        type="self:Product" />

                <element name="Color"
                        type="self:Color" />

                <element name="Value"
                        type="self:Paragraph" />

            </sequence>
        </complexType>
于 2013-07-25T23:54:47.333 回答