Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web Service Problem

Status
Not open for further replies.

qberta01

Programmer
Nov 14, 2005
113
Hello,

I am using VS 2003 and have added a web method to an existing web service. I tested it and it works just fine. Now this web service has many many methods used in many places so the original developer created another web service that only calls a handful of the methods that are needed by a certain vendor.

I want to test the actual web service as it is used by the vendor, but when I click on the method I get this:

"Test
The test form is only available for methods with primitive types as parameters.
SOAP 1.1
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values."

and it shows the XML structure.

My question is how do I get it to allow me to pass in parameters for testing?

I would like to test it as if I were the actual vendor before I send the code out.

The senior developer suggested that I enable HHTPPost in the webconfig file. I added the following:


<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>

and it didn't work.

Any suggestions would be greatly appreciated.

Thx,

Q.


 
I don't have 2003 nor do I have an understanding of your websrvices. But did you add a webreference? And do you use the classes it creates?

Christiaan Baes
Belgium

"My old site" - Me
 
Thanks for your reply. I basically have an end point web method I want to test. When I try to run it I get the SOAP headers and not the nice little text boxes asking for the parmamters to be passed. So one of the developers here used telnet localhost 80 to connect to the localhost and then he pasted in the XML with the parameter values entered to run it. I suppose his intention was to bypass the missing box problem and just pass the data directly to the server and have a response from the server returned. However, it is not working for me. Any suggestions?

Thx,

Q.
 
Are the Full WS and teh Cut Down WS on the same server?
If so can you connect and run methods from teh full service in the browser? - If so It suggests that the issue is in the setup of the cut down service.

Can you check that there are no Ref parameters in the signatures of the method calls?

Does the webservice work if you call it from within your application, rather than from the browser test platform?
 
Basically for security reasons you can only "Invoke" the web service methods from when logged into the localhost. Just add this in the system.web section and you should be able to get the textboxes and the Invoke button (you can remove it when you deploy the service).

Code:
<webServices> 
	        <protocols> 
	            <add name="HttpGet"/> 
	            <add name="HttpPost"/> 
	        </protocols> 
</webServices>

Regards,

J
 
Hi, I think you'll find the reason you cannot use the test form is that your web service functions are accepting a 'complex type' as a parameter (such as an array, or even a data set). Obviously you'll be unable to replicate the XML structure of a dataset by just using a text box on a form. If your web service function(s) only accept, say integers or strings, they are primitive datatypes, so you can of course just type those values into a form.

I'd suggest the best way for you to test your web service would be to create a demo project and add a web reference pointing to the web service you want to test. Alternativly, use the example SOAP 1.1 request XML, put real values in the placeholders and fire it at the web service using an HTTPWebRequest (in a test application or aspx page).

Cheers,
Rob
 
Geez, I just read your post again, and all I did was post what you had in yours. Man, perhaps I should read next time.

J
 
Okay ifx you are right. It's accepting complex types as a parameter. There seem to be some free tools out there that assist in unit testing of such web services. If anyone can recommend one that'd be great. I will search and try one and see how it goes.

Thx,

Q.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top