0

IOS でセイバー SOAP Web サービスを使用する方法を知っている人はいますか? 誰かがそれをしましたか?ネットワーク呼び出しにAFNetworkingを使用しています。

AFHTTPRequestOperation を使用して Web サービスを呼び出していますが、その Web サービスには認証が必要です。

認証パラメータは、、、usernameおよびpasswordですIPCC。ユーザー名とパスワードを設定できます

NSURLCredential *credential = [NSURLCredential credentialWithUser:@"aaaaa" password:@"aaaaaa" persistence:NSURLCredentialPersistenceNone]; 
[operation setCredential:credential]; 

しかし、そのIPCCパラメータをどのように設定できますか?

4

2 に答える 2

0

次のようなもの(すばやく汚い):

NSString *soapMessage = [NSString stringWithFormat:
                     @"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
                      "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:eb=\"http://www.ebxml.org/namespaces/messageHeader\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:xsd=\"http://www.w3.org/1999/XMLSchema\">"
                    "    <SOAP-ENV:Header>"
                    "        <eb:MessageHeader SOAP-ENV:mustUnderstand=\"1\" eb:version=\"1.0\">"
                    "            <eb:ConversationId/>"
                    "            <eb:From>"
                    "                <eb:PartyId type=\"urn:x12.org:IO5:01\">999999</eb:PartyId>"
                    "            </eb:From>"
                    "            <eb:To>"
                    "                <eb:PartyId type=\"urn:x12.org:IO5:01\">123123</eb:PartyId>"
                    "            </eb:To>"
                    "            <eb:CPAId>IPCC</eb:CPAId>"
                    "            <eb:Service eb:type=\"OTA\">SessionCreateRQ</eb:Service>"
                    "            <eb:Action>SessionCreateRQ</eb:Action>"
                    "            <eb:MessageData>"
                    "                <eb:MessageId>1000</eb:MessageId>"
                    "                <eb:Timestamp>2001-02-15T11:15:12Z</eb:Timestamp>"
                    "                <eb:TimeToLive>2001-02-15T11:15:12Z</eb:TimeToLive>"
                    "            </eb:MessageData>"
                    "        </eb:MessageHeader>"
                    "        <wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2002/12/secext\" xmlns:wsu=\"http://schemas.xmlsoap.org/ws/2002/12/utility\">"
                    "            <wsse:UsernameToken>"
                    "                <wsse:Username>%@</wsse:Username>"
                    "                <wsse:Password>%@</wsse:Password>"
                    "                <Organization>%@</Organization>"
                    "                <Domain>DEFAULT</Domain>"
                    "            </wsse:UsernameToken>"
                    "        </wsse:Security>"
                    "    </SOAP-ENV:Header>"
                    "    <SOAP-ENV:Body>"
                    "        <eb:Manifest SOAP-ENV:mustUnderstand=\"1\" eb:version=\"1.0\">"
                    "            <eb:Reference xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"cid:rootelement\" xlink:type=\"simple\"/>"
                    "        </eb:Manifest>"
                    "    </SOAP-ENV:Body>"
                    "</SOAP-ENV:Envelope>"      
                     ,username
                     ,password
                     ,ipccValue

                     ];

eb:CPAId ブロックではなく、Organization ブロックの ipccValue を意味していると思います

https://developer.sabre.com/docs/read/soap_basics/iosからSOAP Web サービスでパラメータを送信するための認証 とクレジットから

于 2015-12-30T14:09:19.023 に答える