MCPcopy Create free account
hub / github.com/andreikop/python-ws-discovery / _handle_hello

Method _handle_hello

wsdiscovery/discovery.py:69–86  ·  view source on GitHub ↗
(self, env, addr)

Source from the content-addressed store, hash-verified

67 self._addRemoteService(Service(match.getTypes(), match.getScopes(), match.getXAddrs(), match.getEPR(), 0))
68
69 def _handle_hello(self, env, addr):
70 #check if it is from a discovery proxy
71 rt = env.getRelationshipType()
72 if rt is not None and rt.getLocalname() == "Suppression" and rt.getNamespace() == NS_DISCOVERY:
73 xAddr = env.getXAddrs()[0]
74 #only support 'soap.udp'
75 if xAddr.startswith("soap.udp:"):
76 self._dpActive = True
77 self._dpAddr = extractSoapUdpAddressFromURI(URI(xAddr))
78 self._dpEPR = env.getEPR()
79
80 service = Service(env.getTypes(), env.getScopes(), env.getXAddrs(), env.getEPR(), 0)
81 self._addRemoteService(service)
82 if self._remoteServiceHelloCallback is not None:
83 if matchesFilter(service,
84 self._remoteServiceHelloCallbackTypesFilter,
85 self._remoteServiceHelloCallbackScopesFilter):
86 self._remoteServiceHelloCallback(service)
87
88 def _handle_bye(self, env, addr):
89 #if the bye is from discovery proxy... revert back to multicasting

Callers

nothing calls this directly

Calls 12

_addRemoteServiceMethod · 0.95
URIClass · 0.85
ServiceClass · 0.85
matchesFilterFunction · 0.85
getRelationshipTypeMethod · 0.80
getLocalnameMethod · 0.80
getNamespaceMethod · 0.80
getXAddrsMethod · 0.45
getEPRMethod · 0.45
getTypesMethod · 0.45
getScopesMethod · 0.45

Tested by

no test coverage detected