🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.bazy-danych.msaccess
6 messages
6 total messages Started by md Wed, 05 Dec 2012 12:52
moduł klasy do obsługi usługi SOAP
#135765
Author: md
Date: Wed, 05 Dec 2012 12:52
184 lines
6484 bytes
Witam wszystkich

proszę o pomoc w takim przypadku:

za pomocą  web toolkit wygenerowałem moduł klasy jak niżej
usługa w odpowiedzi na zapytanie powinna zwrócić identyfikator sesji klienta 
oraz identyfikator sesji autoryzacyjnej

wywołanie w moim wykonaniu wygląda tak  ale nie działa poprawnie


Function wywolanie()
On Error GoTo blad



    Dim MyIXMLDOMNodeListVar As MSXML2.IXMLDOMNodeList
    Dim xmlDoc As New MSXML2.DOMDocument30
    Dim myXml As String
    Dim nowa_autoryzacja As clsws_Auth
    Dim odpowiedz As String

    myXml = tak jak w załączonym powyżej przykładzie


        xmlDoc.LoadXml (myXml)
        'xmlDoc.async = False

        If (xmlDoc.parseError.errorCode <> 0) Then
           Dim myErr
           Set myErr = xmlDoc.parseError
           MsgBox ("You have error " & myErr.reason)
           GoTo wyjscie
        Else
           Set MyIXMLDOMNodeListVar = 
xmlDoc.getElementsByTagName("auth:login")
        End If


        Set nowa_autoryzacja = New clsws_Auth
        With nowa_autoryzacja
            odpowiedz = .wsm_login(MyIXMLDOMNodeListVar)??? ale nie dział
            MsgBox odpowiedz
        End With


zamieszczony w dokumentacji  plik xml  wygląda następująco:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:auth="http://xml.kamsoft.pl/ws/kaas/login_types">
   <soapenv:Header/>
   <soapenv:Body>
			 <auth:login>
				<auth:credentials>
					<auth:item>
						<auth:name>domain</auth:name>
						<auth:value><auth:stringValue>01</auth:stringValue></auth:value>
					</auth:item>
					<auth:item>
						<auth:name>type</auth:name>
						<auth:value><auth:stringValue>SWD</auth:stringValue></auth:value>
					</auth:item>
					<auth:item>
						<auth:name>idntSwd</auth:name>
						<auth:value><auth:stringValue>123456789</auth:stringValue></auth:value>
					</auth:item>
					<auth:item>
						<auth:name>login</auth:name>
						<auth:value><auth:stringValue>TEST</auth:stringValue></auth:value>
					</auth:item>
				</auth:credentials>
		            	<auth:password>qwerty!@#</auth:password>
			</auth:login>
   </soapenv:Body>
</soapenv:Envelope>
Option Compare Database
Option Explicit

Private sc_Auth As SoapClient30
Private Const c_WSDL_URL As String = 
"https://ewus.nfz.gov.pl/ws-broker-server-ewus-auth-test/services/Auth?wsdl"
Private Const c_SERVICE As String = "Auth"
Private Const c_PORT As String = "Auth"
Private Const c_SERVICE_NAMESPACE As String = 
"http://xml.kamsoft.pl/ws/auth"

Private Sub Class_Initialize()

    Dim str_WSML As String
    str_WSML = ""
    'str_WSML = "<servicemapping>"
    'str_WSML = str_WSML & "<service name='Auth'>"
    'str_WSML = str_WSML & "<using 
PROGID='MSOSOAP.GenericCustomTypeMapper30' cachable='0' ID='GCTM'/>"
    'str_WSML = str_WSML & "<types>"
    'str_WSML = str_WSML & "<type name='changePasswordParams' 
targetNamespace='http://xml.kamsoft.pl/ws/auth' uses='GCTM' 
targetClassName='struct_changePasswordParams'/>"
    'str_WSML = str_WSML & "<type name='loginParam' 
targetNamespace='http://xml.kamsoft.pl/ws/auth' uses='GCTM' 
targetClassName='struct_loginParam'/>"
    'str_WSML = str_WSML & "<type name='loginRequest' 
targetNamespace='http://xml.kamsoft.pl/ws/auth' uses='GCTM' 
targetClassName='struct_loginRequest'/>"
    'str_WSML = str_WSML & "<type name='paramValue' 
