Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml 如何将soap请求中的结构数组作为参数传递?_Xml_Web Services_Soap_Coldfusion_Wsdl - Fatal编程技术网

Xml 如何将soap请求中的结构数组作为参数传递?

Xml 如何将soap请求中的结构数组作为参数传递?,xml,web-services,soap,coldfusion,wsdl,Xml,Web Services,Soap,Coldfusion,Wsdl,我正在尝试使用在ColdFusion中创建的SOAP web服务。服务的WSDL请求部分如下所示: <wsdl:message name="submitTicketWithExtraInfoRequest"> <wsdl:part name="sUserLdapAlias" type="xsd:string"></wsdl:part> <wsdl:part name="sIssueDetails" type="xsd:string"></ws

我正在尝试使用在ColdFusion中创建的SOAP web服务。服务的WSDL请求部分如下所示:

<wsdl:message name="submitTicketWithExtraInfoRequest">
<wsdl:part name="sUserLdapAlias" type="xsd:string"></wsdl:part>
<wsdl:part name="sIssueDetails" type="xsd:string"></wsdl:part>
<wsdl:part name="sIssueSummary" type="xsd:string"></wsdl:part>
<wsdl:part name="sDeadlineReason" type="xsd:string"></wsdl:part>
<wsdl:part name="nRelatedTo" type="xsd:string"></wsdl:part>
<wsdl:part name="nPriorityLevel" type="xsd:string"></wsdl:part>
<wsdl:part name="nSegmentid" type="xsd:string"></wsdl:part>
<wsdl:part name="sSubmitterPhone" type="xsd:string"></wsdl:part>
<wsdl:part name="sCC" type="xsd:string"></wsdl:part>
<wsdl:part name="sCoSubmitter" type="xsd:string"></wsdl:part>
<wsdl:part name="sDeadline" type="xsd:string"></wsdl:part>
<wsdl:part name="arURLReference" type="impl:ArrayOf_tns1_URLReference"></wsdl:part>
</wsdl:message>

<complexType name="ArrayOf_tns1_URLReference">
    <complexContent>
         <restriction base="soapenc:Array">
             <attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:URLReference[]"/>
         </restriction>
    </complexContent>
</complexType>

<complexType name="URLReference">
     <sequence>
         <element name="sURLReferenceComment" nillable="true" type="xsd:string"/>
         <element name="sURLReferenceURL" nillable="true" type="xsd:string"/>
     </sequence>
