6 Replies Latest reply on Jun 2, 2011 11:09 AM by dulo

    SAOP Client request generating problem

    dulo

      Hi,

       

      I have o problem with soap client. Requests that soap client create are not complete. This is the part of input wsdl which SOAP Client uses to create request:

       

      <

      <xsd:complexType name="getLocationForGroup">

      <xsd:sequence>

      <xsd:element name="addresses" type="xsd:anyURI" minOccurs="1" maxOccurs="unbounded"/>

      <xsd:element name="requestedAccuracy" type="xsd:int"/>

      <xsd:element name="acceptableAccuracy" type="xsd:int"/>

      <xsd:element name="maximumAge" type="parlayx_common_xsd:TimeMetric" minOccurs="0" maxOccurs="1"/>

      <xsd:element name="responseTime" type="parlayx_common_xsd:TimeMetric" minOccurs="0" maxOccurs="1"/>

      <xsd:element name="tolerance" type="terminal_location_xsd:DelayTolerance"/>

      </xsd:sequence>

       

      but request made by soap client looks like this:

       

      <soapenv:Envelope xmlns:loc="http://www.csapi.org/schema/parlayx/terminal_location/v2_3/local" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

         <soapenv:Header />

         <soapenv:Body>

            <loc:getLocationForGroup>

               <!--1 or more repetitions: - cloned-->

       

               <loc:requestedAccuracy />

               <loc:acceptableAccuracy>20</loc:acceptableAccuracy>

               <!--Optional:-->

               <loc:maximumAge>

                  <metric />

                  <units />

               </loc:maximumAge>

               <!--Optional:-->

               <loc:responseTime>

                  <metric />

                  <units />

               </loc:responseTime>

               <loc:tolerance>NoDelay</loc:tolerance>

            </loc:getLocationForGroup>

         </soapenv:Body>

      </soapenv:Envelope>

        • 1. SAOP Client request generating problem
          dulo

          part of code that sets Map for the request is:

           

                    requestMap.put("getLocationForGroup.addresses", "anything");

                    requestMap.put("getLocationForGroup.requestedAccuracy", "20");

                    requestMap.put("getLocationForGroup.acceptableAccuracy", "20");

                    requestMap.put("getLocationForGroup.tolerance", "NoDelay");

           

          as you can see, problem is, that node addresses is missing in the request. Could you help me with this problem pls ?

          • 2. SAOP Client request generating problem
            tfennelly

            As I just pointed out to someone else... better idea would be to avoid that soapUI client and instead use an action pipeline that string a transformer action (to generate the SOAP payload) together with a HttpRouter action (to route the SOAP payload to the endpoint and get back the response).

             

            On the face of it, it may seem like a bit more work, but you have full control and visibility with this option.  My bet is that you'd get this working a lot faster and with a lot less bother.

            • 3. SAOP Client request generating problem
              rahmanford

              Hi,

              Are you trying to create a soap client using ESB or normal soap client for the Terminal Location ?

               

              Regards,

              rahman

              • 4. SAOP Client request generating problem
                dulo

                A'm trying to create ESB and to use org.jboss.soa.esb.actions.soap.SOAPClient to generate and send request for the Terminal Location

                • 5. SAOP Client request generating problem
                  dulo

                  Hi, I have finally found the solution so I'm gonna share it.

                  The key problem is that WSDL schema defines maxOccurs="unbounded" for element "addresses". So when I want to put it into request map a have to use collections. Here is example:

                   

                  List<String> list = new ArrayList<String>();

                  list.add("anything");

                  requestMap.put("getLocationForGroup.addresses", list);

                   

                  Enjoy

                  • 6. Re: SAOP Client request generating problem
                    dulo

                    I just noticed, that soapclient generates request like this

                     

                    <soapenv:Envelope xmlns:loc="http://www.csapi.org/schema/parlayx/terminal_location/v2_3/local" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

                       <soapenv:Header />

                       <soapenv:Body>

                          <loc:getLocationForGroup>

                             <!--1 or more repetitions: - cloned-->

                              <loc:addresses /><loc:addresses /><loc:addresses />

                     

                             <loc:requestedAccuracy />

                             <loc:acceptableAccuracy>20</loc:acceptableAccuracy>

                             <!--Optional:-->

                             <loc:maximumAge>

                                <metric />

                                <units />

                             </loc:maximumAge>

                             <!--Optional:-->

                             <loc:responseTime>

                                <metric />

                                <units />

                             </loc:responseTime>

                             <loc:tolerance>NoDelay</loc:tolerance>

                          </loc:getLocationForGroup>

                       </soapenv:Body>

                    </soapenv:Envelope>

                     

                    so it can be seen, that elements named "addresses" are empty inspite of fact I set addresses :

                     

                    List<String> list = new ArrayList<String>();

                    list.add("anything1");

                    list.add("anything2");

                    list.add("anything3");

                    requestMap.put("getLocationForGroup.addresses", list);

                     

                    Could you tell me where is the problem, pls?