1

以前に投稿された以下の質問で提供されている例を実装しようとしています。

VBScript による WCF サービスの呼び出し

私の特定のシナリオでは、文字列の配列を返す単一の文字列変数を渡す必要がありますが、運はほとんどありません。

エンベロープ リクエストを正しく取得するのに苦労していると思います。以下は、私が呼び出そうとしている wdsl です。パラメータを渡して戻り配列を解析する方法の例を教えてください。

  <?xml version="1.0" encoding="utf-8" ?> 
 <wsdl:definitions name="TestSvc" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
 <wsdl:types>
 <xsd:schema targetNamespace="http://tempuri.org/Imports">
  <xsd:import schemaLocation="http://localHost/testSvc.svc?xsd=xsd0" namespace="http://tempuri.org/" /> 
  <xsd:import schemaLocation="http://localHost/testSvc.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" /> 
  <xsd:import schemaLocation="http://localHost/testSvc.svc?xsd=xsd2" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" /> 
  </xsd:schema>
  </wsdl:types>
 <wsdl:message name="ITestSvc_GetDataBy_Id_InputMessage">
 <wsdl:part name="parameters" element="tns:GetDataBy_Id" /> 
 </wsdl:message>
 <wsdl:message name="ITestSvc_GetDataBy_Id_OutputMessage">
  <wsdl:part name="parameters" element="tns:GetDataBy_IdResponse" /> 
  </wsdl:message>
 <wsdl:portType name="ITestSvc">
 <wsdl:operation name="GetDataBy_Id">
  <wsdl:input wsaw:Action="http://tempuri.org/ITestSvc/GetDataBy_Id" message="tns:ITestSvc_GetDataBy_Id_InputMessage" /> 
  <wsdl:output wsaw:Action="http://tempuri.org/ITestSvc/GetDataBy_IdResponse" message="tns:ITestSvc_GetDataBy_Id_OutputMessage" /> 
  </wsdl:operation>
 <wsdl:binding name="BasicHttpBinding_TestSvc" type="tns:ITestSvc">
  <soap:binding transport="http://schemas.xmlsoap.org/soap/http" /> 
 <wsdl:operation name="GetDataBy_Id">
  <soap:operation soapAction="http://tempuri.org/ITestSvc/GetDataBy_Id" 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="TestSvc">
 <wsdl:port name="BasicHttpBinding_ITestSvc" binding="tns:BasicHttpBinding_ITestSvc">
  <soap:address location="http://localhost/TestSvc.svc" /> 
  </wsdl:port>
  </wsdl:service>
  </wsdl:definitions>
4

1 に答える 1

1

<wsdl:import>このWSDLドキュメントには、操作の入出力のスキーマ(すべてのステートメント)が含まれていないため、この情報だけに基づいて要求がどのように表示されるかを判断することはできません。

ただし、実行できることの1つは、WCFTestClient.exeを開き、実行中のサービスのWSDLをポイントしてから、Fiddlerなどのツールの実行中にサービスに要求を送信することです。このようにして、進行中のリクエストとサービスの応答を確認できます。その時点で、リクエスト(SOAPAction該当する場合はHTTPヘッダーなどを含む)とリクエスト本文を複製します。

于 2012-08-27T03:08:14.290 に答える