I don't know if anyone could help me, but I tried to contact the Storage Service to retrieve the Owner Profile. However, it's doesn't work : I've got a http error code 500.
privatevoidprofileRequest(Stringurl){if(url==null)url="https://storage.msn.com/storageservice/SchematizedStore.asmx"; SoapRequest request = new SoapRequest(createRequestGetProfile(),url, "http://www.msn.com/webservices/storage/2008/GetProfile","POST"){ @Override public boolean sendCompleted(String responseStr, int code){ System.out.println(code); System.out.println(responseStr); return false; } }; sendRequestNow(request); }protected static boolean sendRequestNow(SoapRequest soapRequest){try{ URL url = soapRequest.getAddress(); if (params == null) initParams(); HttpRequestExecutor httpexecutor = new HttpRequestExecutor(); HttpContext context = new BasicHttpContext(null); HttpHost host = new HttpHost(url.getHost(),443,"https"); context.setAttribute(ExecutionContext.HTTP_CONNECTION,conn); context.setAttribute(ExecutionContext.HTTP_TARGET_HOST,host); if (!conn.isOpen()){ SSLContext sc = SSLContext.getInstance("SSLv3"); TrustManager[] tma = { new DummyTrustManager() }; sc.init(null,tma,null); SSLSocketFactory factory = sc.getSocketFactory(); Socket socket = factory.createSocket(host.getHostName(),host.getPort()); conn.bind(socket,params); } BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest(soapRequest.getMethod(),url.getPath()); request.setEntity(new XmlEntity(soapRequest.getBody())); context.setAttribute(ExecutionContext.HTTP_REQUEST,request); request.setParams(params); if (soapRequest.getUrlSoap() != null) request.addHeader("SOAPAction",soapRequest.getUrlSoap()); request.addHeader("Host",url.getHost()); httpexecutor.preProcess(request,httpproc,context); HttpResponse response = httpexecutor.execute(request,conn,context); httpexecutor.postProcess(response,httpproc,context); String responseStr = EntityUtils.toString(response.getEntity()); int code = response.getStatusLine().getStatusCode(); try{ conn.close(); }catch (Exception e){ log.log(Level.SEVERE,"",e); return false; } return soapRequest.sendCompleted(responseStr,code); }catch (Exception e){ log.log(Level.SEVERE,"",e);returnfalse;}}
Hello,
I don't know if anyone could help me, but I tried to contact the Storage Service to retrieve the Owner Profile. However, it's doesn't work : I've got a http error code 500.
And SoapRequest.class :
Thanks !