带有的 SOAP 请求标签

发布于 2024-11-17 02:43:34 字数 30334 浏览 1 评论 0原文

这是我第一次发帖,如果不是很清楚,请原谅我。我还要在序言中说,我对 php 和 Web 服务真的知之甚少。

我遇到的问题是:

SOAP 请求由外部源(客户端)生成,然后发送到我的 php SOAP 服务器。当服务器收到请求时,根本不正确。数据包嗅探器显示,当请求到达运行 php 服务器的计算机时,该请求看起来是正确的。但是,由于某种原因,soap 服务器一收到请求,一切就乱了。

真正奇怪的是,就在一周前,这段代码还运行良好。此后没有进行任何更改。这已经在 3 台不同的机器上进行了尝试,其中一台正在运行不同版本的 php(并且处于不同的状态!)。其中一台机器在一些成功的测试后不久就关闭了,然后在今天出现这个问题后又打开了,结果失败了。

这是客户端发送的请求的示例:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <CoverageRequest xmlns="http://www.iicmva.com/CoverageVerification/">
            <RequestorInformation>
                <Organization>
                    <Name>NVDMV</Name>
                </Organization>
                <ReasonDetails>
                    <ReasonCode>BI</ReasonCode>
                    <TrackingNumber>NVDMV-2011-05-12 10:36:52:286678</TrackingNumber>
                </ReasonDetails>
            </RequestorInformation>
            <Detail>
                <PolicyInformation>
                    <OrganizationDetails>
                        <NAIC>26654</NAIC>
                    </OrganizationDetails>
                    <PolicyDetails>
                        <VerificationDate>2011-05 12T00:00:00</VerificationDate>
                        <UniqueKey>1234567890123456789</UniqueKey>
                        <PolicyState>NV</PolicyState>
                    </PolicyDetails>
                </PolicyInformation>
                <InsuredInformation>
                    <PrimaryNameInformation>
                        <ParsedName>
                            <GivenName>FIRSTNAME</GivenName>
                            <Surname>LASTNAME</Surname>
                        </ParsedName>
                        <Name>LASTNAME,FIRSTNAME</Name>
                        <DriversLicense>NOLICENSE</DriversLicense>
                        <FEIN>FEIN</FEIN>
                    </PrimaryNameInformation>
                    <Address>
                        <StreetAddress>12345</StreetAddress>
                    </Address>
                </InsuredInformation>
                <VehicleInformation>
                    <VehicleDetails>
                        <VIN>VIN1234567</VIN>
                        <Make>MAKE</Make>
                        <Model>MODEL</Model>
                        <Year>2000</Year>
                    </VehicleDetails>
                </VehicleInformation>
            </Detail>
        </CoverageRequest>
    </soap:Body>
</soap:Envelope>

这是 SOAP 服务器获取的示例:

<?xml version="1.0" encoding="UTF-8"?><CoverageRequest><stdClass>
    <Individual>
        <ParsedName>
            <Prefix />
            <GivenName />
            <MiddleName />
            <Surname />
            <Suffix />
        </ParsedName>
    </Individual>
    <Organization>
        <Name />
    </Organization>
    <ReasonDetails>
        <ReasonCode />
        <TrackingNumber />
    </ReasonDetails>
</stdClass></CoverageRequest>

这是 SOAP 服务器的代码:

<?php
    function CoverageRequest($pInput) {
    error_reporting(~E_ALL);

    require_once 'XML/Serializer.php';

    $options = array(
            XML_SERIALIZER_OPTION_INDENT      => '    ',
            XML_SERIALIZER_OPTION_LINEBREAKS  => "\n",
            XML_SERIALIZER_OPTION_DEFAULT_TAG => 'unnamedItem',
            XML_SERIALIZER_OPTION_TYPEHINTS   => false
    );

    $serializer = &new XML_Serializer($options);

    $result = $serializer->serialize($pInput);

    if( $result === true ) {
        $xml = $serializer->getSerializedData();
    }



    // Surround all of the XML in a single tag
    $xml = '<CoverageRequest>' . $xml;
    $xml = $xml . '</CoverageRequest>';



    // Insert the xml header at the beginning
    $xml = '<?xml version="1.0" encoding="UTF-8"?>' . $xml;

    $fp = fopen('SOAPRequest.txt', 'w');
        fwrite($fp, $xml);
        fclose($fp);

    // Send the data to 4D's web service to be processed

        $client = new SoapClient('http://67.214.247.59:8090/4DWSDL/');
        $response = $client->VerifyInsurance($xml);

        $fp = fopen('SOAPResponse.txt', 'w');
        fwrite($fp, $response);
        fclose($fp);

    $xmlvar = new SoapVar($response, XSD_ANYXML);
    return $xmlvar;

    }

    // Clean up the response to match the guidelines
    function callback($buffer) {
    $buffer = str_replace('<ns1:CoverageRequestResponse>', '', $buffer);
    $buffer = str_replace('</ns1:CoverageRequestResponse>', '', $buffer);

    $buffer = str_replace('SOAP-ENV', 'soap', $buffer);

    return $buffer;
    }

    // turn off the wsdl cache
    ini_set('soap.wsdl_cache_enabled', '0');

    $server = new SoapServer(null, array('uri' => 'http://67.214.247.59/phpserver/verifyinsurance.wsdl'));

    $server->addFunction('CoverageRequest');

    ob_start('callback');

    $server->handle();
    ob_end_flush();

?>

这是 wsdl:

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.iicmva.com/CoverageVerification/"
targetNamespace="http://www.iicmva.com/CoverageVerification/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"

xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>

  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://www.iicmva.com/CoverageVerification/">
      <s:element name="CoverageRequest">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="RequestorInformation" type="tns:RequestorInformationModule" />
            <s:element minOccurs="0" maxOccurs="1" name="Detail" type="tns:CoverageRequestDetail" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:complexType name="RequestorInformationModule">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="Individual" type="tns:IndividualBlock2" />
          <s:element minOccurs="0" maxOccurs="1" name="Organization" type="tns:OrganizationBlock3" />
          <s:element minOccurs="0" maxOccurs="1" name="ReasonDetails" type="tns:DocumentDetailBlock2" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="IndividualBlock2">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="ParsedName" type="tns:IndividualNameComponent2" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="IndividualNameComponent2">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="Prefix" type="tns:NameText2" />
          <s:element minOccurs="0" maxOccurs="1" name="GivenName" type="tns:NameText4" />
          <s:element minOccurs="0" maxOccurs="1" name="MiddleName" type="tns:NameText5" />
          <s:element minOccurs="0" maxOccurs="unbounded" name="Surname" type="tns:NameText6" />
          <s:element minOccurs="0" maxOccurs="1" name="Suffix" type="tns:NameText2" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="NameText2">
        <s:simpleContent>
          <s:extension base="s:string" />
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="NameText4">
        <s:simpleContent>
          <s:extension base="s:string" />
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="NameText5">
        <s:simpleContent>
          <s:extension base="s:string" />
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="NameText6">
        <s:simpleContent>
          <s:extension base="s:string" />
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="OrganizationBlock3">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="Name" type="tns:NameText1" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="NameText1">
        <s:simpleContent>
          <s:extension base="s:string" />
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="DocumentDetailBlock2">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="ReasonCode" type="tns:ReasonCode1" />
          <s:element minOccurs="0" maxOccurs="1" name="TrackingNumber" type="tns:ResourceIdentifier12" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="ReasonCode1">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="ListAgencyIdentifier" type="s:string" />
            <s:attribute name="ListAgencyNameText" type="s:string" />
            <s:attribute name="ListNameText" type="s:string" />
            <s:attribute name="ListIdentifier" type="s:string" />
            <s:attribute name="ListSchemeURI" type="s:string" />
            <s:attribute name="ListURI" type="s:string" />
            <s:attribute name="ListVersionIdentifier" type="s:string" />
            <s:attribute name="NameText" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="ResourceIdentifier12">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="IdSchemeAgencyIdentifier" type="s:string" />
            <s:attribute name="IdSchemeAgencyNameText" type="s:string" />
            <s:attribute name="IdSchemeIdentifier" type="s:string" />
            <s:attribute name="IdSchemeNameText" type="s:string" />
            <s:attribute name="IdSchemeURI" type="s:string" />
            <s:attribute name="IdSchemeVersionIdentifier" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="CoverageRequestDetail">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="PolicyInformation" type="tns:CoveragePolicyRequestModule" />
          <s:element minOccurs="0" maxOccurs="1" name="InsuredInformation" type="tns:InsuredModule" />
          <s:element minOccurs="0" maxOccurs="1" name="VehicleInformation" type="tns:RiskInformationModule" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="CoveragePolicyRequestModule">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="OrganizationDetails" type="tns:OrganizationBlock4" />
          <s:element minOccurs="0" maxOccurs="1" name="PolicyDetails" type="tns:DocumentDetailBlock3" />
          <s:element minOccurs="0" maxOccurs="1" name="BodilyInjuryCoverage" type="tns:AmountBlock1" />
          <s:element minOccurs="0" maxOccurs="1" name="PropertyDamageCoverage" type="tns:AmountBlock1" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="OrganizationBlock4">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="NAIC" type="tns:PartyIdentifier18" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="PartyIdentifier18">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="IdSchemeAgencyIdentifier" type="s:string" />
            <s:attribute name="IdSchemeAgencyNameText" type="s:string" />
            <s:attribute name="IdSchemeIdentifier" type="s:string" />
            <s:attribute name="IdSchemeNameText" type="s:string" />
            <s:attribute name="IdSchemeURI" type="s:string" />
            <s:attribute name="IdSchemeVersionIdentifier" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="DocumentDetailBlock3">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="VerificationDate" type="tns:DateTime1" />
          <s:element minOccurs="0" maxOccurs="1" name="UniqueKey" type="tns:ResourceIdentifier12" />
          <s:element minOccurs="0" maxOccurs="1" name="PolicyState" type="tns:ResourceIdentifier14" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="DateTime1">
        <s:simpleContent>
          <s:extension base="s:dateTime">
            <s:attribute name="FormatText" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="ResourceIdentifier14">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="IdSchemeAgencyIdentifier" type="s:string" />
            <s:attribute name="IdSchemeAgencyNameText" type="s:string" />
            <s:attribute name="IdSchemeIdentifier" type="s:string" />
            <s:attribute name="IdSchemeNameText" type="s:string" />
            <s:attribute name="IdSchemeURI" type="s:string" />
            <s:attribute name="IdSchemeVersionIdentifier" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="AmountBlock1">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="TypeofLimit" type="tns:ResourceCode9" />
          <s:element minOccurs="0" maxOccurs="1" name="CoverageAmount" type="tns:Amount1" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="ResourceCode9">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="ListAgencyIdentifier" type="s:string" />
            <s:attribute name="ListAgencyNameText" type="s:string" />
            <s:attribute name="ListNameText" type="s:string" />
            <s:attribute name="ListIdentifier" type="s:string" />
            <s:attribute name="ListSchemeURI" type="s:string" />
            <s:attribute name="ListURI" type="s:string" />
            <s:attribute name="ListVersionIdentifier" type="s:string" />
            <s:attribute name="NameText" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="Amount1">
        <s:simpleContent>
          <s:extension base="s:decimal">
            <s:attribute name="currencyidentifier" type="s:string" />
            <s:attribute name="CurrencyCodeListVersionIdentifier" type="s:string" />
            <s:attribute name="CurrencyCodeList" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="InsuredModule">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="PrimaryNameInformation" type="tns:IndividualBlock3" />
          <s:element minOccurs="0" maxOccurs="unbounded" name="AdditionalNamesInformation" type="tns:IndividualBlock3" />
          <s:element minOccurs="0" maxOccurs="1" name="Address" type="tns:AddresslBlock1" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="IndividualBlock3">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="ParsedName" type="tns:IndividualNameComponent2" />
          <s:element minOccurs="0" maxOccurs="1" name="Name" type="tns:NameText1" />
          <s:element minOccurs="0" maxOccurs="1" name="SocialSecurityNumber" type="tns:PartyIdentifier9" />
          <s:element minOccurs="0" maxOccurs="1" name="DriversLicense" type="tns:PartyIdentifier8" />
          <s:element minOccurs="0" maxOccurs="1" name="FEIN" type="tns:PartyIdentifier8" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="PartyIdentifier9">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="IdSchemeAgencyIdentifier" type="s:string" />
            <s:attribute name="IdSchemeAgencyNameText" type="s:string" />
            <s:attribute name="IdSchemeIdentifier" type="s:string" />
            <s:attribute name="IdSchemeNameText" type="s:string" />
            <s:attribute name="IdSchemeURI" type="s:string" />
            <s:attribute name="IdSchemeVersionIdentifier" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="PartyIdentifier8">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="IdSchemeAgencyIdentifier" type="s:string" />
            <s:attribute name="IdSchemeAgencyNameText" type="s:string" />
            <s:attribute name="IdSchemeIdentifier" type="s:string" />
            <s:attribute name="IdSchemeNameText" type="s:string" />
            <s:attribute name="IdSchemeURI" type="s:string" />
            <s:attribute name="IdSchemeVersionIdentifier" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="AddresslBlock1">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="unbounded" name="StreetAddress" type="tns:LocationText9" />
          <s:element minOccurs="0" maxOccurs="1" name="SubsiteAddress" type="tns:SubsiteAddressComponent1" />
          <s:element minOccurs="0" maxOccurs="1" name="City" type="tns:LocationText1" />
          <s:element minOccurs="0" maxOccurs="1" name="CountrySubdivision" type="tns:LocationCode2" />
          <s:element minOccurs="0" maxOccurs="1" name="PostalCode" type="tns:LocationIdentifier1" />
          <s:element minOccurs="0" maxOccurs="1" name="Country" type="tns:LocationCode3" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="LocationText9">
        <s:simpleContent>
          <s:extension base="s:string" />
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="SubsiteAddressComponent1">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="Apartment" type="tns:LocationText2" />
          <s:element minOccurs="0" maxOccurs="1" name="Building" type="tns:LocationText7" />
          <s:element minOccurs="0" maxOccurs="1" name="Department" type="tns:LocationText7" />
          <s:element minOccurs="0" maxOccurs="1" name="Floor" type="tns:LocationText2" />
          <s:element minOccurs="0" maxOccurs="1" name="Room" type="tns:LocationText2" />
          <s:element minOccurs="0" maxOccurs="1" name="Suite" type="tns:LocationText2" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="LocationText2">
        <s:simpleContent>
          <s:extension base="s:string" />
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="LocationText7">
        <s:simpleContent>
          <s:extension base="s:string" />
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="LocationText1">
        <s:simpleContent>
          <s:extension base="s:string" />
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="LocationCode2">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="ListAgencyIdentifier" type="s:string" />
            <s:attribute name="ListAgencyNameText" type="s:string" />
            <s:attribute name="ListNameText" type="s:string" />
            <s:attribute name="ListIdentifier" type="s:string" />
            <s:attribute name="ListSchemeURI" type="s:string" />
            <s:attribute name="ListURI" type="s:string" />
            <s:attribute name="ListVersionIdentifier" type="s:string" />
            <s:attribute name="NameText" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="LocationIdentifier1">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="IdSchemeAgencyIdentifier" type="s:string" />
            <s:attribute name="IdSchemeAgencyNameText" type="s:string" />
            <s:attribute name="IdSchemeIdentifier" type="s:string" />
            <s:attribute name="IdSchemeNameText" type="s:string" />
            <s:attribute name="IdSchemeURI" type="s:string" />
            <s:attribute name="IdSchemeVersionIdentifier" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="LocationCode3">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="ListAgencyIdentifier" type="s:string" />
            <s:attribute name="ListAgencyNameText" type="s:string" />
            <s:attribute name="ListNameText" type="s:string" />
            <s:attribute name="ListIdentifier" type="s:string" />
            <s:attribute name="ListSchemeURI" type="s:string" />
            <s:attribute name="ListURI" type="s:string" />
            <s:attribute name="ListVersionIdentifier" type="s:string" />
            <s:attribute name="NameText" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="RiskInformationModule">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="VehicleDetails" type="tns:ResourceIdentificationBlock1" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="ResourceIdentificationBlock1">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="VIN" type="tns:ResourceIdentifier11" />
          <s:element minOccurs="0" maxOccurs="1" name="Make" type="tns:ResourceIdentifier12" />
          <s:element minOccurs="0" maxOccurs="1" name="Model" type="tns:ResourceIdentifier12" />
          <s:element minOccurs="0" maxOccurs="1" name="Year" type="tns:DateTimeText2" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="ResourceIdentifier11">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="IdSchemeAgencyIdentifier" type="s:string" />
            <s:attribute name="IdSchemeAgencyNameText" type="s:string" />
            <s:attribute name="IdSchemeIdentifier" type="s:string" />
            <s:attribute name="IdSchemeNameText" type="s:string" />
            <s:attribute name="IdSchemeURI" type="s:string" />
            <s:attribute name="IdSchemeVersionIdentifier" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="DateTimeText2">
        <s:simpleContent>
          <s:extension base="s:string" />
        </s:simpleContent>
      </s:complexType>
      <s:element name="CoverageResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="unbounded" name="Detail" type="tns:CoverageResponseDetail" />
            <s:element minOccurs="0" maxOccurs="1" name="RequestorInformation" type="tns:RequestorInformationModule" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:complexType name="CoverageResponseDetail">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="PolicyInformation" type="tns:CoveragePolicyResponseModule" />
          <s:element minOccurs="0" maxOccurs="1" name="InsuredInformation" type="tns:InsuredModule" />
          <s:element minOccurs="0" maxOccurs="1" name="VehicleInformation" type="tns:RiskInformationModule" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="CoveragePolicyResponseModule">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="CoverageStatus" type="tns:StatusInformationBlock4" />
          <s:element minOccurs="0" maxOccurs="1" name="OrganizationDetails" type="tns:OrganizationBlock4" />
          <s:element minOccurs="0" maxOccurs="1" name="PolicyDetails" type="tns:DocumentDetailBlock3" />
          <s:element minOccurs="0" maxOccurs="1" name="BodilyInjuryCoverage" type="tns:AmountBlock1" />
          <s:element minOccurs="0" maxOccurs="1" name="PropertyDamageCoverage" type="tns:AmountBlock1" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="StatusInformationBlock4">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="ResponseDetails" type="tns:ParsedStatusComponent3" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="ParsedStatusComponent3">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="ResponseCode" type="tns:EventCode7" />
          <s:element minOccurs="0" maxOccurs="unbounded" name="UnconfirmedReasonCode" type="tns:EventCode8" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="EventCode7">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="ListAgencyIdentifier" type="s:string" />
            <s:attribute name="ListAgencyNameText" type="s:string" />
            <s:attribute name="ListNameText" type="s:string" />
            <s:attribute name="ListIdentifier" type="s:string" />
            <s:attribute name="ListSchemeURI" type="s:string" />
            <s:attribute name="ListURI" type="s:string" />
            <s:attribute name="ListVersionIdentifier" type="s:string" />
            <s:attribute name="NameText" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="EventCode8">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="ListAgencyIdentifier" type="s:string" />
            <s:attribute name="ListAgencyNameText" type="s:string" />
            <s:attribute name="ListNameText" type="s:string" />
            <s:attribute name="ListIdentifier" type="s:string" />
            <s:attribute name="ListSchemeURI" type="s:string" />
            <s:attribute name="ListURI" type="s:string" />
            <s:attribute name="ListVersionIdentifier" type="s:string" />
            <s:attribute name="NameText" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
    </s:schema>
  </wsdl:types>

  <wsdl:message name="VerifyInsuranceSoapIn">
    <wsdl:part name="parameters" element="tns:CoverageRequest" />
  </wsdl:message>
  <wsdl:message name="VerifyInsuranceSoapOut">
    <wsdl:part name="parameters" element="tns:CoverageResponse" />
  </wsdl:message>
  <wsdl:portType name="VerifyServiceSoap">
    <wsdl:operation name="CoverageRequest">
      <wsdl:input message="tns:VerifyInsuranceSoapIn" />
      <wsdl:output message="tns:VerifyInsuranceSoapOut" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="VerifyServiceSoap" type="tns:VerifyServiceSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    <wsdl:operation name="CoverageRequest">
      <soap:operation soapAction="urn:gnwSoap#CoverageRequest" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="gnwSoap">
    <documentation xmlns="http://schemas.xmlsoap.org/wsdl/" />
    <wsdl:port name="VerifyServiceSoap" binding="tns:VerifyServiceSoap">
      <soap:address location="http://67.214.247.59/phpserver/server.php" />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

