I have some webservice to test, running on a server, in axis2.
I have been given some xml data that we should receive from third parties using our webservice. that xml data is well formatted according to the wsdl of our webservice.
so as to test i do: (following the axis2.py test file given in suds)
url = 'http://localhost:8080/axis2/services/{0}?wsdl'.format('myWebService')
print 'url=%s' % url
client = Client(url)
print client
with open("input.xml") as f:
inputXml = f.read()
print client.service.myWebserviceRequest(inputXml)
and i get the following error message:
urllib2.URLError: <urlopen error [Errno 10061] No connection could be made becau
se the target machine actively refused it>
as far as I see with the statement print Client, it’s that suds is awaiting objects not under the xml form, but under python form. ( that’s what the rest of the axis.py code suggest)
but in my case I have the data already formated in xml. Do you know how I could input it directly as xml into the request client.service.myWebserviceRequest ?
(it is not a problem of connection since I access to the axis2 webservice getVersion)
EDIT1: output of the print client statement.
Service ( myWebService ) tns="ws.myCompany.com"
Prefixes (2)
ns2 = "myData.ws.myCompany.com"
ns3 = "ws.myCompany.com"
Ports (1):
(MyServiceSSOAP12port_http)
Methods (1):
sendMyInformation(ns2:DATA_HEADER DATA_HEADER, ns2:OTHER_CONTENT OTHER_CONTENT, )
Types (1):
WSExceptionType
What puzzles me is that the suds Client expose a service of the form sendMyInformation((ns2:DATA_HEADER DATA_HEADER, ns2:OTHER_CONTENT OTHER_CONTENT,)
whereas in my wsdl the data to supply is:
<xs:element name="WHOLE_CONTENT">
<xs:complexType>
<xs:sequence>
<xs:element ref="DATA_HEADER"/>
<xs:element ref="OTHER_CONTENT"/>
</xs:sequence>
</xs:complexType>
</xs:element>
Just saw this question when looking for answers,
have you solved it?. are you looking something like the below
MESSAGE INJECTION (Diagnostics/Testing?)¶
The service API provides for message/reply injection.
To inject either a soap message to be sent or to inject a reply or fault to be processed as if returned by the soap server, simply specify the __inject keyword argument.
when invoking the service. Eg:
Sending a raw soap message:
print client.service.test(__inject={'msg':message})
GP