调用SAP接口时,SAP接口端需要验证用户名、密码,添加如下代码,将用户名、密码改成实际密码即可:
HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
auth.setUsername("userName"); // 用户名
auth.setPassword("password"); // 密码
ZMMFG001Stub stub = new ZMMFG001Stub();
stub._getServiceClient().getOptions().setProperty(HTTPConstants.AUTHENTICATE, auth);