谁能告诉我为什么响应缺少 CoverageRequest 部分和为什么它突然被 stdClass 标签包裹?

谢谢你!

This is my first time posting, so forgive me if I'm not very clear. I will also preface this by saying that I really know very little about php and web services.

The issue I'm having is this:

A SOAP request is generated by an outside source (a client) and is then sent to my php SOAP server. When the server receives the request, it is not correct at all. A packet sniffer reveals that the request looks correct when it reaches the machine the php server is running on. But, for some reason, as soon as the soap server gets the request, it is all messed up.

What is really odd is that only a week ago this code worked fine. No changes have been made since then. This has been tried on 3 different machines, one of which is running a different version of php (and is in a different state!). One of the machines was turned off shortly after some successful testing, and then turned on today after this issue came up only to fail.

Here is a sample of the request sent by the client:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <CoverageRequest xmlns="http://www.iicmva.com/CoverageVerification/">
            <RequestorInformation>
                <Organization>
                    <Name>NVDMV</Name>
                </Organization>
                <ReasonDetails>
                    <ReasonCode>BI</ReasonCode>
                    <TrackingNumber>NVDMV-2011-05-12 10:36:52:286678</TrackingNumber>
                </ReasonDetails>
            </RequestorInformation>
            <Detail>
                <PolicyInformation>
                    <OrganizationDetails>
                        <NAIC>26654</NAIC>
                    </OrganizationDetails>
                    <PolicyDetails>
                        <VerificationDate>2011-05 12T00:00:00</VerificationDate>
                        <UniqueKey>1234567890123456789</UniqueKey>
                        <PolicyState>NV</PolicyState>
                    </PolicyDetails>
                </PolicyInformation>
                <InsuredInformation>
                    <PrimaryNameInformation>
                        <ParsedName>
                            <GivenName>FIRSTNAME</GivenName>
                            <Surname>LASTNAME</Surname>
                        </ParsedName>
                        <Name>LASTNAME,FIRSTNAME</Name>
                        <DriversLicense>NOLICENSE</DriversLicense>
                        <FEIN>FEIN</FEIN>
                    </PrimaryNameInformation>
                    <Address>
                        <StreetAddress>12345</StreetAddress>
                    </Address>
                </InsuredInformation>
                <VehicleInformation>
                    <VehicleDetails>
                        <VIN>VIN1234567</VIN>
                        <Make>MAKE</Make>
                        <Model>MODEL</Model>
                        <Year>2000</Year>
                    </VehicleDetails>
                </VehicleInformation>
            </Detail>
        </CoverageRequest>
    </soap:Body>
