Ejemplo n.º 1
0
CWSDLMessage * CWSDLPortTypeIO::GetMessage()
{
	if (m_pMessage != NULL)
	{
		return m_pMessage;
	}

	CXMLDocument *pDoc = GetParentDocument();
	if (pDoc != NULL)
	{
		CStringW strUri;
		if (SUCCEEDED(GetNamespaceUri(m_message.GetPrefix(), strUri)))
		{
			if (strUri == pDoc->GetTargetNamespace())
			{
				if (pDoc->GetDocumentType() == WSDLDOC)
				{
					CWSDLDocument *pWSDLDoc = static_cast<CWSDLDocument *>(pDoc);
					m_pMessage = pWSDLDoc->GetMessage(m_message.GetName());
					if (m_pMessage == NULL)
					{
						EmitFileError(IDS_SDL_UNRESOLVED_ELEM2, const_cast<CWSDLPortTypeIO *>(this), 0,
							"message", strUri, m_message.GetName());
					}
				}
			}
		}
		else
		{
			EmitFileError(IDS_SDL_UNRESOLVED_NAMESPACE, const_cast<CWSDLPortTypeIO *>(this), 0, m_message.GetPrefix());
		}
	}

	return m_pMessage;
}
Ejemplo n.º 2
0
CWSDLBinding * CWSDLPort::GetBinding()
{
	if (m_pBinding != NULL)
	{
		return m_pBinding;
	}

	CXMLDocument *pDoc = GetParentDocument();
	if (pDoc != NULL)
	{
		CStringW strUri;
		if (SUCCEEDED(GetNamespaceUri(m_binding.GetPrefix(), strUri)))
		{
			if (strUri == pDoc->GetTargetNamespace())
			{
				if (pDoc->GetDocumentType() == WSDLDOC)
				{
					CWSDLDocument *pWSDLDoc = static_cast<CWSDLDocument *>(pDoc);
					m_pBinding = pWSDLDoc->GetBinding(m_binding.GetName());
					if (m_pBinding == NULL)
					{
						EmitFileError(IDS_SDL_UNRESOLVED_ELEM2, const_cast<CWSDLPort *>(this), 0,
							"binding", strUri, m_binding.GetName());
					}
				}
			}
			else
			{
				EmitFileError(IDS_SDL_UNRESOLVED_ELEM2, const_cast<CWSDLPort *>(this), 0, "binding", strUri, m_binding.GetName());
			}
		}
		else
		{
			EmitFileError(IDS_SDL_UNRESOLVED_NAMESPACE, const_cast<CWSDLPort *>(this), 0, m_binding.GetPrefix());
		}
	}

	return m_pBinding;
}