使用 SOAP WDSL 和 PHP 的 Web 服务

发布于 2024-09-11 02:40:24 字数 2411 浏览 6 评论 0原文

我一直在尝试使用具有下面 WSDL 文件的 Web 服务。我不确定的是我应该通过或处理它的第一部分。它要求将 tns 类型的个人详细信息对象传递给它,但我不明白这意味着什么?我尝试使用的实际方法称为 PersonalDetails_Update,我将所有相关值传递给它,但它一直失败,我怀疑这与它之前要求的这个 personadetails 对象有关?

<s:element name="PersonalDetails_Update">
−
<s:complexType>
−
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="personaldetails" type="tns:PersonalDetails"/>
</s:sequence>
</s:complexType>
</s:element>
−
<s:complexType name="PersonalDetails">
−
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="ContactId" nillable="true" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="GenderId" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="EthnicityId" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="Title" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Initials" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Honours" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="FirstName" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Surname" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Salutation" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Position" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Department" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Organisation" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="AccessRequirements" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="DietaryNeeds" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="BirthDate" nillable="true" type="s:dateTime"/>
<s:element minOccurs="1" maxOccurs="1" name="IsNewContact" type="s:boolean"/>
<s:element minOccurs="1" maxOccurs="1" name="HoldingId" nillable="true" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="WebId" nillable="true" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="RecruitedId" type="s:int"/>
</s:sequence>
</s:complexType>
−
<s:element name="PersonalDetails_UpdateResponse">
−
<s:complexType>
−
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="PersonalDetails_UpdateResult" type="s:int"/>
</s:sequence>
</s:complexType>
</s:element>

I've been trying to use a Web Service which has the WSDL file below. The bit I'm not sure about is what I am supposed to pass or do with the first part of it. It asks for a personaldetails object with a tns type to be passed to it but I don't understand what that means? The actual method I am trying to use is called PersonalDetails_Update and I am passing all of the relevant values to it but it keeps failing and I suspect it's to do with this personadetails object it asks for before it?

<s:element name="PersonalDetails_Update">
−
<s:complexType>
−
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="personaldetails" type="tns:PersonalDetails"/>
</s:sequence>
</s:complexType>
</s:element>
−
<s:complexType name="PersonalDetails">
−
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="ContactId" nillable="true" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="GenderId" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="EthnicityId" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="Title" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Initials" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Honours" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="FirstName" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Surname" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Salutation" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Position" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Department" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Organisation" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="AccessRequirements" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="DietaryNeeds" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="BirthDate" nillable="true" type="s:dateTime"/>
<s:element minOccurs="1" maxOccurs="1" name="IsNewContact" type="s:boolean"/>
<s:element minOccurs="1" maxOccurs="1" name="HoldingId" nillable="true" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="WebId" nillable="true" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="RecruitedId" type="s:int"/>
</s:sequence>
</s:complexType>
−
<s:element name="PersonalDetails_UpdateResponse">
−
<s:complexType>
−
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="PersonalDetails_UpdateResult" type="s:int"/>
</s:sequence>
</s:complexType>
</s:element>

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

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

发布评论

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

评论(2

假装爱人 2024-09-18 02:40:24

要发送的信息的结构如下所示:

<Envelope>
  <Header/>
  <Body>
    <PersonalDetails_Update>
      <personaldetails>
        <ContactId>[some value]</ContactId>
        <GenderId>[some value]</GenderId>
        <EthnicityId>[some value]</EthnicityId>
        <Title>[some value]</Title>
        <Initials>[some value]</Initials>
        <Honours>[some value]</Honours>
        <FirstName>[some value]</FirstName>
        <Surname>[some value]</Surname>
        <Salutation>[some value]</Salutation>
        <Position>[some value]</Position>
        <Department>[some value]</Department>
        <Organisation>[some value]</Organisation>
        <AccessRequirements>[some value]</AccessRequirements>
        <DietaryNeeds>[some value]</DietaryNeeds>
        <BirthDate>[some value]</BirthDate>
        <IsNewContact>[some value]</IsNewContact>
        <HoldingId>[some value]</HoldingId>
        <WebId>[some value]</WebId>
        <RecruitedId>[some value]</RecruitedId>
      </personaldetails>
    </PersonalDetails_Update>
  </Body>
</Envelope>

PersonalDetails_Update 是您将使用的服务
Personaldetails 是保存详细信息的对象
PersonalDetails 定义详细信息

The structure of the information to send is something like this:

<Envelope>
  <Header/>
  <Body>
    <PersonalDetails_Update>
      <personaldetails>
        <ContactId>[some value]</ContactId>
        <GenderId>[some value]</GenderId>
        <EthnicityId>[some value]</EthnicityId>
        <Title>[some value]</Title>
        <Initials>[some value]</Initials>
        <Honours>[some value]</Honours>
        <FirstName>[some value]</FirstName>
        <Surname>[some value]</Surname>
        <Salutation>[some value]</Salutation>
        <Position>[some value]</Position>
        <Department>[some value]</Department>
        <Organisation>[some value]</Organisation>
        <AccessRequirements>[some value]</AccessRequirements>
        <DietaryNeeds>[some value]</DietaryNeeds>
        <BirthDate>[some value]</BirthDate>
        <IsNewContact>[some value]</IsNewContact>
        <HoldingId>[some value]</HoldingId>
        <WebId>[some value]</WebId>
        <RecruitedId>[some value]</RecruitedId>
      </personaldetails>
    </PersonalDetails_Update>
  </Body>
</Envelope>

PersonalDetails_Update is the service you'll be using
personaldetails is the object that will hold the details
PersonalDetails defines the details

青柠芒果 2024-09-18 02:40:24

看看 Zend_Soap本机 Soap 扩展。两者都有有关如何编写 Soap 客户端的信息。

Have a look at Zend_Soap and the native Soap extension. Both have information about how to write a Soap Client.

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