[ptt-users] Creating Test agent from wsdl

Anagha Gadgil panagha at in.ibm.com
Tue Mar 20 03:56:58 PST 2007


I am trying to generate a test agent from a wsdl using  Tools -> new Agent
-> Web Service.
When I try to execute the agent, this is the error I get . I am unable to
figure out  what's causing the problem. The wsdl is a auto generated one,


------------------------------------------------------------ Error
Output--------------------------------------------------------------------------------------------
Agent running:

Description:

Processing...

<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header/><soapenv:Body><soapenv:Fault

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>SOAP-ENV:Client</faultcode><faultstring>Failed
 to get operation name from the incoming
request</faultstring><detail/></soapenv:Fault></soapenv:Body></soapenv:Envelope>

That took  0.0  milliseconds to complete.

Agent ended.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This is my Test agent :
# Agent name:
# Created on:
# Author:

print "Agent running: "
print "Description: "
print


# Import tells TestMaker where to find Tool objects
from com.pushtotest.tool.protocolhandler import ProtocolHandler,
SOAPHeader, SOAPBody, SOAPProtocol
from com.pushtotest.tool.response import Response
from java.lang import Long, Integer, String

# Variables definitions

Timing1 = 0.0


# Main body of agent

print "Processing..."

# AddServiceService SOAP Script
# AddServiceSoapPort: http://com/ibm:AddServiceServiceSoapBinding

soap = ProtocolHandler.getProtocol("soap")
soap.setUrl("http://9.124.226.151:7001/TestAxis/AddService")
body = ProtocolHandler.getBody("soap")
body.setMethod("addNum")
# addNum
#body.addParameter("null","")
body.addParameter("a", Integer, 1, None)
body.addParameter("b", Integer, 1, None)
soap.setBody(body)
response = soap.connect()


# Report results

print response
print "That took ", Timing1, " milliseconds to complete."
print
print "Agent ended."

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This is the wsdl :


<?xml version='1.0' encoding='UTF-8'?>
<definitions name="AddServiceServiceDefinitions"
targetNamespace="http://com/ibm" xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:s0="http://com/ibm" xmlns:s1="http://schemas.xmlsoap.org/wsdl/soap/">
  <types>
    <xs:schema attributeFormDefault="unqualified"
elementFormDefault="qualified" targetNamespace="http://com/ibm"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="addNum">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="a" type="xs:int"/>
            <xs:element name="b" type="xs:int"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="addNumResponse">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="return" type="xs:int"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>
  </types>
  <message name="addNum">
    <part element="s0:addNum" name="parameters"/>
  </message>
  <message name="addNumResponse">
    <part element="s0:addNumResponse" name="parameters"/>
  </message>
  <portType name="AddService">
    <operation name="addNum" parameterOrder="parameters">
      <input message="s0:addNum"/>
      <output message="s0:addNumResponse"/>
    </operation>
  </portType>
  <binding name="AddServiceServiceSoapBinding" type="s0:AddService">
    <s1:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="addNum">
      <s1:operation soapAction="" style="document"/>
      <input>
        <s1:body parts="parameters" use="literal"/>
      </input>
      <output>
        <s1:body parts="parameters" use="literal"/>
      </output>
    </operation>
  </binding>
  <service name="AddServiceService">
    <port binding="s0:AddServiceServiceSoapBinding"
name="AddServiceSoapPort">
      <s1:address location="http://localhost:7001/TestAxis/AddService"/>
    </port>
  </service>
</definitions>

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



More information about the Users mailing list