targetNamespace='http://xml.kamsoft.pl/ws/auth' uses='GCTM' 
targetClassName='struct_paramValue'/>"
    'str_WSML = str_WSML & "</types>"
    'str_WSML = str_WSML & "</service>"
    'str_WSML = str_WSML & "</servicemapping>"

    Set sc_Auth = New SoapClient30
    sc_Auth.MSSoapInit2 c_WSDL_URL, str_WSML, c_SERVICE, c_PORT, 
c_SERVICE_NAMESPACE
    sc_Auth.ConnectorProperty("ProxyServer") = "<CURRENT_USER>"
    sc_Auth.ConnectorProperty("EnableAutoProxy") = True


End Sub

Private Sub Class_Terminate()
On Error GoTo Class_TerminateTrap

    Set sc_Auth = Nothing

Exit Sub

Class_TerminateTrap:
    AuthErrorHandler ("Class_Terminate")
End Sub

Private Sub AuthErrorHandler(str_Function As String)

    'SOAP Error
    If sc_Auth.FaultCode <> "" Then
        Err.Raise vbObjectError, str_Function, sc_Auth.FaultString
    'Non SOAP Error
    Else
        Err.Raise Err.Number, str_Function, Err.Description
    End If

End Sub

Public Function wsm_login(ByVal any_login As MSXML2.IXMLDOMNodeList) As 
String
On Error GoTo wsm_loginTrap

    wsm_login = sc_Auth.login(any_login)

Exit Function
wsm_loginTrap:
    AuthErrorHandler "wsm_login"
End Function

Public Function wsm_logout(ByVal str_logout As String) As String
On Error GoTo wsm_logoutTrap

    wsm_logout = sc_Auth.logout(str_logout)

Exit Function
wsm_logoutTrap:
    AuthErrorHandler "wsm_logout"
End Function

Public Function wsm_changePassword(ByVal any_changePassword As 
MSXML2.IXMLDOMNodeList) As String
On Error GoTo wsm_changePasswordTrap

    wsm_changePassword = sc_Auth.changePassword(any_changePassword)

Exit Function
wsm_changePasswordTrap:
    AuthErrorHandler "wsm_changePassword"
End Function

Public Function wsm_changePasswordLog(ByVal any_changePasswordLog As 
MSXML2.IXMLDOMNodeList) As String
On Error GoTo wsm_changePasswordLogTrap

    wsm_changePasswordLog = sc_Auth.changePasswordLog(any_changePasswordLog)

Exit Function
wsm_changePasswordLogTrap:
    AuthErrorHandler "wsm_changePasswordLog"
End Function
Re: moduł klasy do obsługi usługi SOAP
#135766
Author: Jacek
Date: Wed, 05 Dec 2012 14:53
2 lines
1047 bytes
Ja taki problem rozwiązałem, że napisałem SOAP w VB.NET, który pakuje ma
dane do mdb. O wiele mniej problemów i o wiele łatwiej.
Re: moduł klasy do obsługi usługi SOAP
#135767
Author: Smyk
Date: Mon, 10 Dec 2012 10:07
17 lines
1183 bytes
md wrote at Mittwoch, 5. Dezember 2012 13:52:

> str_WSML = ""
> 'str_WSML = "<servicemapping>"
> ...
> 'str_WSML = str_WSML & "</servicemapping>"
> 
> Set sc_Auth = New SoapClient30
> sc_Auth.MSSoapInit2 c_WSDL_URL, str_WSML, _
>    c_SERVICE, c_PORT, c_SERVICE_NAMESPACE

W takim stanie jak zacytowałeś inicjalizujesz
objekt sc_Auth pustym Stringiem str_WSMML. Nie znam
dokładnie maszynerii MSSOAP, ale tak to chyba żaden SOAP
nie będzie działał ... 

Smyk
Re: moduł klasy do obsługi usługi SOAP
#135768
Author: md
Date: Wed, 12 Dec 2012 11:19
23 lines
1742 bytes
ten akurat tak działa
bo z pełnym stringiem zwraca błąd serwera

