cancel
Showing results for 
Search instead for 
Did you mean: 

Testing a Web service

Former Member
0 Kudos

How to test a webservice that is defined in the ID?

-Naveen.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Naveen,

Use a request like this.. for example,

If your wsdl target is to retrieve stock quotes of a company

Like this

<?xml version="1.0" encoding="ISO-8859-1"?>

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:tns="http://www.webserviceX.NET/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://www.webserviceX.NET/">

<wsdl:types>

<s:schema elementFormDefault="qualified" targetNamespace="http://www.webserviceX.NET/">

<s:element name="GetQuote">

<s:complexType>

<s:sequence>

<s:element minOccurs="0" maxOccurs="1" name="symbol" type="s:string" />

</s:sequence>

</s:complexType>

</s:element>

<s:element name="GetQuoteResponse">

<s:complexType>

<s:sequence>

<s:element minOccurs="0" maxOccurs="1" name="GetQuoteResult" type="s:string" />

</s:sequence>

</s:complexType>

</s:element>

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

</s:schema>

</wsdl:types>

<wsdl:message name="GetQuoteSoapIn">

<wsdl:part name="parameters" element="tns:GetQuote" />

</wsdl:message>

<wsdl:message name="GetQuoteSoapOut">

<wsdl:part name="parameters" element="tns:GetQuoteResponse" />

</wsdl:message>

<wsdl:message name="GetQuoteHttpGetIn">

<wsdl:part name="symbol" type="s:string" />

</wsdl:message>

<wsdl:message name="GetQuoteHttpGetOut">

<wsdl:part name="Body" element="tns:string" />

</wsdl:message>

<wsdl:message name="GetQuoteHttpPostIn">

<wsdl:part name="symbol" type="s:string" />

</wsdl:message>

<wsdl:message name="GetQuoteHttpPostOut">

<wsdl:part name="Body" element="tns:string" />

</wsdl:message>

<wsdl:portType name="StockQuoteSoap">

<wsdl:operation name="GetQuote">

<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">

Get Stock quote for a company Symbol

</documentation>

<wsdl:input message="tns:GetQuoteSoapIn" />

<wsdl:output message="tns:GetQuoteSoapOut" />

</wsdl:operation>

</wsdl:portType>

<wsdl:portType name="StockQuoteHttpGet">

<wsdl:operation name="GetQuote">

<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">

Get Stock quote for a company Symbol

</documentation>

<wsdl:input message="tns:GetQuoteHttpGetIn" />

<wsdl:output message="tns:GetQuoteHttpGetOut" />

</wsdl:operation>

</wsdl:portType>

<wsdl:portType name="StockQuoteHttpPost">

<wsdl:operation name="GetQuote">

<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">

Get Stock quote for a company Symbol

</documentation>

<wsdl:input message="tns:GetQuoteHttpPostIn" />

<wsdl:output message="tns:GetQuoteHttpPostOut" />

</wsdl:operation>

</wsdl:portType>

<wsdl:binding name="StockQuoteSoap" type="tns:StockQuoteSoap">

<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />

<wsdl:operation name="GetQuote">

<soap:operation soapAction="http://www.webserviceX.NET/GetQuote" style="document" />

<wsdl:input>

<soap:body use="literal" />

</wsdl:input>

<wsdl:output>

<soap:body use="literal" />

</wsdl:output>

</wsdl:operation>

</wsdl:binding>

<wsdl:binding name="StockQuoteHttpGet" type="tns:StockQuoteHttpGet">

<http:binding verb="GET" />

<wsdl:operation name="GetQuote">

<http:operation location="/GetQuote" />

<wsdl:input>

<http:urlEncoded />

</wsdl:input>

<wsdl:output>

<mime:mimeXml part="Body" />

</wsdl:output>

</wsdl:operation>

</wsdl:binding>

<wsdl:binding name="StockQuoteHttpPost" type="tns:StockQuoteHttpPost">

<http:binding verb="POST" />

<wsdl:operation name="GetQuote">

<http:operation location="/GetQuote" />

<wsdl:input>

<mime:content type="application/x-www-form-urlencoded" />

</wsdl:input>

<wsdl:output>

<mime:mimeXml part="Body" />

</wsdl:output>

</wsdl:operation>

</wsdl:binding>

<wsdl:service name="StockQuote">

<wsdl:port name="StockQuoteSoap" binding="tns:StockQuoteSoap">

<soap:address location="http://www.webservicex.net/stockquote.asmx" />

</wsdl:port>

<wsdl:port name="StockQuoteHttpGet" binding="tns:StockQuoteHttpGet">

<http:address location="http://www.webservicex.net/stockquote.asmx" />

</wsdl:port>

<wsdl:port name="StockQuoteHttpPost" binding="tns:StockQuoteHttpPost">

<http:address location="http://www.webservicex.net/stockquote.asmx" />

</wsdl:port>

</wsdl:service>

</wsdl:definitions>

You create a XML request like this..

getServiceResponse

>>>>>ServiceName

>>>>>InputText

cheers,

Prashanth

P.S Please mark helpful answers

Former Member
0 Kudos

Hi Naveen,

There are several ways to send an SOAP request. One of the easiest ways of sending SOAP request is through XML document editors like XMLSPY. Tools having the facility to send a SOAP request by using a WSDL could be used to post a SOAP send. Import the WSDL in to the tool and check the validity. Check the import and export parameters are available in the SOAP message structure.

To test the scenario provide the relevant data and send the request. User authentication details like the user name and password has to be provided to connect to XI. The response could be seen in the same tool itself.

Also go through this blog on <a href="/people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi Webservices using SAPXI</a> and see if it helps you......

Regards,

Abhy

Former Member
0 Kudos

You can use the SAP SOAP Client for this purpose.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9b16d790-0201-0010-4e9b-baa...

The only problem is that you have to build the xml request by your own. (XML Spy generates a sample request for you.)

Former Member
0 Kudos

How to build the XML request?

-naveen.

Former Member
0 Kudos

Hi Naveen,

XMLSpy can be used to test a webservice. Download the trial version of XMLSpy free at www.altova.com

Check out these links for testing it..

/people/siva.maranani/blog/2005/03/01/testing-xi-exposed-web-services

/people/shabarish.vijayakumar/blog/2006/03/23/rfc--xi--webservice--a-complete-walkthrough-part-1

cheers,

Prashanth

P.S : Please mark helpful answers