[ptt-users] SOAP agent help

Carl Herder carl_herder at yahoo.com
Thu Dec 14 12:40:44 PST 2006


Here is more information on this. 
   
  I added prints of body.toString() and response.toString() to the agent script (separated by the line), and saw this:
   
  Processing...
  Sending...
   
  --------------------------------------------------------------
   
  <?xml version="1.0" encoding="utf-8"?>
  <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">  
  <soap:Body>    
  <soap:Fault>      
  <faultcode>soap:Client</faultcode>      <faultstring>System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: .   at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest()   at System.Web.Services.Protocols.SoapServerProtocol.Initialize()   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean&amp; abortProcessing)</faultstring>      
  <detail />    
  </soap:Fault>  
  </soap:Body>
  </soap:Envelope>
   
  Agent ended.
   
   
  ...so I added this to the script:
   
  soap.setActionURI("http://tempuri.org/GetOrder")
   
  ...and got this output:
   
  Processing...
  Sending...
   
  --------------------------------------------------------------
  <?xml version="1.0" encoding="utf-8"?>
  <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">  
  <soap:Body>    
  <soap:Fault>
  <faultcode>soap:Client</faultcode>      <faultstring>System.Web.Services.Protocols.SoapException: Server was unable to read request. ---&gt; System.Xml.XmlException: Invalid namespace declaration. Line 4, position 25.   at System.Xml.XmlNSAttributeTokenInfo.FixNSNames()   at System.Xml.XmlTextReader.SetLiteralValues(XmlAttributeTokenInfo fld)   at System.Xml.XmlTextReader.SetAttributeValues()   at System.Xml.XmlTextReader.ParseElement()   at System.Xml.XmlTextReader.Read()   at System.Xml.XmlReader.MoveToContent()   at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()   --- End of inner exception stack trace ---   at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()   at System.Web.Services.Protocols.WebServiceHandler.Invoke()   at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()</faultstring>      
  <detail />    
  </soap:Fault>  
  </soap:Body>
  </soap:Envelope>
  
The quick-and-dirty (at least, in this case) solution was for me to explicitly add the request XML:
   
  body.setDocument(XMLreq)
   
  ...and then things started to work. 
   
  Bottom line--the SOAP agent script generation from WSDL needs some work. 
   
  Carl
   
  
Carl Herder <carl_herder at yahoo.com> wrote:
    Hello TMers (does that make Frank the Maharishi?),
   
  I need to create a load script that exercises the SOAP request implemented by the Miscrosoft .Net PetShop benchmark application. The web service is implemented using a .Net .asmx file. With these files, it is easy to generate a WSDL definition. The WSDL file is attached.
   
  I used the TestMaker 4.4 GUI to generate an agent from this WSDL. The generated agent (testWS.py) is attached. Unfortunately, the agent script does not work. When I run it through the TM GUI, the output looks like this:
   
  Agent running:
  Description:
   
  Processing...
   
  That took 0.0 milliseconds to complete.
   
  Agent ended.
   
  I have a monitoring tool on IIS that verifies that no web service request was processed. No errors are in the Windows Event Log, or in the IIS logs, that I can see. This agent code is not a subclass of agentbase, so I don't have any debug levels to play with (that I know of).
   
  Any ideas on:
   
  1. Why the agent isn't working, or
  2. How I can get more info?
   
  Thanks,
  Carl
    
---------------------------------
  Everyone is raving about the all-new Yahoo! Mail beta.


























































































Retrieves order information for a given order ID.




# 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


# Variables definitions

Timing1 = 0.0


# Main body of agent

print "Processing..."

# WebServices SOAP Script 
# WebServicesSoap: http://tempuri.org/:WebServicesSoap

soap = ProtocolHandler.getProtocol("soap")
soap.setUrl("http://localhost/MSPetShop/WebServices.asmx")
body = ProtocolHandler.getBody("soap")
body.setMethod("GetOrder")
# GetOrderSoapIn
body.addParameter("parameters", "")
soap.setBody(body)
response = soap.connect()


# Report results

print
print "That took ", Timing1, " milliseconds to complete."
print
print "Agent ended."
_______________________________________________
Users mailing list
Users at lists.pushtotest.com
http://lists.pushtotest.com/mailman/listinfo/users


 
---------------------------------
Need a quick answer? Get one in minutes from people who know. Ask your question on Yahoo! Answers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cake.pushtotest.com/pipermail/users/attachments/20061214/0d6693ed/attachment.htm


More information about the Users mailing list