Web service strange behaviour

delphi

(Massimiliano Coros) #1

Hi, I’m still working on the web service, now I have another problem. My WS must be accessed from a client developed by another person. Attached there are the wsdl generated by the WS, the SOAP xml file generated according with wsdl and a SOAP xml that is accepted by the WS.

xmlfiles.zip (3,4 KB)

The problem is that the xml file generated in according with the wsdl isn’t accepted from the WS.
As written in the WSDL the arrays must be serializated in:

    <VisitDate>
      <VisitDate>20180202</VisitDate>
      <VisitDate>20180209</VisitDate>
      <VisitDate>20180216</VisitDate>
     ...
      <VisitDate>20180706</VisitDate>
    </VisitDate>

but the WS accept the arrays written in the following way

<VisitDate>20170817</VisitDate>
<VisitDate>20170907</VisitDate>
<VisitDate>20171005</VisitDate>
...
<VisitDate>20180411</VisitDate>

I don’t understand why.

Could you help me?


(EvgenyK) #2

that person tried to update his client according to your wsdl ?


(Massimiliano Coros) #3

Yes but as I told in the previous message when it use the wsdl the xml is generated in that way
< VisitDate>
< VisitDate>20180411</ VisitDate>
….

</ VisitDate>

If i try to import it with delphi and use standard delphi components I have the same problem, i must streep away the first < VisitDate> item. And according with the wsdl the right way is that is shown above.


(EvgenyK) #4