</soap:Envelope>

Here is a sample of what the soap server gets:

<?xml version="1.0" encoding="UTF-8"?><CoverageRequest><stdClass>
    <Individual>
        <ParsedName>
            <Prefix />
            <GivenName />
            <MiddleName />
            <Surname />
            <Suffix />
        </ParsedName>
    </Individual>
    <Organization>
        <Name />
    </Organization>
    <ReasonDetails>
        <ReasonCode />
        <TrackingNumber />
    </ReasonDetails>
</stdClass></CoverageRequest>

Here is the code for the soap server:

<?php
    function CoverageRequest($pInput) {
    error_reporting(~E_ALL);

    require_once 'XML/Serializer.php';

    $options = array(
            XML_SERIALIZER_OPTION_INDENT      => '    ',
            XML_SERIALIZER_OPTION_LINEBREAKS  => "\n",
            XML_SERIALIZER_OPTION_DEFAULT_TAG => 'unnamedItem',
            XML_SERIALIZER_OPTION_TYPEHINTS   => false
    );

    $serializer = &new XML_Serializer($options);

    $result = $serializer->serialize($pInput);

    if( $result === true ) {
        $xml = $serializer->getSerializedData();
    }



    // Surround all of the XML in a single tag
    $xml = '<CoverageRequest>' . $xml;
    $xml = $xml . '</CoverageRequest>';



    // Insert the xml header at the beginning
    $xml = '<?xml version="1.0" encoding="UTF-8"?>' . $xml;

    $fp = fopen('SOAPRequest.txt', 'w');
        fwrite($fp, $xml);
        fclose($fp);

    // Send the data to 4D's web service to be processed

        $client = new SoapClient('http://67.214.247.59:8090/4DWSDL/');
        $response = $client->VerifyInsurance($xml);

        $fp = fopen('SOAPResponse.txt', 'w');
        fwrite($fp, $response);
        fclose($fp);

    $xmlvar = new SoapVar($response, XSD_ANYXML);
    return $xmlvar;

    }

    // Clean up the response to match the guidelines
    function callback($buffer) {
    $buffer = str_replace('<ns1:CoverageRequestResponse>', '', $buffer);
    $buffer = str_replace('</ns1:CoverageRequestResponse>', '', $buffer);

    $buffer = str_replace('SOAP-ENV', 'soap', $buffer);

    return $buffer;
    }

    // turn off the wsdl cache
    ini_set('soap.wsdl_cache_enabled', '0');

    $server = new SoapServer(null, array('uri' => 'http://67.214.247.59/phpserver/verifyinsurance.wsdl'));

    $server->addFunction('CoverageRequest');

    ob_start('callback');

    $server->handle();
    ob_end_flush();

