81,092
社区成员
发帖
与我相关
我的任务
分享
// TODO Auto-generated method stub
ServiceStub stub = new ServiceStub("https://my500451.c4c.saphybriscloud.cn/sap/bc/srt/scs/sap/querycustomerin1?sap-vhost=my500451.c4c.saphybriscloud.cn");
// 认证代码 start
Authenticator auth = new Authenticator();
auth.setUsername("7000000");
auth.setPassword("Zjhj12345678");
stub._getServiceClient().getOptions().setProperty(HTTPConstants.AUTHENTICATE, auth);
stub._getServiceClient().getOptions().setProperty(Configuration.CHARACTER_SET_ENCODING, "GBK");
stub._getServiceClient().getOptions().setTimeOutInMilliSeconds(300 * 1000);
stub._getServiceClient().getOptions().setProperty(Configuration.HTTP_METHOD, HTTPConstants.HTTP_METHOD_POST);
ServiceStub.CustomerByElementsQuery_sync query = new CustomerByElementsQuery_sync();
ServiceStub.CustomerByElementsResponse_sync response = new CustomerByElementsResponse_sync();
CustomerResponseMessage_sync message = null;
response.setCustomerByElementsResponse_sync(message);
stub.startfindByElements(query, new ServiceCallbackHandler() {
@Override
public void receiveErrorfindByElements(Exception e) {
// TODO Auto-generated method stub
super.receiveErrorfindByElements(e);
}
@Override
public void receiveResultfindByElements(CustomerByElementsResponse_sync result) {
// TODO Auto-generated method stub
super.receiveResultfindByElements(result);
}
@Override
public Object getClientData() {
// TODO Auto-generated method stub
return super.getClientData();
}
});
System.out.println(response.toString());