Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Member Functions | Protected Attributes
nsWSDLLoader Class Reference

#include <nsWSDLLoader.h>

Inheritance diagram for nsWSDLLoader:
Inheritance graph
[legend]
Collaboration diagram for nsWSDLLoader:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsWSDLLoader ()
virtual ~nsWSDLLoader ()
NS_DECL_ISUPPORTS
NS_DECL_NSIWSDLLOADER nsresult 
Init ()
nsIWSDLPort load (in AString wsdlURI, in AString portName)
void loadAsync (in AString wsdlURI, in AString portName, in nsIWSDLLoadListener listener)

Protected Member Functions

nsresult doLoad (const nsAString &wsdlURI, const nsAString &portName, nsIWSDLLoadListener *aListener, nsIWSDLPort **_retval)
nsresult GetResolvedURI (const nsAString &aSchemaURI, const char *aMethod, nsIURI **aURI)

Protected Attributes

nsWSDLPortmPort

Detailed Description

Definition at line 79 of file nsWSDLLoader.h.


Constructor & Destructor Documentation

Definition at line 104 of file nsWSDLLoader.cpp.

{
}

Definition at line 108 of file nsWSDLLoader.cpp.

{
}

Member Function Documentation

nsresult nsWSDLLoader::doLoad ( const nsAString &  wsdlURI,
const nsAString &  portName,
nsIWSDLLoadListener aListener,
nsIWSDLPort **  _retval 
) [protected]

Definition at line 183 of file nsWSDLLoader.cpp.

{
  nsCOMPtr<nsIURI> resolvedURI;
  nsresult rv = GetResolvedURI(wsdlURI, aListener ? "loadAsync" : "load",
                               getter_AddRefs(resolvedURI));
  if (NS_FAILED(rv)) {
    return rv;
  }

  nsCOMPtr<nsIDOMEventListener> listener;
  nsWSDLLoadRequest* request = new nsWSDLLoadRequest(!aListener, aListener,
                                                     portName);
  if (!request) {
    return NS_ERROR_OUT_OF_MEMORY;
  }
  listener = request;

  nsCAutoString spec;
  resolvedURI->GetSpec(spec);

  rv = request->LoadDefinition(NS_ConvertUTF8toUCS2(spec));

  if (NS_SUCCEEDED(rv) && !aListener) {
    request->GetPort(_retval);
  }

  return rv;
}

Here is the call graph for this function:

nsresult nsWSDLLoader::GetResolvedURI ( const nsAString &  aSchemaURI,
const char *  aMethod,
nsIURI **  aURI 
) [protected]

Definition at line 131 of file nsWSDLLoader.cpp.

{
  nsresult rv;
  nsCOMPtr<nsIXPCNativeCallContext> cc;
  nsCOMPtr<nsIXPConnect> xpc(do_GetService(nsIXPConnect::GetCID()));
  if(xpc) {
    xpc->GetCurrentNativeCallContext(getter_AddRefs(cc));
  }

  if (cc) {
    JSContext* cx;
    rv = cc->GetJSContext(&cx);
    if (NS_FAILED(rv))
      return rv;

    nsCOMPtr<nsIScriptSecurityManager> secMan =
      do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv);
    if (NS_FAILED(rv))
      return rv;

    nsCOMPtr<nsIURI> baseURI;
    nsCOMPtr<nsIPrincipal> principal;
    rv = secMan->GetSubjectPrincipal(getter_AddRefs(principal));
    if (NS_SUCCEEDED(rv)) {
      principal->GetURI(getter_AddRefs(baseURI));
    }

    rv = NS_NewURI(aURI, aWSDLURI, nsnull, baseURI);
    if (NS_FAILED(rv))
      return rv;

    rv = secMan->CheckLoadURIFromScript(cx, *aURI);
    if (NS_FAILED(rv)) {
      // Security check failed. The above call set a JS exception. The
      // following lines ensure that the exception is propagated.
      cc->SetExceptionWasThrown(PR_TRUE);
      return rv;
    }
  }
  else {
    rv = NS_NewURI(aURI, aWSDLURI, nsnull);
    if (NS_FAILED(rv))
      return rv;
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 115 of file nsWSDLLoader.cpp.

{
  PRBool disabled = PR_FALSE;
  nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));
  if (prefBranch) {
    if (NS_FAILED(prefBranch->GetBoolPref("xml.xmlextras.soap.wsdl.disabled",
                                          &disabled))) {
      // We default to enabling WSDL, it'll only be disabled if
      // specificly disabled in the prefs.
      disabled = PR_FALSE;
    }
  }

  return disabled ? NS_ERROR_WSDL_NOT_ENABLED : NS_OK;
}

Here is the call graph for this function:

nsIWSDLPort nsIWSDLLoader::load ( in AString  wsdlURI,
in AString  portName 
) [inherited]
void nsIWSDLLoader::loadAsync ( in AString  wsdlURI,
in AString  portName,
in nsIWSDLLoadListener  listener 
) [inherited]

Member Data Documentation

Definition at line 98 of file nsWSDLLoader.h.


The documentation for this class was generated from the following files: