Web サービスを呼び出す C# コードを作成しようとしています。ユーザーを認証 (authenticateToNCIDv2Request) してから、結果 (authenticateToNCIDv2Result) を確認しようとしています。wsdlに基づいて、これを達成する方法がわかりません。
私のコード(これは間違っています)は次のようになります:
SingleSignOn.authenticateToNCIDv2Request request = new SingleSignOn.authenticateToNCIDv2Request();
request.AppID = "1234";
request.AppPassword = "appPW";
request.UserID = "testUser";
request.UserPassword = "userPW";
request = new authenticateToNCIDv2Request1(request).authenticateToNCIDv2Request;
SingleSignOnTest.SingleSignOn.authenticateToNCIDv2Response resp = new SingleSignOn.authenticateToNCIDv2Response();
SingleSignOn.authenticateToNCIDv2Result rslt = resp.authenticateToNCIDv2Result;
string y = rslt.Error;
SingleSignOn.Message[] msg = rslt.MessageArray;
wsdl (簡潔にするために適用されない部分を削除) は以下のとおりです。
<xs:element name="authenticateToNCIDv2Response" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:sequence xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element ref="ncidng:authenticateToNCIDv2Result" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="authenticateToNCIDv2Result" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:sequence xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element maxOccurs="1" minOccurs="0" ref="ncidng:MessageArray" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" name="Error" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="MessageArray" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:sequence xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element maxOccurs="unbounded" ref="ncidng:Message" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Message" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType mixed="true" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:attribute name="code" type="xs:NMTOKEN" use="required" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
</xs:complexType>
</xs:element>
<xs:group name="userinfogroup" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:sequence xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element maxOccurs="1" minOccurs="1" name="User_DN" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="1" name="User_ID" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" name="Personal_Title" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="1" name="First_Name" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" name="Middle_Initial" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="1" name="Last_Name" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="1" name="Full_Name" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" name="Suffix" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="1" name="User_Type" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" name="Employee_Type" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="1" name="GUID" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" name="Account_Expiration_Date" type="xs:dateTime" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" name="Login_Disabled" type="xs:boolean" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" name="Locked_by_Intruder" type="xs:boolean" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" name="Password_Expiration_Date" type="xs:dateTime" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" name="Second_Factor_Role" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="1" name="Account_Status" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" name="Migration_Status" type="xs:boolean" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" name="Business_Phone" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" name="Business_Phone_Ext" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="1" name="eMail" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" name="Street" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" name="Address_Line2" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" name="City" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" name="State" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" name="Zip_Code" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" name="CR_Config" type="xs:boolean" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" ref="ncidng:Member_of_OrganizationArray" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" ref="ncidng:Member_of_DivisionArray" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xs:element maxOccurs="1" minOccurs="0" ref="ncidng:Member_of_SectionArray" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
</xs:sequence>
</xs:group>
<xs:element name="NCIDWebServiceException" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:sequence xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="reason" nillable="true" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
</xs:sequence>
</xs:complexType>
</xs:element>
前もって感謝します!