Loading ...
Sorry, an error occurred while loading the content.

Invalid Listener Handle

Expand Messages
  • Kevin
    Perhaps this group can rescue me once again :) I m trying to determine what I m doing wrong with SOAP::Lite and the web service I m trying to access. To
    Message 1 of 2 , Jan 14, 2009
    View Source
    • 0 Attachment
      Perhaps this group can rescue me once again :)

      I'm trying to determine what I'm doing wrong with SOAP::Lite and the
      web service I'm trying to access. To explain this a little bit, my
      event management system exposes a web service which allows me to
      execute policies. I need to manually insert events using this policy.
      I believe I've setup my complex types properly using SOAP::Data and
      now I'm ready to send them to a service using the wsdl provided by the
      vendor.


      My data is constructed in this code..

      my $WSListenerId = SOAP::Data->name('WSListenerId' => \SOAP::Data->value(
      SOAP::Data->name('clientId'=>"$clientId")->type('string'),
      SOAP::Data->name('objectId'=>"$objectId")->type('string')));

      my $wParams = SOAP::Data->name('WSPolicyUserParameter' =>
      \SOAP::Data->value(
      SOAP::Data->name('e_alertKey'=>"@$_[0]")->type('string'),
      SOAP::Data->name('e_severity'=>"@$_[1]")->type('string'),
      SOAP::Data->name('e_summary'=>"@$_[2]")->type('string'),
      SOAP::Data->name('e_alertGroup'=>"@$_[3]")->type('string'),
      SOAP::Data->name('e_manager'=>"@$_[4]")->type('string'),
      SOAP::Data->name('e_agent'=>"@$_[5]")->type('string'),
      SOAP::Data->name('e_target'=>"@$_[6]")->type('string'),
      SOAP::Data->name('e_node'=>"@$_[7]")->type('string'),
      SOAP::Data->name('e_created'=>"@$_[8]")->type('string')));



      my attempt to access the web services is;

      SOAP::Lite->service('file://path/to/ImpactWSListenerService.wsdl')
      ->runPolicy($WSListenerId,'myPolicy',$wParams,'true');

      I crafted that based on the vendor doc at
      http://publib.boulder.ibm.com/infocenter/tivihelp/v8r1/topic/com.ibm.netcoolimpact.doc/dsa/imdsa_web_impactwebservicelistener_runpolicy_c.html
      as well as a java example of running a policy.

      For what it's worth I'm able to successfully use SOAP::Lite to login
      to this service and receive the response which gives me the data for
      clientId and obectId above.

      For sanity sake I've provided the wsdl last. So anyway, when I try to
      run a policy I get the following error. What I don't understand from
      the posted XML is where are all of my complex types? I don't need to
      run wireshark to capture all of that do I? I expect to see the
      WSListenerId complex type in this post but it's not there.


      SOAP::Transport::HTTP::Client::send_receive: POST
      http://localhost:8081/Virtual_VM1_jaxrpc/impact/ImpactWebServiceListener
      HTTP/1.1
      Accept: text/xml
      Accept: multipart/*
      Accept: application/soap
      Content-Length: 733
      Content-Type: text/xml; charset=utf-8
      SOAPAction: ""

      <?xml version="1.0" encoding="UTF-8"?><soap:Envelope
      xmlns:ns2="http://response.micromuse.com/types"
      soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:tns="http://response.micromuse.com/wsdl"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><tns:runPolicy><objId
      xsi:nil="true" xsi:type="ns2:WSListenerId" /><policyName
      xsi:type="xsd:string">myPolicy</policyName><policyUserParams
      xsi:nil="true"
      xsi:type="ns2:ArrayOfWSPolicyUserParameter" /><wantResult
      xsi:type="xsd:boolean">true</wantResult></tns:runPolicy></soap:Body></soap:Envelope>
      SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server
      Error
      Connection: close
      Date: Tue, 13 Jan 2009 17:53:51 GMT
      Server: Apache-Coyote/1.1
      Content-Type: text/xml
      Client-Date: Tue, 13 Jan 2009 17:53:52 GMT
      Client-Peer: 127.0.0.1:8081
      Client-Response-Num: 1

      <?xml version="1.0" encoding="UTF-8"?>
      <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:ns0="http://response.micromuse.com/types"
      xmlns:ns1="http://response.micromuse.com/wsdl"
      env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><env:Body><env:Fault
      xsi:type="env:Fault"><faultcode>env:Server</faultcode><faultstring>com.micromuse.response.common.soap.WSListenerException</faultstring><detail><ns1:WSListenerException
      xsi:type="ns0:WSListenerException"><detail xsi:type="xsd:string">Invalid
      listener
      handle</detail></ns1:WSListenerException></detail></env:Fault></env:Body></env:Envelope>



      ## WSDL ##
      <?xml version="1.0" encoding="UTF-8"?>

      <definitions name="ImpactWSListenerService"
      targetNamespace="http://response.micromuse.com/wsdl"
      xmlns:tns="http://response.micromuse.com/wsdl"
      xmlns="http://schemas.xmlsoap.org/wsdl/"
      xmlns:ns2="http://response.micromuse.com/types"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
      <types>
      <schema targetNamespace="http://response.micromuse.com/types"
      xmlns:tns="http://response.micromuse.com/types"
      xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
      <complexType name="WSListenerId">
      <sequence>
      <element name="clientId" type="string"/>
      <element name="objectId"
      type="string"/></sequence></complexType>
      <complexType name="WSListenerException">
      <sequence>
      <element name="detail" type="string"
      nillable="true"/></sequence></complexType>
      <complexType name="ArrayOfWSPolicyUserParameter">
      <complexContent>
      <restriction base="soap11-enc:Array">
      <attribute ref="soap11-enc:arrayType"
      wsdl:arrayType="tns:WSPolicyUserParameter[]"/></restriction></complexContent></complexType>
      <complexType name="WSPolicyUserParameter">
      <sequence>
      <element name="desc" type="string"/>
      <element name="format" type="string"/>
      <element name="label" type="string"/>
      <element name="name" type="string"/>
      <element name="value" type="string"/></sequence></complexType>
      <complexType name="ArrayOfPolicyExecutionResult">
      <complexContent>
      <restriction base="soap11-enc:Array">
      <attribute ref="soap11-enc:arrayType"
      wsdl:arrayType="tns:PolicyExecutionResult[]"/></restriction></complexContent></complexType>
      <complexType name="PolicyExecutionResult">
      <sequence>
      <element name="name" type="string"/>
      <element name="value"
      type="string"/></sequence></complexType></schema></types>
      <message name="ImpactWebServiceListener_login">
      <part name="userId" type="xsd:string"/>
      <part name="password" type="xsd:string"/></message>
      <message name="ImpactWebServiceListener_loginResponse">
      <part name="result" type="ns2:WSListenerId"/></message>
      <message name="WSListenerException">
      <part name="WSListenerException"
      type="ns2:WSListenerException"/></message>
      <message name="ImpactWebServiceListener_runPolicy">
      <part name="objId" type="ns2:WSListenerId"/>
      <part name="policyName" type="xsd:string"/>
      <part name="policyUserParams"
      type="ns2:ArrayOfWSPolicyUserParameter"/>
      <part name="wantResult" type="xsd:boolean"/></message>
      <message name="ImpactWebServiceListener_runPolicyResponse">
      <part name="result"
      type="ns2:ArrayOfPolicyExecutionResult"/></message>
      <portType name="ImpactWebServiceListener">
      <operation name="login" parameterOrder="userId password">
      <input message="tns:ImpactWebServiceListener_login"/>
      <output message="tns:ImpactWebServiceListener_loginResponse"/>
      <fault name="WSListenerException"
      message="tns:WSListenerException"/></operation>
      <operation name="runPolicy" parameterOrder="objId policyName
      policyUserParams wantResult">
      <input message="tns:ImpactWebServiceListener_runPolicy"/>
      <output message="tns:ImpactWebServiceListener_runPolicyResponse"/>
      <fault name="WSListenerException"
      message="tns:WSListenerException"/></operation></portType>
      <binding name="ImpactWebServiceListenerBinding"
      type="tns:ImpactWebServiceListener">
      <operation name="login">
      <input>
      <soap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      use="encoded" namespace="http://response.micromuse.com/wsdl"/></input>
      <output>
      <soap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      use="encoded" namespace="http://response.micromuse.com/wsdl"/></output>
      <fault name="WSListenerException">
      <soap:fault name="WSListenerException"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      use="encoded" namespace="http://response.micromuse.com/wsdl"/></fault>
      <soap:operation soapAction=""/></operation>
      <operation name="runPolicy">
      <input>
      <soap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      use="encoded" namespace="http://response.micromuse.com/wsdl"/></input>
      <output>
      <soap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      use="encoded" namespace="http://response.micromuse.com/wsdl"/></output>
      <fault name="WSListenerException">
      <soap:fault name="WSListenerException"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      use="encoded" namespace="http://response.micromuse.com/wsdl"/></fault>
      <soap:operation soapAction=""/></operation>
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
      style="rpc"/></binding>
      <service name="ImpactWSListenerService">
      <port name="ImpactWebServiceListenerPort"
      binding="tns:ImpactWebServiceListenerBinding">
      <soap:address
      location="http://localhost:8081/Virtual_VM1_jaxrpc/impact/ImpactWebServiceListener"/></port></service></definitions>



      Thanks!

      Kevin
    • rahed
      According to wsdl your WSPolicyUserParameter should be an array. Construct this parameter as soap array. Some example is in SOAP::Data docs. -- Radek
      Message 2 of 2 , Jan 15, 2009
      View Source
      • 0 Attachment
        According to wsdl your WSPolicyUserParameter should be an array.
        Construct this parameter as soap array. Some example is in SOAP::Data docs.

        --
        Radek
      Your message has been successfully submitted and would be delivered to recipients shortly.