cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem with webservice with nested objects in parameter

Former Member
0 Likes
2,062

Hello I'm using PB 12.1 6639 / Win 7 64


Today I have a Problem consuming a webservice using the .NET engine.


The corresponding WSDL and XSD definitions can be found here:


https://finanzonline.bmf.gv.at/fonws/ws/regKasseService.wsdl

https://finanzonline.bmf.gv.at/fonws/ws/regKasseWs.xsd

https://finanzonline.bmf.gv.at/fonws/ws/regKasse.xsd


I try to call the function rkdb and get an exception with the short error message 'Validation error'.


To get closer Information I used Fiddler to look at the produced Soap envelope. Please see the attached file for the SOAP-Message.


From this I can see that the SOAP-message does not contain the full parameter information that I pass to it.

Have a look at the code I use to call the webservice:

// *** Start of code ***

rkdbrequest l_request

rkdbresponse l_response

registrierung_kasse l_kasse

try l_request = create rkdbrequest

l_request.tid = "ws_account"

l_request.benid = "ws_user1

l_request.id = "xau390xkie234AAb"

l_request.erzwinge_asynchron = false

l_request.erzwinge_asynchronspecified = true

l_request.art_uebermittlung = 0

l_kasse = create registrierung_kasse

l_kasse.satznr = as_satznr

l_kasse.kundeninfo = "John Doe"

l_kasse.kassenidentifikationsnummer = "1"

l_kasse.anmerkung = "Cashbox 1"

l_kasse.benutzerschluessel = "xe45...66==" // AES-KEY (Base64-encoded)

l_request.ws_rkdb = create rkdb

l_request.ws_rkdb.ts_erstellung = datetime(today(), now())

l_request.ws_rkdb.items[1] = l_kasse

l_response = l_rkdbservice.rkdb(l_request) // WS-Call to rkdb()

catch (soapexception e1)

Messagebox("e1", "Fehler während der Ausführung der Webservice-Funktion '" + ls_function + "' (Soapexception: '" + e1.text + "')!")

exit

end try

// *** End of code ***

As you can see, the whole information is passed in one object (l_request), that holds an array of any's (named 'items') in the member 'l_request.ws_rkdb'. I assign the object 'l_kasse' to the first item of the items-array. Now the whole information of 'l_kasse' is missing in the soap message.

In debugmode I can see all objects created well and filled with the correct values. I have also attached an Image of the imported webservice types (nvo's).

I really hope someone can help me to find the mistake! Thank you in advance

Regards Martin

View Entire Topic
Former Member
0 Likes

Hi Martin;

  Can you tell us ...

1) I assume that your using PB Classic vs PB.Net?

2) What version of MS-Windows are you using?

3) Have you tried your WS call using PB 12.6 (ie download a trial copy)?

4) Is this problem new? That is, did it work before & now just stop working?

5) I assume that your are using the .NET client in your PB Classic application (pbwsclient120.pbd)?

Regards ... Chris

Former Member
0 Likes

Hi Chris,

1,2) Yes, correct I use PB Classic on Windows 7 64bit.

3) I didn't try with PB 12.6 (don't have it on my PC), but anyway I have to get it to run in PB 12.1.

4) The webservice is new and my implementation of calling it is new, so it never worked before.

Do you have any idea?

Former Member
0 Likes

   Since you say your using the .Net implementation (which is great) and your TRY..CATCH is catching the "Validation Error" (which seems reasonable) condition ... my guess at this point is that there is a missing or invalid setting inside of L_Request or L_Kasse structures that the rkdb ( ) method is objecting to.

Are you using Fiddlier or the newer version Fiddiler2?

Former Member
0 Likes

I'm even using Fiddler 4 (latest).

Chris, thank you for that Input, but I don't think, that the values itself in l_kasse-object are the Problem, but that These values are not delivered to the webservice-function, because of they are missing in the SOAP-message (look at the attachment of the message).

In the XML - file you can see, that the members 'fastnr', 'paket_nr' and ts_'erstellung' are included under the rkdb-Tag, but the items-object is missing.

And of course, the Webservice Returns the Validation error, because it doesn't get the enough Input Parameters.

So I would say, the Problem is around PB / .Net-Engine generating the Soap-message. But i have no idea what could be wrong.

Regards Martin