</complexType>
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:int="http://some url/webService/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
   <soapenv:Header/>
   <soapenv:Body>
      <int:submitTicketWithExtraInfo soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <sUserLdapAlias xsi:type="xsd:string">?</sUserLdapAlias>
         <sIssueDetails xsi:type="xsd:string">?</sIssueDetails>
         <sIssueSummary xsi:type="xsd:string">?</sIssueSummary>
         <sTroubleshooting xsi:type="xsd:string">?</sTroubleshooting>
         <sDeadlineReason xsi:type="xsd:string">?</sDeadlineReason>
         <nRelatedTo xsi:type="xsd:double">?</nRelatedTo>
         <nPriorityLevel xsi:type="xsd:double">?</nPriorityLevel>
         <nSegmentid xsi:type="xsd:double">?</nSegmentid>
         <sSubmitterPhone xsi:type="xsd:string">?</sSubmitterPhone>
         <sCC xsi:type="xsd:string">?</sCC>
         <sCoSubmitter xsi:type="xsd:string">?</sCoSubmitter>
         <sDeadline xsi:type="xsd:string">?</sDeadline>
         <arURLReference xsi:type="int:ArrayOf_tns1_URLReference" soapenc:arrayType="dat:URLReference[]" xmlns:dat="http://dataservice"/>
      </int:submitTicketWithExtraInfo>
   </soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <ns1:submitTicketWithExtraInfo soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://some url/webService/">
         <sUserLdapAlias xsi:type="xsd:string">psingh46</sUserLdapAlias>
         <sIssueDetails xsi:type="xsd:string">test ticket submit service with extra info</sIssueDetails>
         <sIssueSummary xsi:type="xsd:string">test ticket submit service with extra info</sIssueSummary>
         <sDeadlineReason xsi:type="xsd:string"/>
         <nRelatedTo xsi:type="xsd:string">45898</nRelatedTo>
         <nPriorityLevel xsi:type="xsd:string">71</nPriorityLevel>
         <nSegmentid xsi:type="xsd:string">18244</nSegmentid>
         <sSubmitterPhone xsi:type="xsd:string"/>
         <sCC xsi:type="xsd:string"/>
         <sCoSubmitter xsi:type="xsd:string"/>
         <sDeadline xsi:type="xsd:string"/>
         <arURLReference soapenc:arrayType="ns2:URLReference[2]" xsi:type="soapenc:Array" xmlns:ns2="http://dataservice" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
            <arURLReference xsi:type="ns2:URLReference">
               <sURLReferenceComment xsi:type="xsd:string">google link</sURLReferenceComment>
               <sURLReferenceURL xsi:type="xsd:string">http://google.com</sURLReferenceURL>
            </arURLReference>
            <arURLReference xsi:type="ns2:URLReference">
               <sURLReferenceComment xsi:type="xsd:string">so link</sURLReferenceComment>
               <sURLReferenceURL xsi:type="xsd:string">http://so.com</sURLReferenceURL>
            </arURLReference>
         </arURLReference>
      </ns1:submitTicketWithExtraInfo>
   </soapenv:Body>
</soapenv:Envelope>

我正在使用SoapUI生成请求,该请求当前如下所示:

<wsdl:message name="submitTicketWithExtraInfoRequest">
<wsdl:part name="sUserLdapAlias" type="xsd:string"></wsdl:part>
<wsdl:part name="sIssueDetails" type="xsd:string"></wsdl:part>
<wsdl:part name="sIssueSummary" type="xsd:string"></wsdl:part>
<wsdl:part name="sDeadlineReason" type="xsd:string"></wsdl:part>
<wsdl:part name="nRelatedTo" type="xsd:string"></wsdl:part>
<wsdl:part name="nPriorityLevel" type="xsd:string"></wsdl:part>
<wsdl:part name="nSegmentid" type="xsd:string"></wsdl:part>
<wsdl:part name="sSubmitterPhone" type="xsd:string"></wsdl:part>
<wsdl:part name="sCC" type="xsd:string"></wsdl:part>
<wsdl:part name="sCoSubmitter" type="xsd:string"></wsdl:part>
<wsdl:part name="sDeadline" type="xsd:string"></wsdl:part>
<wsdl:part name="arURLReference" type="impl:ArrayOf_tns1_URLReference"></wsdl:part>
</wsdl:message>

<complexType name="ArrayOf_tns1_URLReference">
    <complexContent>
         <restriction base="soapenc:Array">
             <attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:URLReference[]"/>
         </restriction>
    </complexContent>
</complexType>

<complexType name="URLReference">
     <sequence>
         <element name="sURLReferenceComment" nillable="true" type="xsd:string"/>
         <element name="sURLReferenceURL" nillable="true" type="xsd:string"/>
     </sequence>
</complexType>
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:int="http://some url/webService/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
   <soapenv:Header/>
   <soapenv:Body>
      <int:submitTicketWithExtraInfo soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <sUserLdapAlias xsi:type="xsd:string">?</sUserLdapAlias>
         <sIssueDetails xsi:type="xsd:string">?</sIssueDetails>
         <sIssueSummary xsi:type="xsd:string">?</sIssueSummary>
         <sTroubleshooting xsi:type="xsd:string">?</sTroubleshooting>
         <sDeadlineReason xsi:type="xsd:string">?</sDeadlineReason>
         <nRelatedTo xsi:type="xsd:double">?</nRelatedTo>
         <nPriorityLevel xsi:type="xsd:double">?</nPriorityLevel>
         <nSegmentid xsi:type="xsd:double">?</nSegmentid>
         <sSubmitterPhone xsi:type="xsd:string">?</sSubmitterPhone>
         <sCC xsi:type="xsd:string">?</sCC>
         <sCoSubmitter xsi:type="xsd:string">?</sCoSubmitter>
         <sDeadline xsi:type="xsd:string">?</sDeadline>
         <arURLReference xsi:type="int:ArrayOf_tns1_URLReference" soapenc:arrayType="dat:URLReference[]" xmlns:dat="http://dataservice"/>
      </int:submitTicketWithExtraInfo>
   </soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <ns1:submitTicketWithExtraInfo soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://some url/webService/">
         <sUserLdapAlias xsi:type="xsd:string">psingh46</sUserLdapAlias>
         <sIssueDetails xsi:type="xsd:string">test ticket submit service with extra info</sIssueDetails>
         <sIssueSummary xsi:type="xsd:string">test ticket submit service with extra info</sIssueSummary>
         <sDeadlineReason xsi:type="xsd:string"/>
         <nRelatedTo xsi:type="xsd:string">45898</nRelatedTo>
         <nPriorityLevel xsi:type="xsd:string">71</nPriorityLevel>
         <nSegmentid xsi:type="xsd:string">18244</nSegmentid>
         <sSubmitterPhone xsi:type="xsd:string"/>
         <sCC xsi:type="xsd:string"/>
         <sCoSubmitter xsi:type="xsd:string"/>
         <sDeadline xsi:type="xsd:string"/>
         <arURLReference soapenc:arrayType="ns2:URLReference[2]" xsi:type="soapenc:Array" xmlns:ns2="http://dataservice" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
            <arURLReference xsi:type="ns2:URLReference">
               <sURLReferenceComment xsi:type="xsd:string">google link</sURLReferenceComment>
               <sURLReferenceURL xsi:type="xsd:string">http://google.com</sURLReferenceURL>
            </arURLReference>
            <arURLReference xsi:type="ns2:URLReference">
               <sURLReferenceComment xsi:type="xsd:string">so link</sURLReferenceComment>
               <sURLReferenceURL xsi:type="xsd:string">http://so.com</sURLReferenceURL>
            </arURLReference>
         </arURLReference>
      </ns1:submitTicketWithExtraInfo>
   </soapenv:Body>
</soapenv:Envelope>

?
?
?
?
?
?
?
?
?
?
?
?

对于其余的参数,我只需要用实际值替换问号
。问题是我不知道如何在我的请求中传递arURLReference参数。从WSDL可以明显看出,它是一个结构数组

我使用ColdFusion的
getSOAPRequest()
函数获取web服务的请求XML。看起来是这样的:

<wsdl:message name="submitTicketWithExtraInfoRequest">
<wsdl:part name="sUserLdapAlias" type="xsd:string"></wsdl:part>
<wsdl:part name="sIssueDetails" type="xsd:string"></wsdl:part>
<wsdl:part name="sIssueSummary" type="xsd:string"></wsdl:part>
<wsdl:part name="sDeadlineReason" type="xsd:string"></wsdl:part>
<wsdl:part name="nRelatedTo" type="xsd:string"></wsdl:part>
<wsdl:part name="nPriorityLevel" type="xsd:string"></wsdl:part>
<wsdl:part name="nSegmentid" type="xsd:string"></wsdl:part>
<wsdl:part name="sSubmitterPhone" type="xsd:string"></wsdl:part>
<wsdl:part name="sCC" type="xsd:string"></wsdl:part>
<wsdl:part name="sCoSubmitter" type="xsd:string"></wsdl:part>
<wsdl:part name="sDeadline" type="xsd:string"></wsdl:part>
<wsdl:part name="arURLReference" type="impl:ArrayOf_tns1_URLReference"></wsdl:part>
</wsdl:message>

