WSDL 1.1 有关端点 salesforce Apex 代码的基本问题

发布于 2024-11-29 16:04:28 字数 589 浏览 0 评论 0原文

从我的 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 代码)中设置它们。

感谢帮助。

From my WSDL I have the following service part:

<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>

then what will be endpoint reference for this?

I am giving it as "http://2.3.4.100:8000/sap/bc/soap/rfc" in my salesforce client and it gives the following error.
"This service requires client certificate for authentication procedure."

I am sure that i need to give user name and password not knowing how i can set them in my client which is a Apex code.

Help is appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

埖埖迣鎅 2024-12-06 16:04:28

我导入了 Enterprise WSDL 并使用了登录结果中的 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);

I imported the Enterprise WSDL and used the uri from the loginResult. Here's some code from my project:

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);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文