java中如何调用过sharepoint中的webservice
看微软的文档,调用webservice时用到了好多微软自定义的一些类库,比如他的网络身份凭证:credentials,真不知道在java中怎么使用。有过这方面经验的人吗,指导一下,谢谢。
webservice都是通用的soap协议吧,没有做过,也想问问
如果只是调用sharepoint本身的websevice,可以参考
http-://java-sharepoint-library.-googlecode.-com/svn/trunk
我的webservice都是自己写的,方便使用,借你参考下,用的axis2
private SPServicesStub m_SPStub; private ServiceClient m_ServiceClient; private Options m_Options; /** * Generates auth * * @param wsdlUrl * WSDL URL * @param username * @param pwd * @param hostname * @param domaname * @throws Exception */public void generateAuth(String wsdlUrl, String username, String pwd, String hostname, String domaname) throws Exception { if (wsdlUrl == null || wsdlUrl.equals("")) { m_SPStub = new SPServicesStub(); } else { m_SPStub = new SPServicesStub(wsdlUrl); } m_WSDL=wsdlUrl; m_ServiceClient = m_SPStub._getServiceClient(); m_ServiceClient.engageModule("addressing"); Options options = m_ServiceClient.getOptions(); options.setTimeOutInMilliSeconds(2 * 60 * 1000); options.setUseSeparateListener(false); HttpTransportProperties.Authenticator basicauth = new HttpTransportProperties.Authenticator(); basicauth.setUsername(username); basicauth.setPassword(pwd); basicauth.setHost(hostname); basicauth.setDomain(domaname); List authPrefs = new ArrayList(1); authPrefs.add(AuthPolicy.NTLM); basicauth.setAuthSchemes(authPrefs); options.setProperty(HTTPConstants.AUTHENTICATE, basicauth); m_ServiceClient.setOptions(options); m_Options=options; // _serviceClient.getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED,Boolean.FALSE); }