why they can’t generate xml according to your wsdl?
btw, you can put code/xml as is between ``` like

```
<VisitDate>
```

(Massimiliano Coros) #5

the code generated using the wsdl produce the “wrong” xml.

 <VisitDate>
    <VisitDate>20180216<\VisitDate>
   …
 <\VisitDate>

all the arrays are serializated in that way, but the service don’t accept them. I don’t understand why the service generate a wsdl but accept a different input.


(EvgenyK) #6

can you create a simple testcase, pls?
your previous one contained AV…


(Massimiliano Coros) #7

Sure the test case is the same that you have alredy seen. the Test client application use the wsdl as created from the service and use standard delphi components and generate a xml like described previously.

(clikking on test 2 button give an error in deserialization of the array INR)

WS Test.rar (362,4 KB)


(EvgenyK) #8

can you fix AV in project?

for example


function TZEUSWS.CreaArrayDistribuzione(Distribuzione : String) : DailyDosage;
var i : Integer;
    ADistribuzione : Array Of Integer;
begin
  i := 0;
  while length(Distribuzione) <> 0 do
   begin
    Result.Add(StrToInt(copy(Distribuzione,1,pos(';',Distribuzione) - 1)));
    Delete(Distribuzione,1,pos(';',Distribuzione));
   end;
end;

here result is nil so you do

nil.Add(StrToInt(copy(Distribuzione,1,pos(';',Distribuzione) - 1)));

(Massimiliano Coros) #9

I’m sorry but I don’t understand what I must do?

if you run the ws and run the testclient application when you click on test 2 button you can see what appen.


(EvgenyK) #10

your testcase contains errors, for example, in TZEUSWS.CreaArrayDistribuzione method you missed line like result := DailyDosage.Create; and it causes problems in run-time. I wonder how your testcase worked …


(Massimiliano Coros) #11

Simply because that portion of code isn’t called before the error. I.e. the deserialization error occurs before that that code is called.
Have you clicked on the test2 button?


(Massimiliano Coros) #12

As you have requested I’ve corrected the “error” but obviously the deserialization error is still here :slight_smile:

WS Test new.rar (366,5 KB)

This is the error that comes up when I click on the “Test 2” button, as you can see the INR array is deserializated in the wrong way. (you must use the testclient application to get the error)


(EvgenyK) #13

it works for me:

  • for code-first based:
test1
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:HNS="http://tempuri.org/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://tempuri.org/">
  <SOAP-ENV:Header>
    <ROClientIDHeader SOAP-ENV:mustUnderstand="0" xmlns="http://tempuri.org/">
      <ID>{12A85BB8-5580-4EC6-AC56-199178602DC6}</ID>
    </ROClientIDHeader>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body xmlns:ro="http://tempuri.org/">
    <v1:ZEUSWS___GetRepartitionResponse>
      <v1:Result>
        <v1:FunctionResult>true</v1:FunctionResult>
        <v1:WeeklyDosageAfterValidation>50</v1:WeeklyDosageAfterValidation>
        <v1:CalculatedDailyDosage>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
        </v1:CalculatedDailyDosage>
        <v1:NewNote/>
      </v1:Result>
    </v1:ZEUSWS___GetRepartitionResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
test2
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:HNS="http://tempuri.org/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://tempuri.org/">
  <SOAP-ENV:Header>
    <ROClientIDHeader SOAP-ENV:mustUnderstand="0" xmlns="http://tempuri.org/">
      <ID>{B7C21CA8-92B2-42D2-A3B1-2D251692548E}</ID>
    </ROClientIDHeader>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body xmlns:ro="http://tempuri.org/">
    <v1:ZEUSWS___GetProposalResponse>
      <v1:GetProposalReturn>
        <v1:FunctionResult>true</v1:FunctionResult>
        <v1:CalculatedWeeklyDosage>0</v1:CalculatedWeeklyDosage>
        <v1:CalculatedDailyRepartitionHigh>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
        </v1:CalculatedDailyRepartitionHigh>
        <v1:CalculatedDailyRepartitionNormal>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
        </v1:CalculatedDailyRepartitionNormal>
        <v1:CalculatedDailyRepartitionLow>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
        </v1:CalculatedDailyRepartitionLow>
        <v1:CalculatedExternalnote/>
        <v1:CalculatedNextControlDate>20180501</v1:CalculatedNextControlDate>
        <v1:NotifyNextVisitOnSunday>false</v1:NotifyNextVisitOnSunday>
        <v1:CalculatedFirstDayDosageHigh>0</v1:CalculatedFirstDayDosageHigh>
        <v1:CalculatedFirstDayDosageNormal>0</v1:CalculatedFirstDayDosageNormal>
        <v1:CalculatedFirstDayDosageLow>0</v1:CalculatedFirstDayDosageLow>
        <v1:RecommendedDistribution>H</v1:RecommendedDistribution>
        <v1:WeeklyDosageIncrement>40</v1:WeeklyDosageIncrement>
        <v1:EstimatedINR>0</v1:EstimatedINR>
        <v1:InternalNote/>
        <v1:NotifyUser>true</v1:NotifyUser>
      </v1:GetProposalReturn>
    </v1:ZEUSWS___GetProposalResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
  • for RODL based:
test1
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:HNS="http://tempuri.org/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://tempuri.org/">
  <SOAP-ENV:Header>
    <ROClientIDHeader SOAP-ENV:mustUnderstand="0" xmlns="http://tempuri.org/">
      <ID>{F924562F-DB88-4604-8CF7-DAFAFFAB256B}</ID>
    </ROClientIDHeader>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body xmlns:ro="http://tempuri.org/">
    <v1:ZEUSWS___GetRepartitionResponse>
      <v1:GetRepartitionReturn>
        <v1:FunctionResult>true</v1:FunctionResult>
        <v1:WeeklyDosageAfterValidation>50</v1:WeeklyDosageAfterValidation>
        <v1:CalculatedDailyDosage>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
        </v1:CalculatedDailyDosage>
        <v1:NewNote/>
      </v1:GetRepartitionReturn>
    </v1:ZEUSWS___GetRepartitionResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
test2
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:HNS="http://tempuri.org/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://tempuri.org/">
  <SOAP-ENV:Header>
    <ROClientIDHeader SOAP-ENV:mustUnderstand="0" xmlns="http://tempuri.org/">
      <ID>{F924562F-DB88-4604-8CF7-DAFAFFAB256B}</ID>
    </ROClientIDHeader>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body xmlns:ro="http://tempuri.org/">
    <v1:ZEUSWS___GetProposalResponse>
      <v1:GetProposalReturn>
        <v1:FunctionResult>true</v1:FunctionResult>
        <v1:CalculatedWeeklyDosage>0</v1:CalculatedWeeklyDosage>
        <v1:CalculatedDailyRepartitionHigh>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
        </v1:CalculatedDailyRepartitionHigh>
        <v1:CalculatedDailyRepartitionNormal>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
        </v1:CalculatedDailyRepartitionNormal>
        <v1:CalculatedDailyRepartitionLow>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
          <v1:int>5</v1:int>
        </v1:CalculatedDailyRepartitionLow>
        <v1:CalculatedExternalnote/>
        <v1:CalculatedNextControlDate>20180501</v1:CalculatedNextControlDate>
        <v1:NotifyNextVisitOnSunday>false</v1:NotifyNextVisitOnSunday>
        <v1:CalculatedFirstDayDosageHigh>0</v1:CalculatedFirstDayDosageHigh>
        <v1:CalculatedFirstDayDosageNormal>0</v1:CalculatedFirstDayDosageNormal>
        <v1:CalculatedFirstDayDosageLow>0</v1:CalculatedFirstDayDosageLow>
        <v1:RecommendedDistribution>H</v1:RecommendedDistribution>
        <v1:WeeklyDosageIncrement>40</v1:WeeklyDosageIncrement>
        <v1:EstimatedINR>0</v1:EstimatedINR>
        <v1:InternalNote/>
        <v1:NotifyUser>true</v1:NotifyUser>
      </v1:GetProposalReturn>
    </v1:ZEUSWS___GetProposalResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

testcase.zip (375.7 KB)


(Massimiliano Coros) #14

I see that the code that you have sent back to me works… the question is what have you changed? I’ve tryed the code that I’ve sent to you and it don’t work… where is my fault?


(EvgenyK) #15

I’ve removed SOAP attributes. I’ve posted this RODL earlier


(Massimiliano Coros) #16

Yes I’ve seen but now when I try to get the wsdl from the service I receive the following error:

i’ve put inside my browser http://localhost:8099/SOAP

{3B9B27D4-8858-45CB-8941-D7822196FCFE}EResNotFoundResource RODLFILE not found

I’m going really mad…


(EvgenyK) #17

remove/comment {$undef RO_RTTI_Support} in ZEUSWS_Impl.pas.
I’ve used it for generation results from RODL-based server


(Massimiliano Coros) #18

thank’s for your help finally it’s works. Could you explain to me why with soap attributes the service don’t work?


(EvgenyK) #19

these attributes are mainly used for connecting RO client to 3rd party non-RO soap services.
RO client and RO server can perfectly work w/o them.


(Massimiliano Coros) #20

Understood, but I as told before now there is another developer (another company) that must build a client for the WS, and he don’t use RO, there is going to be troubles?