-2

私の WSDL から、次のサービス部分があります。

<service name="BAPI_CUSTOMER_DISPLAYService">
  <documentation>SAP Service BAPI_CUSTOMER_DISPLAY via SOAP</documentation>
  <port name="BAPI_CUSTOMER_DISPLAYPortType" binding="s0:BAPI_CUSTOMER_DISPLAYBinding">
    <soap:address location="http://2.3.4.100:8000/sap/bc/soap/rfc"/>
  </port>
</service>

では、これのエンドポイント参照は何でしょうか?

Salesforce クライアントで「http://2.3.4.100:8000/sap/bc/soap/rfc」として指定すると、次のエラーが発生します。「このサービスでは、認証手続きにクライアント証明書が必要です。」

Apexコードであるクライアントでユーザー名とパスワードを設定する方法がわからないので、ユーザー名とパスワードを指定する必要があると確信しています。

助けていただければ幸いです。

4

1 に答える 1

0

Enterprise WSDL をインポートし、loginResult の uri を使用しました。私のプロジェクトのコードは次のとおりです。

LoginResult loginResult = null; // Login Result (save and make static)
SessionHeader sessionHeader = null; // Session Header (save and make static)
SoapClient soapClient = null; // This is the Enterprise WSDL
SecureStatusClient SecureStatusClient = null; // This is my custom @WebService

// Create Login Request
LoginScopeHeader loginScopeHeader = new LoginScopeHeader
{
    organizationId = configuration["OrganizationId"],
    portalId = configuration["PortalId"]
};

// Call Login Service
string userName = configuration["UserName"];
string password = configuration["Password"];
string securityToken = configuration["SecurityToken"];
using (SoapClient loginClient = new SoapClient())
{
    loginResult = loginClient.login(loginScopeHeader, userName, password + securityToken);

    if (result.passwordExpired)
    {
        string message = string.Format("Salesforce.com password expired for user {0}", userName);
        throw new Exception(message);
    }
}

// Create the SessionHeader
sessionHeader = new SessionHeader { sessionId = loginResult.sessionId };

// Create the SoapClient to use for queries/updates
soapClient = new SoapClient();
soapClient.Endpoint.Address = new EndpointAddress(loginResult.serverUrl);

// Create the SecureStatusServiceClient 
secureStatusClient = new SecureStatusServiceClient();
Uri apexUri = new Uri(SoapClient.Endpoint.Address.Uri, "/services/Soap/class/SecureStatusService");
secureStatusClient.Endpoint.Address = new EndpointAddress(apexUri);
于 2011-08-16T19:57:17.027 に答える