0 Replies Latest reply on Nov 20, 2009 11:02 AM by yuriyadobe

    problem with Flex Web Services requests formats

    yuriyadobe

      We have built several webservices accessing our test database.

      Installed SoapUI, added WSDL files to SoapUI, entered data into XML requests, - tested against our webservices - all worked as a charm!

       

      Then tried them with Flex 3.

      Created a project, imported WSDL, downloaded Adobes's US weather example from http://www.adobe.com/devnet/flex/articles/flex_ws.html

      and, by example, wrote a similar code to work with our webservices. Tested - received the following error:

                     <errorMessage>Error in SOAP body: Unable to resolve namespace URI for ''''''''''''''''''''''''''''''''. (10915)</errorMessage>

       

      Then we compared Requests sent by SoapUI that worked, and by Flex that did not.

      Here are both requests.

       

      SoapUI:

       

      <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:PoirotWebServices-org:poirot_web_services" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">

         <soapenv:Header/>

         <soapenv:Body>

            <urn:appsvc_AvailRQ soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

               <ipt_BookingOffice xsi:type="xsd:string">LON</ipt_BookingOffice>

               <ipt_BookingCurrency xsi:type="xsd:string">GBP</ipt_BookingCurrency>

               <ipt_TourCode xsi:type="xsd:string">NALNWICK</ipt_TourCode>

               <ipt_TourDate xsi:type="xsd:date">2008-04-19</ipt_TourDate>

               <ipt_NumberOfPax xsi:type="xsd:int">2</ipt_NumberOfPax>

               <ipt_MarketingCode xsi:type="xsd:string"></ipt_MarketingCode>

               <ipt_RailResourceCode xsi:type="xsd:string">NBL,SHE,ALN,,,SHE,</ipt_RailResourceCode>

               <ipt_InsuranceCode xsi:type="xsd:string"></ipt_InsuranceCode>

               <tSSR>

                  <!--Zero or more repetitions:-->

                  <tSSRRow>

      <bkifrloc></bkifrloc>   

      <printResKey></printResKey>

                     <ssrCode>PBK</ssrCode>

                     <ssrPrice>12</ssrPrice>

                     <ssrPaxNumber>1</ssrPaxNumber>

                     <ssrQuantity>2</ssrQuantity>

                     <ssrRemark>test remark</ssrRemark>

                  </tSSRRow>

               </tSSR>

            </urn:appsvc_AvailRQ>

         </soapenv:Body>

      </soapenv:Envelope>

       

       

      Flex:

        <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
          <S2:appsvc_AvailRQ xmlns:S2="urn:PoirotWebServices-org:poirot_web_services">
            <ipt_BookingOffice xsi:type=":string">LON</ipt_BookingOffice>
            <ipt_BookingCurrency xsi:type=":string">GBP</ipt_BookingCurrency>
            <ipt_TourCode xsi:type=":string">NALNWICK</ipt_TourCode>
            <ipt_TourDate xsi:type=":date">2008-04-19</ipt_TourDate>
            <ipt_NumberOfPax xsi:type=":int">2</ipt_NumberOfPax>
            <ipt_MarketingCode xsi:type=":string">PTB4</ipt_MarketingCode>
            <ipt_RailResourceCode xsi:type=":string">NBL,SHE,ALN,,,SHE,</ipt_RailResourceCode>
            <ipt_InsuranceCode xsi:type=":string"></ipt_InsuranceCode>
            <tSSR SOAP-ENC:arrayType="S2:appsvc_AvailRQ_tSSRRow[]" xsi:type="SOAP-ENC:Array" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
              <item xsi:type="S2:appsvc_AvailRQ_tSSRRow">
                <bkifrloc xsi:type=":string"></bkifrloc>
                <printResKey xsi:type=":string"></printResKey>
                <ssrCode xsi:type=":string">PBK</ssrCode>
                <ssrPrice xsi:type=":decimal">12</ssrPrice>
                <ssrPaxNumber xsi:type=":int">1</ssrPaxNumber>
                <ssrQuantity xsi:type=":int">2</ssrQuantity>
                <ssrRemark xsi:type=":string">test remark ssr</ssrRemark>
              </item>
            </tSSR>
          </S2:appsvc_AvailRQ>
        </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>
      Then we compared these two XMLs.

       

      Found that 1) if we add "xds" into all data definitions like xsi:type=":decimal" to make it look like xsi:type="xds:decimal"

      and 2) if we replace the envelope definition

        <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      with a version from SoapUI
      <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:PoirotWebServices-org:poirot_web_services" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
      then the modified "Flex request" will work too.
      My question is - what can we do to make Flex gererate same Request formats as SoapUI does ??
      Thank you