0 Replies Latest reply on Mar 19, 2011 1:11 AM by itsvikasjindal

    Help - Passing complextype arguement to WebService

    itsvikasjindal

      Hi,

       

      I'm trying to pass a complex type into a web service request.

       

       

      <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="CEM_Services_HTTP_BI_Service" xmlns:tns1="dsws.businessobjects.com" targetNamespace="CEM_Services_HTTP_BI_Service" xmlns="http://schemas.xmlsoap.org/wsdl/" name="BIServices">               

      - <s:simpleType name="Operator">

      - <s:restriction base="s:string">

        <s:enumeration value="EQUAL" />

        <s:enumeration value="GREATER" />

        <s:enumeration value="GREATER_OR_EQUAL" />

        <s:enumeration value="LESS" />

        <s:enumeration value="LESS_OR_EQUAL" />

        <s:enumeration value="NOT_EQUAL" />

        <s:enumeration value="INLIST" />

        <s:enumeration value="NOT_INLIST" />

        </s:restriction>

        </s:simpleType>

      - <s:complexType name="FilterCondition">

      - <s:sequence>

        <s:element name="value" type="s:string" />

        <s:element name="operator" type="s0:Operator" />

        </s:sequence>

        </s:complexType>

      </s:element>

      - <s:element name="GetReportBlock_CEM_Service_HTTP_DL_Per_Server">

      - <s:complexType>

      - <s:sequence>

        <s:element name="login" type="s:string" minOccurs="0" nillable="true" />

        <s:element name="password" type="s:string" minOccurs="0" nillable="true" />

        <s:element name="Web_Server" type="s0:FilterCondition" minOccurs="0" maxOccurs="unbounded" nillable="true" />

        <s:element name="resetState" type="s:boolean" minOccurs="0" nillable="true" />

        <s:element name="refresh" type="s:boolean" minOccurs="0" nillable="true" />

        <s:element name="getFromLatestDocumentInstance" type="s:boolean" minOccurs="0" nillable="true" />

        <s:element name="getFromUserInstance" type="s:boolean" minOccurs="0" nillable="true" />

        <s:element name="turnOutputToVTable" type="s:boolean" minOccurs="0" nillable="true" />

        </s:sequence>

        </s:complexType>

        </s:element>

       

       

      Here is the code which written in Flex;

       

       

        <fx:Declarations>

      <!-- Place non-visual elements (e.g., services, value objects) here -->

      <s:WebService id="serviceID" wsdl="http://hostname:8080/dswsbobje/qaawsservices/biws?wsdl=1&cuid=FnB4g03HzwwAxTQAALBLF0UAABFD 6L5R"

        endpointURI="http://hostname:8080/dswsbobje/qaawsservices/queryasaservice?&cuid=FnB4g03HzwwAxTQAALBLF0U AABFD6L5R&authType=secEnterprise&locale=en&timeout=60&ConvertAnyType=true"

        service="CEM_Services_HTTP_BI_Service" port="BIServicesSoap" makeObjectsBindable="true" >

      <s:operation  name="GetReportBlock_CEM_Service_HTTP_DL_Per_Server"

      resultFormat="e4x"

        result="showResult(event);"

        fault="genericFaultHandler(event)"

      >

      </s:operation>

      </fx:Declarations>

              <fx:Script>

                      <![CDATA[

                     private function send_data():void {             

                     host = new Array( ["www.music.com","INLIST"]);

                     serviceID.GetReportBlock_CEM_Service_HTTP_DL_Per_Server("administrator", "password", host, true, false, true, true, true);

                    }

       

       

      But When I capture the http request dump, its not as expected:

       

       

      <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

        <SOAP-ENV:Body>

          <s0:GetReportBlock_CEM_Service_HTTP_DL_Per_Server xmlns:s0="CEM_Services_HTTP_BI_Service">

            <s0:login>administrator</s0:login>

            <s0:password>Tekelec1</s0:password>

            <s0:Web_Server>

              <s0:value>www.music.com,INLIST</s0:value>

              <s0:operator>www.music.com,INLIST</s0:operator>

            </s0:Web_Server>

            <s0:resetState>true</s0:resetState>

            <s0:refresh>false</s0:refresh>

            <s0:getFromLatestDocumentInstance>true</s0:getFromLatestDocumentInstance>

            <s0:getFromUserInstance>true</s0:getFromUserInstance>

            <s0:turnOutputToVTable>true</s0:turnOutputToVTable>

          </s0:GetReportBlock_CEM_Service_HTTP_DL_Per_Server>

        </SOAP-ENV:Body>

      </SOAP-ENV:Envelope>

       

       

      I tried to pass the paramter value in WebService tag itself:

       

       

      <s:request>

      <login>administrator</login>

      <password>Tekelec1</password>

      <Web_Server>

      <value>www.music.com</value>

      <operator>INLIST</operator>

      </Web_Server>

      <resetState>true</resetState>

      <refresh>false</refresh>

      <getFromLatestDocumentInstance>true</getFromLatestDocumentInstance>

      <getFromUserInstance>true</getFromUserInstance>

      <turnOutputToVTable>true</turnOutputToVTable>

      </s:request>

       

       

       

       

      <s:request>

      <login>administrator</login>

      <password>Tekelec1</password>

      <Web_Server>www.music.com, INLIST</Web_Server>

      <resetState>true</resetState>

      <refresh>false</refresh>

      <getFromLatestDocumentInstance>true</getFromLatestDocumentInstance>

      <getFromUserInstance>true</getFromUserInstance>

      <turnOutputToVTable>true</turnOutputToVTable>

      </s:request>

       

       

      But it again did not work. Actually WebService always pass same values to Web_Server.value and Web_Server.Operator tags. But my requirement is to pass website address in Web_Server.value tag and "INLIST" in Web_Server.Operator tag.

       

      Can somebody help in resolving this issue??

       

      Thanks in advance,

      Vikas Jindal