复杂的XML soap Web服务

时间:2013-03-08 07:46:35

标签: php web-services soap

我有这样的XML

<soapenv:Envelope xmlns:soapenv="http://xxx.xxx.com" xmlns:impl="http://xxx.xxx.com/" xmlns:ehr="http://xxx.xxx.com/ehr">
       <soapenv:Header/>
       <soapenv:Body>
          <impl:doClaim>
             <!--Optional:-->
             <claim>
                <!--Optional:-->
                <sourceApp>CLM</sourceApp>
                <patientRole>
                   <ehr:id extension="?"/>
                   <ehr:patient>
                      <ehr:firstName>?</ehr:firstName>
                      <!--Optional:-->
                      <ehr:lastName>?</ehr:lastName>
                      <ehr:prefixName>?</ehr:prefixName>
                      <!--Optional:-->
                      <ehr:gender>?</ehr:gender>
                      <!--Optional:-->
                      <ehr:birthTime>?</ehr:birthTime>
                      <!--Optional:-->
                      <ehr:addr>
                         <ehr:streetAddressLine>?</ehr:streetAddressLine>
                         <ehr:city>?</ehr:city>
                         <ehr:state>?</ehr:state>
                         <ehr:postalCode>?</ehr:postalCode>
                         <ehr:country>?</ehr:country>
                      </ehr:addr>
                   </ehr:patient>
                   <ehr:providerOrganization>
                      <ehr:id extension="?"/>
                      <ehr:name>?</ehr:name>
                   </ehr:providerOrganization>
                </patientRole>                
             </claim>
          </impl:doClaim>
       </soapenv:Body>
    </soapenv:Envelope>

和像这样的PHP代码

$parameter = array(
    //PATIENT ROLE
        //PATIENT
        "firstName" => "JACKIE",
        "lastName"  => "CHAN",
        "prefixName" => "Mr",
        "gender" => "M",
        "birthTime" => "19840711",
            //ADDRESS
            "streetAddressLine" => "HONGKONG",
            "city" => "HONGKONG",
            "state" => "CHINA",
            "postalCode" => "16511",
            "country" => "CHINA",       
        "telecom" => "8816991688",
        //PROVIDER ORGANIZATION
        "name" => "XXX HOSPITAL"            

    );

    $result = $client->__soapCall("doClaim",$parameter);

    print_r($result);

在我调用webService后,它返回Error。我不知道如何追踪。 因为它是我使用Web服务的新体验。 问号是发送参数/数据的地方

有没有人知道解决方案..?

MYSELF解决方案

$parameter = array(
  //CLAIM
  "claim" => array(
    "sourceApp" => "CLAIM",
    //PATIENT ROLE
    "patientRole" => array(
        "id" => array("extension" => "3175025108806666"),
        //PATIENT
        "patient" => array(
            "firstName" => "HENDRO",
            "lastName"  => "AGUS",
            "prefixName" => "Mr",
            "gender" => "M",
            "birthTime" => "19840711",
            //ADDRESS
            "addr" => array(
                "streetAddressLine" => "SAWANGAN",
                "city" => "DEPOK",
                "state" => "WEST JAVA",
                "postalCode" => "16511",
                "country" => "INDONESIA",
            ),
            "telecom" => "087881695916"
        ),
        //PROVIDER ORGANIZATION
        "providerOrganization" => array(
            "id" => array("extension" => "3171023"),
            "name" => "RS PUSAT PERTAMINA"
        )
    )
  )

0 个答案:

没有答案