?>

Here is the wsdl:

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.iicmva.com/CoverageVerification/"
targetNamespace="http://www.iicmva.com/CoverageVerification/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"

xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>

  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://www.iicmva.com/CoverageVerification/">
      <s:element name="CoverageRequest">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="RequestorInformation" type="tns:RequestorInformationModule" />
            <s:element minOccurs="0" maxOccurs="1" name="Detail" type="tns:CoverageRequestDetail" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:complexType name="RequestorInformationModule">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="Individual" type="tns:IndividualBlock2" />
          <s:element minOccurs="0" maxOccurs="1" name="Organization" type="tns:OrganizationBlock3" />
          <s:element minOccurs="0" maxOccurs="1" name="ReasonDetails" type="tns:DocumentDetailBlock2" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="IndividualBlock2">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="ParsedName" type="tns:IndividualNameComponent2" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="IndividualNameComponent2">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="Prefix" type="tns:NameText2" />
          <s:element minOccurs="0" maxOccurs="1" name="GivenName" type="tns:NameText4" />
          <s:element minOccurs="0" maxOccurs="1" name="MiddleName" type="tns:NameText5" />
          <s:element minOccurs="0" maxOccurs="unbounded" name="Surname" type="tns:NameText6" />
          <s:element minOccurs="0" maxOccurs="1" name="Suffix" type="tns:NameText2" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="NameText2">
        <s:simpleContent>
          <s:extension base="s:string" />
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="NameText4">
        <s:simpleContent>
          <s:extension base="s:string" />
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="NameText5">
        <s:simpleContent>
          <s:extension base="s:string" />
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="NameText6">
        <s:simpleContent>
          <s:extension base="s:string" />
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="OrganizationBlock3">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="Name" type="tns:NameText1" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="NameText1">
        <s:simpleContent>
          <s:extension base="s:string" />
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="DocumentDetailBlock2">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="ReasonCode" type="tns:ReasonCode1" />
          <s:element minOccurs="0" maxOccurs="1" name="TrackingNumber" type="tns:ResourceIdentifier12" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="ReasonCode1">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="ListAgencyIdentifier" type="s:string" />
            <s:attribute name="ListAgencyNameText" type="s:string" />
            <s:attribute name="ListNameText" type="s:string" />
            <s:attribute name="ListIdentifier" type="s:string" />
            <s:attribute name="ListSchemeURI" type="s:string" />
            <s:attribute name="ListURI" type="s:string" />
            <s:attribute name="ListVersionIdentifier" type="s:string" />
            <s:attribute name="NameText" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="ResourceIdentifier12">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="IdSchemeAgencyIdentifier" type="s:string" />
            <s:attribute name="IdSchemeAgencyNameText" type="s:string" />
            <s:attribute name="IdSchemeIdentifier" type="s:string" />
            <s:attribute name="IdSchemeNameText" type="s:string" />
            <s:attribute name="IdSchemeURI" type="s:string" />
            <s:attribute name="IdSchemeVersionIdentifier" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="CoverageRequestDetail">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="PolicyInformation" type="tns:CoveragePolicyRequestModule" />
          <s:element minOccurs="0" maxOccurs="1" name="InsuredInformation" type="tns:InsuredModule" />
          <s:element minOccurs="0" maxOccurs="1" name="VehicleInformation" type="tns:RiskInformationModule" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="CoveragePolicyRequestModule">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="OrganizationDetails" type="tns:OrganizationBlock4" />
          <s:element minOccurs="0" maxOccurs="1" name="PolicyDetails" type="tns:DocumentDetailBlock3" />
          <s:element minOccurs="0" maxOccurs="1" name="BodilyInjuryCoverage" type="tns:AmountBlock1" />
          <s:element minOccurs="0" maxOccurs="1" name="PropertyDamageCoverage" type="tns:AmountBlock1" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="OrganizationBlock4">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="NAIC" type="tns:PartyIdentifier18" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="PartyIdentifier18">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="IdSchemeAgencyIdentifier" type="s:string" />
            <s:attribute name="IdSchemeAgencyNameText" type="s:string" />
            <s:attribute name="IdSchemeIdentifier" type="s:string" />
            <s:attribute name="IdSchemeNameText" type="s:string" />
            <s:attribute name="IdSchemeURI" type="s:string" />
            <s:attribute name="IdSchemeVersionIdentifier" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="DocumentDetailBlock3">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="VerificationDate" type="tns:DateTime1" />
          <s:element minOccurs="0" maxOccurs="1" name="UniqueKey" type="tns:ResourceIdentifier12" />
          <s:element minOccurs="0" maxOccurs="1" name="PolicyState" type="tns:ResourceIdentifier14" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="DateTime1">
        <s:simpleContent>
          <s:extension base="s:dateTime">
            <s:attribute name="FormatText" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="ResourceIdentifier14">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="IdSchemeAgencyIdentifier" type="s:string" />
            <s:attribute name="IdSchemeAgencyNameText" type="s:string" />
            <s:attribute name="IdSchemeIdentifier" type="s:string" />
            <s:attribute name="IdSchemeNameText" type="s:string" />
            <s:attribute name="IdSchemeURI" type="s:string" />
            <s:attribute name="IdSchemeVersionIdentifier" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="AmountBlock1">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="TypeofLimit" type="tns:ResourceCode9" />
          <s:element minOccurs="0" maxOccurs="1" name="CoverageAmount" type="tns:Amount1" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="ResourceCode9">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="ListAgencyIdentifier" type="s:string" />
            <s:attribute name="ListAgencyNameText" type="s:string" />
            <s:attribute name="ListNameText" type="s:string" />
            <s:attribute name="ListIdentifier" type="s:string" />
            <s:attribute name="ListSchemeURI" type="s:string" />
            <s:attribute name="ListURI" type="s:string" />
            <s:attribute name="ListVersionIdentifier" type="s:string" />
            <s:attribute name="NameText" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="Amount1">
        <s:simpleContent>
          <s:extension base="s:decimal">
            <s:attribute name="currencyidentifier" type="s:string" />
            <s:attribute name="CurrencyCodeListVersionIdentifier" type="s:string" />
            <s:attribute name="CurrencyCodeList" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="InsuredModule">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="PrimaryNameInformation" type="tns:IndividualBlock3" />
          <s:element minOccurs="0" maxOccurs="unbounded" name="AdditionalNamesInformation" type="tns:IndividualBlock3" />
          <s:element minOccurs="0" maxOccurs="1" name="Address" type="tns:AddresslBlock1" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="IndividualBlock3">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="ParsedName" type="tns:IndividualNameComponent2" />
          <s:element minOccurs="0" maxOccurs="1" name="Name" type="tns:NameText1" />
          <s:element minOccurs="0" maxOccurs="1" name="SocialSecurityNumber" type="tns:PartyIdentifier9" />
          <s:element minOccurs="0" maxOccurs="1" name="DriversLicense" type="tns:PartyIdentifier8" />
          <s:element minOccurs="0" maxOccurs="1" name="FEIN" type="tns:PartyIdentifier8" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="PartyIdentifier9">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="IdSchemeAgencyIdentifier" type="s:string" />
            <s:attribute name="IdSchemeAgencyNameText" type="s:string" />
            <s:attribute name="IdSchemeIdentifier" type="s:string" />
            <s:attribute name="IdSchemeNameText" type="s:string" />
            <s:attribute name="IdSchemeURI" type="s:string" />
            <s:attribute name="IdSchemeVersionIdentifier" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="PartyIdentifier8">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="IdSchemeAgencyIdentifier" type="s:string" />
            <s:attribute name="IdSchemeAgencyNameText" type="s:string" />
            <s:attribute name="IdSchemeIdentifier" type="s:string" />
            <s:attribute name="IdSchemeNameText" type="s:string" />
            <s:attribute name="IdSchemeURI" type="s:string" />
            <s:attribute name="IdSchemeVersionIdentifier" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="AddresslBlock1">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="unbounded" name="StreetAddress" type="tns:LocationText9" />
          <s:element minOccurs="0" maxOccurs="1" name="SubsiteAddress" type="tns:SubsiteAddressComponent1" />
          <s:element minOccurs="0" maxOccurs="1" name="City" type="tns:LocationText1" />
          <s:element minOccurs="0" maxOccurs="1" name="CountrySubdivision" type="tns:LocationCode2" />
          <s:element minOccurs="0" maxOccurs="1" name="PostalCode" type="tns:LocationIdentifier1" />
          <s:element minOccurs="0" maxOccurs="1" name="Country" type="tns:LocationCode3" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="LocationText9">
        <s:simpleContent>
          <s:extension base="s:string" />
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="SubsiteAddressComponent1">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="Apartment" type="tns:LocationText2" />
          <s:element minOccurs="0" maxOccurs="1" name="Building" type="tns:LocationText7" />
          <s:element minOccurs="0" maxOccurs="1" name="Department" type="tns:LocationText7" />
          <s:element minOccurs="0" maxOccurs="1" name="Floor" type="tns:LocationText2" />
          <s:element minOccurs="0" maxOccurs="1" name="Room" type="tns:LocationText2" />
          <s:element minOccurs="0" maxOccurs="1" name="Suite" type="tns:LocationText2" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="LocationText2">
        <s:simpleContent>
          <s:extension base="s:string" />
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="LocationText7">
        <s:simpleContent>
          <s:extension base="s:string" />
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="LocationText1">
        <s:simpleContent>
          <s:extension base="s:string" />
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="LocationCode2">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="ListAgencyIdentifier" type="s:string" />
            <s:attribute name="ListAgencyNameText" type="s:string" />
            <s:attribute name="ListNameText" type="s:string" />
            <s:attribute name="ListIdentifier" type="s:string" />
            <s:attribute name="ListSchemeURI" type="s:string" />
            <s:attribute name="ListURI" type="s:string" />
            <s:attribute name="ListVersionIdentifier" type="s:string" />
            <s:attribute name="NameText" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="LocationIdentifier1">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="IdSchemeAgencyIdentifier" type="s:string" />
            <s:attribute name="IdSchemeAgencyNameText" type="s:string" />
            <s:attribute name="IdSchemeIdentifier" type="s:string" />
            <s:attribute name="IdSchemeNameText" type="s:string" />
            <s:attribute name="IdSchemeURI" type="s:string" />
            <s:attribute name="IdSchemeVersionIdentifier" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="LocationCode3">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="ListAgencyIdentifier" type="s:string" />
            <s:attribute name="ListAgencyNameText" type="s:string" />
            <s:attribute name="ListNameText" type="s:string" />
            <s:attribute name="ListIdentifier" type="s:string" />
            <s:attribute name="ListSchemeURI" type="s:string" />
            <s:attribute name="ListURI" type="s:string" />
            <s:attribute name="ListVersionIdentifier" type="s:string" />
            <s:attribute name="NameText" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="RiskInformationModule">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="VehicleDetails" type="tns:ResourceIdentificationBlock1" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="ResourceIdentificationBlock1">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="VIN" type="tns:ResourceIdentifier11" />
          <s:element minOccurs="0" maxOccurs="1" name="Make" type="tns:ResourceIdentifier12" />
          <s:element minOccurs="0" maxOccurs="1" name="Model" type="tns:ResourceIdentifier12" />
          <s:element minOccurs="0" maxOccurs="1" name="Year" type="tns:DateTimeText2" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="ResourceIdentifier11">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="IdSchemeAgencyIdentifier" type="s:string" />
            <s:attribute name="IdSchemeAgencyNameText" type="s:string" />
            <s:attribute name="IdSchemeIdentifier" type="s:string" />
            <s:attribute name="IdSchemeNameText" type="s:string" />
            <s:attribute name="IdSchemeURI" type="s:string" />
            <s:attribute name="IdSchemeVersionIdentifier" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="DateTimeText2">
        <s:simpleContent>
          <s:extension base="s:string" />
        </s:simpleContent>
      </s:complexType>
      <s:element name="CoverageResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="unbounded" name="Detail" type="tns:CoverageResponseDetail" />
            <s:element minOccurs="0" maxOccurs="1" name="RequestorInformation" type="tns:RequestorInformationModule" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:complexType name="CoverageResponseDetail">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="PolicyInformation" type="tns:CoveragePolicyResponseModule" />
          <s:element minOccurs="0" maxOccurs="1" name="InsuredInformation" type="tns:InsuredModule" />
          <s:element minOccurs="0" maxOccurs="1" name="VehicleInformation" type="tns:RiskInformationModule" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="CoveragePolicyResponseModule">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="CoverageStatus" type="tns:StatusInformationBlock4" />
          <s:element minOccurs="0" maxOccurs="1" name="OrganizationDetails" type="tns:OrganizationBlock4" />
          <s:element minOccurs="0" maxOccurs="1" name="PolicyDetails" type="tns:DocumentDetailBlock3" />
          <s:element minOccurs="0" maxOccurs="1" name="BodilyInjuryCoverage" type="tns:AmountBlock1" />
          <s:element minOccurs="0" maxOccurs="1" name="PropertyDamageCoverage" type="tns:AmountBlock1" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="StatusInformationBlock4">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="ResponseDetails" type="tns:ParsedStatusComponent3" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="ParsedStatusComponent3">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="ResponseCode" type="tns:EventCode7" />
          <s:element minOccurs="0" maxOccurs="unbounded" name="UnconfirmedReasonCode" type="tns:EventCode8" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="EventCode7">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="ListAgencyIdentifier" type="s:string" />
            <s:attribute name="ListAgencyNameText" type="s:string" />
            <s:attribute name="ListNameText" type="s:string" />
            <s:attribute name="ListIdentifier" type="s:string" />
            <s:attribute name="ListSchemeURI" type="s:string" />
            <s:attribute name="ListURI" type="s:string" />
            <s:attribute name="ListVersionIdentifier" type="s:string" />
            <s:attribute name="NameText" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
      <s:complexType name="EventCode8">
        <s:simpleContent>
          <s:extension base="s:token">
            <s:attribute name="ListAgencyIdentifier" type="s:string" />
            <s:attribute name="ListAgencyNameText" type="s:string" />
            <s:attribute name="ListNameText" type="s:string" />
            <s:attribute name="ListIdentifier" type="s:string" />
            <s:attribute name="ListSchemeURI" type="s:string" />
            <s:attribute name="ListURI" type="s:string" />
            <s:attribute name="ListVersionIdentifier" type="s:string" />
            <s:attribute name="NameText" type="s:string" />
          </s:extension>
        </s:simpleContent>
      </s:complexType>
    </s:schema>
  </wsdl:types>

  <wsdl:message name="VerifyInsuranceSoapIn">
    <wsdl:part name="parameters" element="tns:CoverageRequest" />
  </wsdl:message>
  <wsdl:message name="VerifyInsuranceSoapOut">
    <wsdl:part name="parameters" element="tns:CoverageResponse" />
  </wsdl:message>
  <wsdl:portType name="VerifyServiceSoap">
    <wsdl:operation name="CoverageRequest">
      <wsdl:input message="tns:VerifyInsuranceSoapIn" />
      <wsdl:output message="tns:VerifyInsuranceSoapOut" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="VerifyServiceSoap" type="tns:VerifyServiceSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    <wsdl:operation name="CoverageRequest">
      <soap:operation soapAction="urn:gnwSoap#CoverageRequest" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="gnwSoap">
    <documentation xmlns="http://schemas.xmlsoap.org/wsdl/" />
    <wsdl:port name="VerifyServiceSoap" binding="tns:VerifyServiceSoap">
      <soap:address location="http://67.214.247.59/phpserver/server.php" />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

