WSS પ્રતિ SSRS વેબ સેવાઓ આવાહન કરતો / FBA પર્યાવરણ માં MOSS

We needed to invoke the "CreateSubscription" method on an SSRS web service that is hosted in an FBA managed MOSS environment from a custom web part. We kept getting variations of:

  • 401: અધિકૃત નથી
  • ઑબ્જેક્ટ ખસેડ્યું

The "object moved" message was most interesting because it was saying that the "object" (અમારા SSRS સેવા) had "moved" to login.aspx. This clearly meant we had some kind of authentication problem.

હું આખરે હું હતી સમજાયું કે બુકમાર્ક બ્લૉગ એન્ટ્રી by Robert Garret that described how to invoke a general purpose WSS/MOSS web service living inside an FBA environment. Note that I can’t link directly to the article (ના 06/09/08) because it wants to authenticate. The link I provide brings you to an "all posts" view and you can locate the specific article by searching for "Accessing MOSS Web Services using Forms Based Authentication".

અહીં અમારા માટે કામ કર્યું હતું કે કોડ છે:

ReportingService2006 રૂ. = શૂન્ય; 
// પ્રમાણિત કરવું પ્રમાણીકરણ પ્રમાણીકરણ = નવું પ્રમાણીકરણ(); 
auth.Url = "HTTP://URL / _vti_bin / Authentication.asmx";
auth.CookieContainer =
નવું CookieContainer();
LoginResult પરિણામે = auth.login("userid", "password");
જો (result.ErrorCode == LoginErrorCode.NoError) 
{
// કોઈ ભૂલ, જેથી કૂકીઝ વિચાર.
CookieCollection કૂકીઝ = auth.CookieContainer.GetCookies(નવું URI(auth.Url));
કૂકી authCookie = કૂકીઝ[result.CookieName];
રૂ. =
નવું ReportingService2006();
rs.Url =
"HTTP://server/_vti_bin/ReportServer/ReportService2006.asmx";
rs.CookieContainer =
નવું CookieContainer();
rs.CookieContainer.Add(authCookie);
}
પ્રયત્ન કરવો
{
  rs.CreateSubscription(જાણ, extSettings, DESC, eventType, matchData, parameters1);
}
ઝાલવું (અપવાદ ભૂતપૂર્વ)
{
  Console.WriteLine(ex.Message.ToString());
}

હું વસ્તુઓ આ જેમ કામ કરવા અર્થઘટન:

  • અમારા વેબ ભાગ સત્તાધિકરણ સેવા અપ ડાયલ કરો અને કહે જરૂર, "Hey, ટોની, તે મને છે!".
  • સત્તાધિકરણ સેવા જવાબો કહીને, "Hey, I know you. How are the kids? Here’s a token."
  • અમે SSRS સેવા અપ કૉલ અને કહે છે, "Tony sent me, અહીં ટોકન છે."

</અંત>

મારા બ્લોગ પર સબ્સ્ક્રાઇબ કરો.

જવાબ છોડો

તમારું ઇમેઇલ સરનામું પ્રકાશિત કરવામાં આવશે નહીં. જરૂરી ક્ષેત્રો ચિહ્નિત થયેલ છે *