<complexType name="ArrayOf_tns1_URLReference">
    <complexContent>
         <restriction base="soapenc:Array">
             <attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:URLReference[]"/>
         </restriction>
    </complexContent>
</complexType>

<complexType name="URLReference">
     <sequence>
         <element name="sURLReferenceComment" nillable="true" type="xsd:string"/>
         <element name="sURLReferenceURL" nillable="true" type="xsd:string"/>
     </sequence>
</complexType>
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:int="http://some url/webService/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
   <soapenv:Header/>
   <soapenv:Body>
      <int:submitTicketWithExtraInfo soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <sUserLdapAlias xsi:type="xsd:string">?</sUserLdapAlias>
         <sIssueDetails xsi:type="xsd:string">?</sIssueDetails>
         <sIssueSummary xsi:type="xsd:string">?</sIssueSummary>
         <sTroubleshooting xsi:type="xsd:string">?</sTroubleshooting>
         <sDeadlineReason xsi:type="xsd:string">?</sDeadlineReason>
         <nRelatedTo xsi:type="xsd:double">?</nRelatedTo>
         <nPriorityLevel xsi:type="xsd:double">?</nPriorityLevel>
         <nSegmentid xsi:type="xsd:double">?</nSegmentid>
         <sSubmitterPhone xsi:type="xsd:string">?</sSubmitterPhone>
         <sCC xsi:type="xsd:string">?</sCC>
         <sCoSubmitter xsi:type="xsd:string">?</sCoSubmitter>
         <sDeadline xsi:type="xsd:string">?</sDeadline>
         <arURLReference xsi:type="int:ArrayOf_tns1_URLReference" soapenc:arrayType="dat:URLReference[]" xmlns:dat="http://dataservice"/>
      </int:submitTicketWithExtraInfo>
   </soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <ns1:submitTicketWithExtraInfo soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://some url/webService/">
         <sUserLdapAlias xsi:type="xsd:string">psingh46</sUserLdapAlias>
         <sIssueDetails xsi:type="xsd:string">test ticket submit service with extra info</sIssueDetails>
         <sIssueSummary xsi:type="xsd:string">test ticket submit service with extra info</sIssueSummary>
         <sDeadlineReason xsi:type="xsd:string"/>
         <nRelatedTo xsi:type="xsd:string">45898</nRelatedTo>
         <nPriorityLevel xsi:type="xsd:string">71</nPriorityLevel>
         <nSegmentid xsi:type="xsd:string">18244</nSegmentid>
         <sSubmitterPhone xsi:type="xsd:string"/>
         <sCC xsi:type="xsd:string"/>
         <sCoSubmitter xsi:type="xsd:string"/>
         <sDeadline xsi:type="xsd:string"/>
         <arURLReference soapenc:arrayType="ns2:URLReference[2]" xsi:type="soapenc:Array" xmlns:ns2="http://dataservice" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
            <arURLReference xsi:type="ns2:URLReference">
               <sURLReferenceComment xsi:type="xsd:string">google link</sURLReferenceComment>
               <sURLReferenceURL xsi:type="xsd:string">http://google.com</sURLReferenceURL>
            </arURLReference>
            <arURLReference xsi:type="ns2:URLReference">
               <sURLReferenceComment xsi:type="xsd:string">so link</sURLReferenceComment>
               <sURLReferenceURL xsi:type="xsd:string">http://so.com</sURLReferenceURL>
            </arURLReference>
         </arURLReference>
      </ns1:submitTicketWithExtraInfo>
   </soapenv:Body>
</soapenv:Envelope>

psingh46
带额外信息的测试票提交服务
带额外信息的测试票提交服务
45898
71
18244

您是否已将其与SoapUI配合使用?如果是这样,那么只需使用ColdFusion重新创建该结构。实际上,它使用
cfinvoke
在ColdFusion上工作。我试图使用其他技术测试该服务。为此,我选择了SoapUI。它创建用于调用web服务的纯XML soap请求。在XML中,我不知道如何传递复杂的值,比如结构数组。