| Author |
Message |
Loke Kit Kai [MVP]
Guest
|
Posted:
Thu Oct 20, 2005 8:49 am Post subject:
Is there any difference in invoking FrontPageRPC in SPS and |
|
|
I have a code that invokes server version first before invoking get
manifest.
With the correct credentials supplied,
When I run this code against a wss site, it is ok.
When I run this code against a sps site, only server version is successful.
Get manifest gets a 401 error, which is access denied. Any idea how to solve
this?
--
Best Regards,
Kit Kai
MVP (asp.net)
SgDotNet Council Member
Visit Us @ http://www.sgdotnet.org
My Blog: http://community.sgdotnet.org/blogs/kitkai |
|
| Back to top |
|
 |
Wei-Dong XU [MSFT]
Guest
|
Posted:
Thu Oct 20, 2005 12:51 pm Post subject:
RE: Is there any difference in invoking FrontPageRPC in SPS |
|
|
Hi Kit Kai,
Could you be so kind to provide a code sample on your issue? I will
research this issue for you then.
Look forward to your update!
Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no rights.
It is my pleasure to be of assistance. |
|
| Back to top |
|
 |
Loke Kit Kai [MVP]
Guest
|
Posted:
Fri Oct 21, 2005 7:29 am Post subject:
Re: Is there any difference in invoking FrontPageRPC in SPS |
|
|
This is the function I use to generate the request to get the server version
public Version GetServerExtensionVersion(System.Net.NetworkCredential
Credentials, string Url)
{
if (ServerExtensionVersion != null)
{
return ServerExtensionVersion;
}
byte[] PostData =
System.Text.Encoding.ASCII.GetBytes(RPCCommands.ServerExtensionVersion);
HttpWebRequest oRequest = CreateHttpRequest(Credentials, GetAuthorUrl(Url),
PostData.Length);
try
{
StreamReader oStreamReader = SendRequest(oRequest, PostData);
ServerExtensionVersion = new Version();
return RetrieveServerExtensionVersion(oStreamReader.ReadToEnd(),
ServerExtensionVersion);
}
catch(FrontPageRPCException)
{
throw;
}
catch(Exception Ex)
{
throw new FrontPageRPCException("Could not retrieve the server extension
version. Error Message: " + Ex.Message, Url, Ex);
}
}
Server Extension Version is defined as
public const string ServerExtensionVersion = "method=server version";
This is the function I use to generate the request to get the manifest
public string GetManifest(System.Net.NetworkCredential Credentials, string
Url, string ServiceName, params string[] InterestedItem)
{
if (ServerExtensionVersion == null)
{
GetServerExtensionVersion(Credentials, Url);
}
StringBuilder CombinedItems = new StringBuilder();
for (int Counter = 0; Counter < InterestedItem.Length; Counter++)
{
if (Counter > 0)
{
CombinedItems.Append(", ");
}
CombinedItems.Append(InterestedItem[Counter]);
}
byte[] PostData =
System.Text.Encoding.ASCII.GetBytes(GetManifestCommand(ServiceName,
CombinedItems.ToString()));
HttpWebRequest oRequest = CreateHttpRequest(Credentials, GetAdminUrl(Url),
PostData.Length);
//oRequest.Credentials = new System.Net.NetworkCredential("administrator",
"Secure77", "sps2003dev");
try
{
//Write the post data to request stream
StreamReader oStreamReader = SendRequest(oRequest, PostData);
return oStreamReader.ReadToEnd();
}
catch(FrontPageRPCException)
{
throw;
}
catch(Exception Ex)
{
throw new FrontPageRPCException("Could not retrieve the manifest. Error
Message: " + Ex.Message, Url, Ex);
}
}
This function generates the command for get manifest
protected string GetManifestCommand(string ServiceName, string
InterestedItem)
{
StringBuilder sbCommand = new StringBuilder();
sbCommand.Append("method=get
manifest:").Append(ServerExtensionVersion.GetVersion()).Append("&service_name=").Append(ServiceName).Append("&options=").Append(InterestedItem);
return sbCommand.ToString();
}
Let me know which other functions you need pls. Thanks you very much
Wei-Dong
--
Best Regards,
Kit Kai
MVP (asp.net)
SgDotNet Council Member
Visit Us @ http://www.sgdotnet.org
My Blog: http://community.sgdotnet.org/blogs/kitkai
"Wei-Dong XU [MSFT]" <v-wdxu@online.microsoft.com> wrote in message
news:Eap8wFW1FHA.1468@TK2MSFTNGXA01.phx.gbl...
| Quote: | Hi Kit Kai,
Could you be so kind to provide a code sample on your issue? I will
research this issue for you then.
Look forward to your update!
Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no
rights.
It is my pleasure to be of assistance. |
|
|
| Back to top |
|
 |
Wei-Dong XU [MSFT]
Guest
|
Posted:
Fri Oct 21, 2005 8:51 am Post subject:
Re: Is there any difference in invoking FrontPageRPC in SPS |
|
|
Hi Kit Kai,
Based on my research on this issue, the Frontpage RPC should be the same in
WSS and SPS. So for this issue, my troubleshooting suggestion is:
1. please check the portal setting on the security whether the logon
account in the Frontpage RPC has enough privilege to execute the code
2. please use Frontpage 2003 to open your portal site, Frontpage 2003
internally uses Frontpage RPC to access the portal and WSS.
3. please create one WSS sub site under your portal and then use your code
to see whether it could work.
Please feel free to let me know if this issue remains.
Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no rights.
It is my pleasure to be of assistance. |
|
| Back to top |
|
 |
Loke Kit Kai [MVP]
Guest
|
Posted:
Fri Oct 21, 2005 8:51 am Post subject:
Re: Is there any difference in invoking FrontPageRPC in SPS |
|
|
1. I tried using the same credentials to login to the SPS site, I got in.
Will this indicate that Frontpage RPC should have enough privilege?
2. I'm trying to keep my development environment small, so I prefer not to
install FrontPage at this time. If I still need to try frontpage after
answering 1 and 3, I will install frontpage and try.
3. I did, and it works perfectly.
Any clue what might be causing the 401 error?
--
Best Regards,
Kit Kai
MVP (asp.net)
SgDotNet Council Member
Visit Us @ http://www.sgdotnet.org
My Blog: http://community.sgdotnet.org/blogs/kitkai
"Wei-Dong XU [MSFT]" <v-wdxu@online.microsoft.com> wrote in message
news:IXlagAh1FHA.2244@TK2MSFTNGXA01.phx.gbl...
| Quote: | Hi Kit Kai,
Based on my research on this issue, the Frontpage RPC should be the same
in
WSS and SPS. So for this issue, my troubleshooting suggestion is:
1. please check the portal setting on the security whether the logon
account in the Frontpage RPC has enough privilege to execute the code
2. please use Frontpage 2003 to open your portal site, Frontpage 2003
internally uses Frontpage RPC to access the portal and WSS.
3. please create one WSS sub site under your portal and then use your code
to see whether it could work.
Please feel free to let me know if this issue remains.
Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no
rights.
It is my pleasure to be of assistance. |
|
|
| Back to top |
|
 |
Wei-Dong XU [MSFT]
Guest
|
Posted:
Fri Oct 21, 2005 12:51 pm Post subject:
Re: Is there any difference in invoking FrontPageRPC in SPS |
|
|
Hi Kit kai,
What resource are you accessing in the code? If that resource is a list, it
may demand more privilege.
Look forward to your update!
Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no rights.
It is my pleasure to be of assistance. |
|
| Back to top |
|
 |
Loke Kit Kai [MVP]
Guest
|
Posted:
Fri Oct 21, 2005 12:51 pm Post subject:
Re: Is there any difference in invoking FrontPageRPC in SPS |
|
|
At this stage, I'm trying to find out what are the subsites using the
GetManifest command. I'm trying to build a tree structure in windows forms.
--
Best Regards,
Kit Kai
MVP (asp.net)
SgDotNet Council Member
Visit Us @ http://www.sgdotnet.org
My Blog: http://community.sgdotnet.org/blogs/kitkai
"Wei-Dong XU [MSFT]" <v-wdxu@online.microsoft.com> wrote in message
news:eK0Cn3h1FHA.1468@TK2MSFTNGXA01.phx.gbl...
| Quote: | Hi Kit kai,
What resource are you accessing in the code? If that resource is a list,
it
may demand more privilege.
Look forward to your update!
Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no
rights.
It is my pleasure to be of assistance. |
|
|
| Back to top |
|
 |
Wei-Dong XU [MSFT]
Guest
|
Posted:
Mon Oct 24, 2005 8:51 am Post subject:
Re: Is there any difference in invoking FrontPageRPC in SPS |
|
|
Hi kit kai,
From my experience, this issue looks really very odd. Now I have two
suggestions:
1. please verify each site under the SPS portal has granted the access
permission to the account of your Frontpage RPC code so that we can ensure
the Frontpage RPC could visit eacy site for building the sites tree view in
your winform.
2. if this issue remains, one debugging on this issue should be required so
I'd suggest please raise one incident to your local Microsoft product
support service (PSS). One dedicated team will perform the debugging for
you to locate the root culprit. Your local MS PSS is available from:
http://support.microsoft.com/common/international.aspx
Please feel free to let me know if you have any further question on this
matter.
Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no rights.
It is my pleasure to be of assistance. |
|
| Back to top |
|
 |
Loke Kit Kai [MVP]
Guest
|
Posted:
Wed Nov 02, 2005 9:51 am Post subject:
Re: Is there any difference in invoking FrontPageRPC in SPS |
|
|
Wei-Dong,
Could you do a test for me? I realise that I have no problem with the root
site (http://spsv2), but the manifest that I got back was
CompanyNews
Divisions
ExternalNews
HumanResources
Locations
Marketing
MySite
News
Operations
PressAnnouncements
Projects
Resources
Sales
SiteDirectory
Strategy
Support
Topics
These are the sites that is giving me access denied errors...
"Wei-Dong XU [MSFT]" <v-wdxu@online.microsoft.com> wrote in message
news:CZPu63G2FHA.1172@TK2MSFTNGXA01.phx.gbl...
| Quote: | Hi kit kai,
From my experience, this issue looks really very odd. Now I have two
suggestions:
1. please verify each site under the SPS portal has granted the access
permission to the account of your Frontpage RPC code so that we can ensure
the Frontpage RPC could visit eacy site for building the sites tree view
in
your winform.
2. if this issue remains, one debugging on this issue should be required
so
I'd suggest please raise one incident to your local Microsoft product
support service (PSS). One dedicated team will perform the debugging for
you to locate the root culprit. Your local MS PSS is available from:
http://support.microsoft.com/common/international.aspx
Please feel free to let me know if you have any further question on this
matter.
Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no
rights.
It is my pleasure to be of assistance. |
|
|
| Back to top |
|
 |
Wei-Dong XU [MSFT]
Guest
|
Posted:
Thu Nov 03, 2005 1:51 pm Post subject:
Re: Is there any difference in invoking FrontPageRPC in SPS |
|
|
Hi,
I'd like to do this for your. However, since this issue may be caused by
the box setting or any other issues. I am afraid this test will not be
helpful for your scenario. Furthermore, I have replied your another post
today, please test to see whether that issue will resolve this one.
Subject: RE: FrontPage RPC, PutDocument causing HTTP Protocol Violation
Newsgroups: microsoft.public.sharepoint.portalserver.development
Please feel free to let me know if you have any further question on this
matter.
Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no rights.
It is my pleasure to be of assistance. |
|
| Back to top |
|
 |
Wei-Dong XU [MSFT]
Guest
|
Posted:
Tue Nov 08, 2005 9:51 am Post subject:
Re: Is there any difference in invoking FrontPageRPC in SPS |
|
|
Hi Kit Kai,
How are you? I am just checking if there is anything further we can do for
you. If so, please let me know.
Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no rights.
It is my pleasure to be of assistance. |
|
| Back to top |
|
 |
Loke Kit Kai [MVP]
Guest
|
Posted:
Tue Nov 08, 2005 9:51 am Post subject:
Re: Is there any difference in invoking FrontPageRPC in SPS |
|
|
Hi Wei-Dong,
Thank you for check on me. :) I'm focusing on WSS for the moment, but I've
tested the code that works on WSS on two different SPS servers, both returns
the same thing for the Get Manifest method, which I noticed that the they
are all sites directories or news areas, which are all created by portal
templates, and they are not hierarchical. Non of the sites created by WSS
templates are listed. I got a gut feeling that FrontPage RPC don't work well
with SPS, but have to investigate further to confirm.
"Wei-Dong XU [MSFT]" <v-wdxu@online.microsoft.com> wrote in message
news:pHLhgYE5FHA.1144@TK2MSFTNGXA01.phx.gbl...
| Quote: |
Hi Kit Kai,
How are you? I am just checking if there is anything further we can do for
you. If so, please let me know.
Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no
rights.
It is my pleasure to be of assistance. |
|
|
| Back to top |
|
 |
Wei-Dong XU [MSFT]
Guest
|
Posted:
Wed Nov 09, 2005 1:51 pm Post subject:
Re: Is there any difference in invoking FrontPageRPC in SPS |
|
|
Hi Kit kai,
For the better understanding and research on this issue, I write the sample
code below to retrive the manifest. Please use my sample code on this issue:
////////////////////////////////////////////////////////////////////////
private void GetManifest(string url)
{
Uri uri = new Uri(url);
string method = "get manifest:6.0.2.5523";
string serviceName = uri.AbsolutePath;
//please notice here. I only use the globalLists, what's your options.
Thanks!
string options = "globallists";
string fpRPCCallStr =
"method={0}&service_name={1}&options={2}";
method = HttpUtility.UrlEncode(method);
serviceName = HttpUtility.UrlEncode(serviceName);
options = HttpUtility.UrlEncode(options);
fpRPCCallStr =
string.Format(fpRPCCallStr, method, serviceName, options);
fpRPCCallStr.Replace(".", "%2e");
fpRPCCallStr.Replace("_", "%5f");
byte[] fpRPCCall = Encoding.UTF8.GetBytes(fpRPCCallStr);
byte[] data = new byte[fpRPCCall.Length + 1];
fpRPCCall.CopyTo(data, 0);
data[fpRPCCall.Length] = 0x0A;
WebClient webClient = null;
byte[] returnData = null;
bool bReturn = true;
try
{
webClient = new WebClient();
webClient.Credentials = CredentialCache.DefaultCredentials;
webClient.Headers.Add(
"Content-Type",
"application/x-www-form-urlencoded");
webClient.Headers.Add(
"X-Vermeer-Content-Type",
"application/x-www-form-urlencoded");
returnData = webClient.UploadData(
url +
"/_vti_bin/_vti_adm/admin.dll",
"POST",
data);
}
catch (Exception exp)
{
MessageBox.Show(exp.Message);
}
finally
{
if (webClient != null)
webClient.Dispose();
}
string returnText =
System.Text.Encoding.UTF8.GetString(returnData);
}
////////////////////////////////////////////////////////////////////////
Expect to your update!
Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no rights.
It is my pleasure to be of assistance. |
|
| Back to top |
|
 |
Loke Kit Kai [MVP]
Guest
|
Posted:
Fri Nov 11, 2005 9:51 am Post subject:
Re: Is there any difference in invoking FrontPageRPC in SPS |
|
|
Hi Wei-Dong,
Currently, I have an urgent assignment to attend to. Will get back to you
once the urgent assignment is completed within these two days. Thanks :)
"Wei-Dong XU [MSFT]" <v-wdxu@online.microsoft.com> wrote in message
news:bwkWb3S5FHA.1236@TK2MSFTNGXA02.phx.gbl...
| Quote: |
Hi Kit kai,
For the better understanding and research on this issue, I write the
sample
code below to retrive the manifest. Please use my sample code on this
issue:
////////////////////////////////////////////////////////////////////////
private void GetManifest(string url)
{
Uri uri = new Uri(url);
string method = "get manifest:6.0.2.5523";
string serviceName = uri.AbsolutePath;
//please notice here. I only use the globalLists, what's your options.
Thanks!
string options = "globallists";
string fpRPCCallStr =
"method={0}&service_name={1}&options={2}";
method = HttpUtility.UrlEncode(method);
serviceName = HttpUtility.UrlEncode(serviceName);
options = HttpUtility.UrlEncode(options);
fpRPCCallStr =
string.Format(fpRPCCallStr, method, serviceName, options);
fpRPCCallStr.Replace(".", "%2e");
fpRPCCallStr.Replace("_", "%5f");
byte[] fpRPCCall = Encoding.UTF8.GetBytes(fpRPCCallStr);
byte[] data = new byte[fpRPCCall.Length + 1];
fpRPCCall.CopyTo(data, 0);
data[fpRPCCall.Length] = 0x0A;
WebClient webClient = null;
byte[] returnData = null;
bool bReturn = true;
try
{
webClient = new WebClient();
webClient.Credentials = CredentialCache.DefaultCredentials;
webClient.Headers.Add(
"Content-Type",
"application/x-www-form-urlencoded");
webClient.Headers.Add(
"X-Vermeer-Content-Type",
"application/x-www-form-urlencoded");
returnData = webClient.UploadData(
url +
"/_vti_bin/_vti_adm/admin.dll",
"POST",
data);
}
catch (Exception exp)
{
MessageBox.Show(exp.Message);
}
finally
{
if (webClient != null)
webClient.Dispose();
}
string returnText =
System.Text.Encoding.UTF8.GetString(returnData);
}
////////////////////////////////////////////////////////////////////////
Expect to your update!
Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no
rights.
It is my pleasure to be of assistance. |
|
|
| Back to top |
|
 |
Wei-Dong XU [MSFT]
Guest
|
Posted:
Fri Nov 11, 2005 1:51 pm Post subject:
Re: Is there any difference in invoking FrontPageRPC in SPS |
|
|
Please Feel free on your business! :-) Have a nice weekend!
Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no rights.
It is my pleasure to be of assistance. |
|
| Back to top |
|
 |
|
|
|
|