Can anyone tell me why the response is missing the CoverageRequest section and why it is suddenly wrapped in stdClass tags?

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

假扮的天使 2024-11-24 02:43:34

我无法告诉你有关响应的信息,但我可以解释 stdClass。

stdClass 类型的对象是一个简单的包装器。当你在战场上将数组转换为对象时,你会得到一个 stdClass 类型的类,例如:

(object)array('keyname' => 'value')

如果你执行了 var_dump() ,你会得到:

object(stdClass)#1 (1) {
  ["keyname"]=>
  string(5) "value"
}

每种语言中的所有对象都继承自某个基础对象。我猜在 PHP 中,它是 stdClass。

(如果你喜欢这个答案,请投票给我。)

达斯汀

I can't tel lyou abotu the response, but I can explain stdClass.

An object of type stdClass is a simple wrapper. You get a class of type stdClass when you a battlefield conversion of an array to an object, such as:

(object)array('keyname' => 'value')

If you did a var_dump() of this, you'd get:

object(stdClass)#1 (1) {
  ["keyname"]=>
  string(5) "value"
}

All objects in every language inherit from some base object. I'm guessing that in PHP, it's stdClass.

(Vote me up if you like the answer.)

Dustin

云之铃。 2024-11-24 02:43:34

CoverageRequest 部分不是 CoverageResponse 类的一部分。 CoverageResponse 类包含 RequestorInformationModule 的单个实例和 CoverageResponseDetail 对象的开放式数组。

我对为什么出现 stdClass 的最佳猜测是由于在 CoverageRequest 和 CoverageResponse 元素中使用了未命名的复杂类型。

The CoverageRequest section is not part of the CoverageResponse class. The CoverageResponse class contains a single instance of RequestorInformationModule and an open-ended array of CoverageResponseDetail objects.

My best guess for why stdClass is appearing is due to the use of unnamed complexTypes in the CoverageRequest and CoverageResponse elements.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文