J'ai un problème avec une méthode web oneway qui ouvrent un site de mousse (probablement parce que dans un sens unique WEBMETHOD le contexte est nul)webservice oneway et nouvelle SPSite (myurl)
est possible de réécrire ce code pour supprimer la Exception de référence nulle? (Sans l'attribut oneway je n'ai pas l'exception)
[SoapDocumentMethod(OneWay = true)]
[WebMethod(Description = "TestOneWay")]
public voidTestOneWay(string webUrl)
{
using (SPSite site = new SPSite(webUrl))
{
....
}
}
l'exception est la suivante:
[2304] Error:Object reference not set to an instance of an object.
[2304] w3wp.exe Error: 0 :
[2304StackTrace: at System.Web.Hosting.ISAPIWorkerRequestInProc.GetAdditionalServerVar(Int32 index)
[2304] at System.Web.Hosting.ISAPIWorkerRequestInProc.GetServerVariable(String name)
[2304] at System.Web.HttpRequest.AddServerVariableToCollection(String name)
[2304] at System.Web.HttpRequest.FillInServerVariablesCollection()
[2304] at System.Web.HttpServerVarsCollection.Populate()
[2304] at System.Web.HttpServerVarsCollection.Get(String name)
[2304] at System.Collections.Specialized.NameValueCollection.get_Item(String name)
[2304] at Microsoft.SharePoint.SPGlobal.CreateSPRequestAndSetIdentity(Boolean bNotGlobalAdminCode, String strUrl, Boolean bNotAddToContext, Byte[] UserToken, String userName, Boolean bIgnoreTokenTimeout, Boolean bAsAnonymous)
[2304] at Microsoft.SharePoint.SPRequestManager.GetContextRequest(SPRequestAuthenticationMode authenticationMode)
[2304] at Microsoft.SharePoint.Administration.SPFarm.get_RequestNoAuth()
[2304] at Microsoft.SharePoint.SPSite.CopyUserToken(SPUserToken userToken)
[2304] at Microsoft.SharePoint.SPSite.SPSiteConstructor(SPFarm farm, Guid applicationId, Guid contentDatabaseId, Guid siteId, SPUrlZone zone, Uri requestUri, String serverRelativeUrl, Boolean hostHeaderIsSiteName, Uri redirectUri, Pairing pairing, SPUserToken userToken)
[2304] at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, SPUserToken userToken)
[2304] at Microsoft.SharePoint.SPSite..ctor(String requestUrl)
[2304] at Reply.Moss2EAI.SPHandler.GetAllFlowConfiguration(String webUrl, String flowConList)
[2304] at Reply.Moss2EAI.EaiMossIntegration.GetMessagesFromEai(String webUrl, String listName, String applicationName)