1 Reply Latest reply on Jan 15, 2013 5:56 PM by Robert Toellner

    Transforming web service parameter names.

      I am building a RhoConnect web service consumer (SOAP-based). The underlying service, created by a third party, has all of the method parameters prepended with an underscore. This makes it impossible (it appears) to create the corresponding models in the RhoMobile side of the system. Is there a way to transform the field names entered when creating the model to have that leading underscore when they are sent to the service? Here's an example of the wsdl:

       

      <xs:complexType name="DS_DELIVERYINFO">

      <xs:sequence>

      <xs:element minOccurs="0" name="_CONDITION" nillable="true" type="xs:string"/>

      <xs:element minOccurs="0" name="_DATE" nillable="true" type="xs:string"/>

      <xs:element minOccurs="0" name="_NOTES" nillable="true" type="xs:string"/>

      <xs:element minOccurs="0" name="_PRO" nillable="true" type="xs:int"/>

      <xs:element minOccurs="0" name="_SIGNEDBY" nillable="true" type="xs:string"/>

      <xs:element minOccurs="0" name="_STATUS" nillable="true" type="xs:string"/>

      <xs:element minOccurs="0" name="_TIMEIN" nillable="true" type="xs:string"/>

      <xs:element minOccurs="0" name="_TIMEOUT" nillable="true" type="xs:string"/>

      </xs:sequence>

      </xs:complexType>


       

       

        • Re: Transforming web service parameter names.

          Kyle,

           

          depending on how/what you choose to use to consume the soap service, you will need to parse the response. At that time, you can decide on what names and match how you want them in your model. There is a video here somewhere related to consuming SOAP services that may help you as well.

           

          As a quick example you may have something similar to:

           

          parseddata["ds_delivery_info"].each do |r|

                   dsdeliveryinfo= {}

                   dsdeliveryinfo["condition"] = r["_condition"]

                   dsdeliveryinfo["date"] = r["_date"]

          ...

          end

           

           

          Robert

          1 of 1 people found this helpful