[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unresolved symbols when creating WSDL2RPG Service Program,



Mike,

It is correct that the WSDL2RPG utility takes a WSDL and generates a stub 
module that acts as a wrapper between a given RPG application and Scott's 
HTTP API and eventually the web service.

In order to figure out what parameters to set before calling the web 
service you have to have a look at the procedure prototype of the generate 
web service procedure. The name of that procedure is made of the 
"NameOfTheWebServicePort" and the "NameOfTheWebServiceOperation". Hence 
for WS0001 the name of the web service procedure is:

   ZipCodeSoap_CityStateToZipCode

It is a composition of the name of the web service port ...

  <service name="ZipCode">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";> ... 
</wsdl:documentation>
       <port name="ZipCodeSoap" binding="s0:ZipCodeSoap">
       <soap:address location="
http://www.ripedevelopment.com/webservices/ZipCode.asmx"; />
    </port>
    ...
  </service> 

... and the name of the web service operation:

  <portType name="ZipCodeSoap">
    <operation name="CityStateToZipCode">
    ...
    </operation>
    ...
  </portType>

Now let us look at the procedure prototype which is always the first 
prototype in the stub module:

 D ZipCodeSoap_CityStateToZipCode...
 D                 PR likeds(s0_CityStateToZipCodeRespon...
 D                                     se_t)
 D extproc('ZipCodeSoap_CityStateToZipC+
 D                                     ode')
 D  i_s0_CityStateToZipCode...
 D                                     likeds(s0_CityStateToZipCode_t)
 D                                     const
 D  o_msg                              like(wsdl_errText_t )

We can see that the input parameter 'i_s0_CityStateToZipCode' is a 
structure of type 's0_CityStateToZipCode_t'. Searching the module for that 
structures takes us to its reference field:

 D s0_CityStateToZipCode_t...
 D                 DS                  based(pDummy)
 D                                     qualified
 D  City                        128A   varying
 D  State                       128A   varying

Now we know that strcture 'i_s0_CityStateToZipCode' contains the sub 
fields 'City' and 'State'. Hence in a program we can use these fields like 
that:

   i_s0_CityStateToZipCode.Code  = 'Boston';
   i_s0_CityStateToZipCode.State = 'MA';

All reference fields and structures end with '_t'. These fields cannot be 
used to take data because of the 'based(pDummy)'. These fields are 
reference fields (type definitions) that are supposed to be used with 
'like' or 'likeds' to define the actual fields.

Sometimes it happens that a typeDef references another typeDef as shown 
below:

 D impl_ArrayOf_soapenc_string_t...
 D                 DS likeds(impl_RpgArrayOfArrayOf_soap...
 D                                     enc_string_t)
 D                                     based(pDummy)

In that case we just have to replace 'impl_ArrayOf_soapenc_string_t' with 
'impl_RpgArrayOfArrayOf_soapenc_string_t' when following the chain of 
references:

 D aBean           DS                  likeds(tns1_aBean_t)

So, what is  'aBean'? Well, 'aBean' is a structure of type 'tns1_aBean_t'. 
It contains a sub field 'anArray', which is a structure, too.

 D tns1_aBean_t...
 D                 DS                  based(pDummy)
 D                                     qualified
 D  anArray likeds(impl_ArrayOf_soapenc_string_t)

So far we know that 'aBean' is something like this:

 aBean.anArray.?

'anArray' is a strcture of type 'impl_ArrayOf_soapenc_string_t'. But that 
structure is of type 'impl_RpgArrayOfArrayOf_soapenc_string_t'. Hence we 
immediately can forget 'impl_ArrayOf_soapenc_string_t' and replace it with 
'impl_RpgArrayOfArrayOf_soapenc_string_t'.

 D impl_ArrayOf_soapenc_string_t...
 D                 DS likeds(impl_RpgArrayOfArrayOf_soap...
 D                                     enc_string_t)
 D                                     based(pDummy)

 D impl_RpgArrayOfArrayOf_soapenc_string_t...
 D                 DS                  based(pDummy)
 D                                     qualified
 D  x                            10I 0
 D  item                        128A   varying
 D                                     dim(DIM_A2)

Based on all the knowledge we gathered so far, 'aBean' eventually 
evaluates to that:

 aBean.anArray.x
 aBean.anArray.item()

With v1.11.1 WSDL2RPG adds the fields of the input parameter(s) to the 
test program that is generated with TYPE(*PGM).

At which statement do you receive the RNQ0222 error message? The statement 
you used to define 'parameters' looks fine to me:

> D parameters      DS likeds(tns_GetCoverOptionsRequest_t)
> D                                     inz

I assume that 'tns_GetCoverOptionsRequest_t' is the right typeDef because 
the web service input messages often end with 'Request'.

Regards,

Thomas.



ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx schrieb am 24.03.2010 22:36:28:

> Von:
> 
> Mike.Pantzopoulos@xxxxxxxxxx
> 
> An:
> 
> ftpapi@xxxxxxxxxxxxxxxxxxxxxx
> 
> Datum:
> 
> 24.03.2010 22:45
> 
> Betreff:
> 
> Re: Unresolved symbols when creating WSDL2RPG Service Program,
> 
> Gesendet von:
> 
> ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
> 
> 
> 
_______________________________________________________________________________________
> 
> Note: This e-mail is subject to the disclaimer contained at the 
> bottom of this message.
> 
_______________________________________________________________________________________
> 
> 
> No wonder that post didn't make sense. My original post didn't get 
posted!
> 
> I was originally using an article from systeminetwork (http://
> systeminetwork.com/article/call-web-service-wdsl2rpg) as my guide 
> after recommendation from Scott to use this product. When I was at 
> step 5. in the article I couldn't get the stub module created due to
> unresolved symbols. After I sent my original post which hasn't 
> appeared I was looking through the install material from the 
> WSDL2RPG zip I down-loaded and I found your WSDL2RPG-FAQ pdf.
> 
> I followed the instructions there and it all worked.
> 
> I'm really sorry for the confusion.
> 
> I have now moved forward, and have hit a new problem, which I hope 
> you can help me with.
> 
> First of all, I think that what is happening is that you have 
> written a wrapper for Scott's HTTPAPI code, by creating another 
> layer of functionality between the web server and the application 
> developer. You've used the WSDL as the driver for your code as it is
> a published standard, that all web services have to work with?
> 
> I used the WS0001 test harness as an example template and of course 
> have to set the parameters for the request. When I executed the test
> harness it crashes on the setting of the parameters values. Mine are
> different to yours of course. I have 2
> 
> Here is my definition:
> 
> D parameters      DS likeds(tns_GetCoverOptionsRequest_t)
> D                                     inz
> 
> Here is the error
> 
> RNQ0222  Pointer or parameter error (C G D F).
> 
> I presume this is because parameters is defined as LIKEDS to a DS 
> which is based and the reference hasn't been set.
> 
> I'm a little unsure of the naming conventions used and it gets 
> confusing because there is often a number of references to other 
> based data structures. Knowing the naming convention would be 
> extremely helpful and so I'm not sure if I have used the correct DS 
> for the request. But the WS0001 code looks the same, apart from the 
> DS name used.
> 
> I'm really sorry for the confusion, Thomas, and appreciate you 
> monitoring this forum.
> 
> 
> 
> 
_______________________________________________________________________________________
> 
> The information transmitted in this message and its attachments (if 
> any) is intended 
> only for the person or entity to which it is addressed.
> The message may contain confidential and/or privileged material. Any 
review, 
> retransmission, dissemination or other use of, or taking of any 
> action in reliance 
> upon this information, by persons or entities other than the 
> intended recipient is 
> prohibited.
> 
> If you have received this in error, please contact the sender and 
> delete this e-mail 
> and associated material from any computer.
> 
> The intended recipient of this e-mail may only use, reproduce, 
> disclose or distribute 
> the information contained in this e-mail and any attached files, 
> with the permission 
> of the sender.
> 
> This message has been scanned for viruses.
> 
_______________________________________________________________________________________
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------


--
IMPORTANT NOTICE:
This email is confidential, may be legally privileged, and is for the
intended recipient only. Access, disclosure, copying, distribution, or
reliance on any of it by anyone else is prohibited and may be a criminal
offence. Please delete if obtained in error and email confirmation to the sender.
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------