Użytkownik "Smyk" <duzy.trzmiel@onet.pl> napisał w wiadomości 
news:ailqifF5r2jU1@mid.uni-berlin.de...
> md wrote at Mittwoch, 5. Dezember 2012 13:52:
>
>> str_WSML = ""
>> 'str_WSML = "<servicemapping>"
>> ...
>> 'str_WSML = str_WSML & "</servicemapping>"
>>
>> Set sc_Auth = New SoapClient30
>> sc_Auth.MSSoapInit2 c_WSDL_URL, str_WSML, _
>>    c_SERVICE, c_PORT, c_SERVICE_NAMESPACE
>
> W takim stanie jak zacytowałeś inicjalizujesz
> objekt sc_Auth pustym Stringiem str_WSMML. Nie znam
> dokładnie maszynerii MSSOAP, ale tak to chyba żaden SOAP
> nie będzie działał ...
>
> Smyk
> 
Re: moduł klasy do obsługi usługi SOAP
#135770
Author: md
Date: Thu, 13 Dec 2012 18:49
196 lines
6957 bytes
temat zamknięty, znalazłem rozwiązanie
dziękuję za maile
md



Użytkownik "md" <bmkd@poczta.onet.pl> napisał w wiadomości 
news:50bf438a$0$1311$65785112@news.neostrada.pl...
> Witam wszystkich
>
> proszę o pomoc w takim przypadku:
>
> za pomocą  web toolkit wygenerowałem moduł klasy jak niżej
> usługa w odpowiedzi na zapytanie powinna zwrócić identyfikator sesji 
> klienta oraz identyfikator sesji autoryzacyjnej
>
> wywołanie w moim wykonaniu wygląda tak  ale nie działa poprawnie
>
>
> Function wywolanie()
> On Error GoTo blad
>
>
>
>    Dim MyIXMLDOMNodeListVar As MSXML2.IXMLDOMNodeList
>    Dim xmlDoc As New MSXML2.DOMDocument30
>    Dim myXml As String
>    Dim nowa_autoryzacja As clsws_Auth
>    Dim odpowiedz As String
>
>    myXml = tak jak w załączonym powyżej przykładzie
>
>
>        xmlDoc.LoadXml (myXml)
>        'xmlDoc.async = False
>
>        If (xmlDoc.parseError.errorCode <> 0) Then
>           Dim myErr
>           Set myErr = xmlDoc.parseError
>           MsgBox ("You have error " & myErr.reason)
>           GoTo wyjscie
>        Else
>           Set MyIXMLDOMNodeListVar = 
> xmlDoc.getElementsByTagName("auth:login")
>        End If
>
>
>        Set nowa_autoryzacja = New clsws_Auth
>        With nowa_autoryzacja
>            odpowiedz = .wsm_login(MyIXMLDOMNodeListVar)??? ale nie dział
>            MsgBox odpowiedz
>        End With
>
>
> zamieszczony w dokumentacji  plik xml  wygląda następująco:
> <soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:auth="http://xml.kamsoft.pl/ws/kaas/login_types">
>   <soapenv:Header/>
>   <soapenv:Body>
> <auth:login>
> <auth:credentials>
> <auth:item>
> <auth:name>domain</auth:name>
> <auth:value><auth:stringValue>01</auth:stringValue></auth:value>
> </auth:item>
> <auth:item>
> <auth:name>type</auth:name>
> <auth:value><auth:stringValue>SWD</auth:stringValue></auth:value>
> </auth:item>
> <auth:item>
> <auth:name>idntSwd</auth:name>
> <auth:value><auth:stringValue>123456789</auth:stringValue></auth:value>
> </auth:item>
> <auth:item>
> <auth:name>login</auth:name>
> <auth:value><auth:stringValue>TEST</auth:stringValue></auth:value>
> </auth:item>
> </auth:credentials>
>             <auth:password>qwerty!@#</auth:password>
> </auth:login>
>   </soapenv:Body>
> </soapenv:Envelope>
> Option Compare Database
> Option Explicit
>
> Private sc_Auth As SoapClient30
> Private Const c_WSDL_URL As String = 
> "https://ewus.nfz.gov.pl/ws-broker-server-ewus-auth-test/services/Auth?wsdl"
> Private Const c_SERVICE As String = "Auth"
> Private Const c_PORT As String = "Auth"
> Private Const c_SERVICE_NAMESPACE As String = 
> "http://xml.kamsoft.pl/ws/auth"
>
> Private Sub Class_Initialize()
>
>    Dim str_WSML As String
>    str_WSML = ""
>    'str_WSML = "<servicemapping>"
>    'str_WSML = str_WSML & "<service name='Auth'>"
>    'str_WSML = str_WSML & "<using 
> PROGID='MSOSOAP.GenericCustomTypeMapper30' cachable='0' ID='GCTM'/>"
>    'str_WSML = str_WSML & "<types>"
>    'str_WSML = str_WSML & "<type name='changePasswordParams' 
> targetNamespace='http://xml.kamsoft.pl/ws/auth' uses='GCTM' 
> targetClassName='struct_changePasswordParams'/>"
>    'str_WSML = str_WSML & "<type name='loginParam' 
> targetNamespace='http://xml.kamsoft.pl/ws/auth' uses='GCTM' 
> targetClassName='struct_loginParam'/>"
>    'str_WSML = str_WSML & "<type name='loginRequest' 
> targetNamespace='http://xml.kamsoft.pl/ws/auth' uses='GCTM' 
> targetClassName='struct_loginRequest'/>"
>    'str_WSML = str_WSML & "<type name='paramValue' 
> targetNamespace='http://xml.kamsoft.pl/ws/auth' uses='GCTM' 
> targetClassName='struct_paramValue'/>"
>    'str_WSML = str_WSML & "</types>"
>    'str_WSML = str_WSML & "</service>"
>    'str_WSML = str_WSML & "</servicemapping>"
>
>    Set sc_Auth = New SoapClient30
>    sc_Auth.MSSoapInit2 c_WSDL_URL, str_WSML, c_SERVICE, c_PORT, 
> c_SERVICE_NAMESPACE
>    sc_Auth.ConnectorProperty("ProxyServer") = "<CURRENT_USER>"
>    sc_Auth.ConnectorProperty("EnableAutoProxy") = True
>
>
> End Sub
>
> Private Sub Class_Terminate()
> On Error GoTo Class_TerminateTrap
>
>    Set sc_Auth = Nothing
>
> Exit Sub
>
> Class_TerminateTrap:
>    AuthErrorHandler ("Class_Terminate")
> End Sub
>
> Private Sub AuthErrorHandler(str_Function As String)
>
>    'SOAP Error
>    If sc_Auth.FaultCode <> "" Then
>        Err.Raise vbObjectError, str_Function, sc_Auth.FaultString
>    'Non SOAP Error
>    Else
>        Err.Raise Err.Number, str_Function, Err.Description
>    End If
>
> End Sub
>
> Public Function wsm_login(ByVal any_login As MSXML2.IXMLDOMNodeList) As 
> String
> On Error GoTo wsm_loginTrap
>
>    wsm_login = sc_Auth.login(any_login)
>
> Exit Function
> wsm_loginTrap:
>    AuthErrorHandler "wsm_login"
> End Function
>
> Public Function wsm_logout(ByVal str_logout As String) As String
> On Error GoTo wsm_logoutTrap
>
>    wsm_logout = sc_Auth.logout(str_logout)
>
> Exit Function
> wsm_logoutTrap:
>    AuthErrorHandler "wsm_logout"
> End Function
>
> Public Function wsm_changePassword(ByVal any_changePassword As 
> MSXML2.IXMLDOMNodeList) As String
> On Error GoTo wsm_changePasswordTrap
>
>    wsm_changePassword = sc_Auth.changePassword(any_changePassword)
>
> Exit Function
> wsm_changePasswordTrap:
>    AuthErrorHandler "wsm_changePassword"
> End Function
>
> Public Function wsm_changePasswordLog(ByVal any_changePasswordLog As 
> MSXML2.IXMLDOMNodeList) As String
> On Error GoTo wsm_changePasswordLogTrap
>
>    wsm_changePasswordLog = 
> sc_Auth.changePasswordLog(any_changePasswordLog)
>
> Exit Function
> wsm_changePasswordLogTrap:
>    AuthErrorHandler "wsm_changePasswordLog"
> End Function
>
> 
Re: moduł klasy do obsługi usługi SOAP
#135773
Author: pawel.halas79
Date: Tue, 13 Jan 2015 20:24
4 lines
1494 bytes
Witam,
MA ktoś może u siebie w Access wdrożone sprawdzanie pacjentów w eWuś?
Proszę o kontakt pablo_01@interia.pl
Pozdrawiam
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads