1

我在使用soapclient 呼叫时遇到问题。soaprequest 必须看起来像:

      <eng:Compose>
     <!--Optional:-->
     <EWSComposeRequest>
        <!--Optional:-->
        <driver>
           <!--Optional:-->
           <driver>base64</driver>
           <!--Optional:-->
           <fileName>INPUT</fileName>
        </driver>
         <engineOptions>   
            <name>FILEMAP</name>
            <value>DLFOUT.dlf,dummy.dlf</value>
         </engineOptions>
         <engineOptions>
            <name>FILEMAP</name>
            <value>PDFOUT.pdf,dummy.pdf</value>     
         </engineOptions>
         <engineOptions>
            <name>RUNMODE</name>
        <value>PRODUCTION</value>           
        </engineOptions>
        <!--Optional:-->
        <fileReturnRegEx>^.*.(dlf|pdf)$</fileReturnRegEx>
        <includeHeader>True</includeHeader>
        <includeMessageFile>True</includeMessageFile>
        <!--Optional:-->
        <pubFile>TestLive.pub</pubFile>
     </EWSComposeRequest>
  </eng:Compose>

我的soap_param是:

$soap_param = array("Compose"=> array("EWSComposeRequest" => 
        array( "driver" => array( "driver" => $post_Driver, 
        "fileName" => $post_FileName), 
        "engineOptions" => array( "name" => "KEY", "value" => $INI['encodedkey']),
        "engineOptions" => array( "name" => "RUNMODE", "value" => $INI['runmode']), 
        "fileReturnRegEx" => $post_FileReturnRegEx, "includeHeader" => $post_IncludeHeader,
        "includeMessageFile" => $post_IncludeMessage, "pubFile" => $post_PubFile)));

但是,soapcall 似乎可以工作......我只恢复了最后一个 engineOptions 元素。根据 xsd 元素 engineOptions 可以出现多次(0 到无界)。在肥皂调用中,这个元素似乎被覆盖了。index: engineOptions 不是唯一的。

我无法想象我是唯一面临这个问题的人。我希望这个问题有一个(简单的)解决方案。

4

1 回答 1

0

特别感谢:András Szepesházi。以下$soap_param定义:

$soap_param => array(
    'Compose' => array(
        'EWSComposeRequest' => array(
            'driver' => array( 
                'driver' => $post_Driver, 
                'fileName' => $post_FileName
            ),
            'engineOptions' => array(
                array(
                    'name' => 'KEY', 
                    'value' => $INI['encodedkey']
                ), 
                array(                     
                    'name' => 'RUNMODE', 
                    'value' => $INI['runmode']
                ), 
                array(
                    'name' => 'FILEMAP', 
                    'value' => "DLFOUT.dlf,dummy.dlf"
                ), 
                array(
                    'name' => 'FILEMAP',
                    'value' => "PDFOUT.pdf,dummy.pdf"
                ),
            ),
            'fileReturnRegEx' => $post_fileReturnPattern, 
            'includeHeader' => $post_IncludeHeader, 
            'includeMessageFile' => $post_IncludeMessage, 
            'pubFile' => $post_PubFile
        )
    )
);

能够创建以下 SOAP 请求:

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:hpexstream-services/Engine">
    <SOAP-ENV:Header>
        <ns1:n>n</ns1:n>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <ns1:Compose>
            <EWSComposeRequest>
                <driver>
                    <driver>base64</driver>
                    <fileName>INPUT</fileName>
                </driver>
                <engineOptions>
                    <name>KEY</name>
                    <value>base64</value>
                </engineOptions>
                <engineOptions>
                    <name>RUNMODE</name>
                    <value>PRODUCTION</value>
                </engineOptions>
                <engineOptions>
                    <name>FILEMAP</name>
                    <value>DLFOUT.dlf,dummy.dlf</value>
                </engineOptions>
                <engineOptions>
                    <name>FILEMAP</name>
                    <value>PDFOUT.pdf,dummy.pdf</value>
                </engineOptions>
                <includeHeader>true</includeHeader>
                <includeMessageFile>true</includeMessageFile>
                <pubFile>TestLive.pub</pubFile>
            </EWSComposeRequest>
        </ns1:Compose>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

所以问题解决了。

于 2013-05-07T13:35:41.060 回答