Apex-Webservice에 대한 연결을 설정하려고 시도 중이지만 매번 실패합니다. here을 설명 나는 다만 방법,Salesforce Apex Soap 웹 서비스 (Java)
global class AtlassianService
{
webService static String hello(String Name)
{
return 'Hello '+Name+' ! :D';
}
}
는 클라이언트를 생성하려면 :
java –classpath pathToJAR/wsc-22.jar com.sforce.ws.tools.wsdlc pathToWsdl/WsdlFilename pathToOutputJar/OutputJarFilename
WebService에 액세스 : 나는 PartnerConnection를 사용하는 경우
SoapConnection soap = Connector.newConnection("[email protected]", "XXXX");
System.out.println(soap.hello("WORLD")); // Invalid Session (=> SessionID is null)
내 Webserce은 매우 간단합니다 유효한 SessionID를 얻으려면 모두 잘 작동합니다.
ConnectorConfig config = new ConnectorConfig();
config.setUsername(username);
config.setPassword(password);
config.setAuthEndpoint("https://login.salesforce.com/services/Soap/u/24.0");
new PartnerConnection(config);
SoapConnection soap = Connector.newConnection(null, null);
soap.setSessionHeader(config.getSessionId());
System.out.println(soap.hello("WORLD"));
누구나 첫 번째 예제가 실패하는 이유는 무엇입니까?
인사말 세바스찬