create .net web service proxy classes without a WSDL
I have a question about manually creating a .Net webservice proxy class. The WSDL is unavailable, and it is a Websphere server. I was able to create a class that inherits fr开发者_运维知识库om System.Web.Services.Protocols.SoapHttpClientProtocol and send the request however I’m having one difficulty. The element has to have an attribute called “targetID” and I don’t know how to get this added. Currently I have a class called CQuery that has two strings (firstname and lastname) so that as it is sent it serializes it out to:
.<query>
..<firstname></firstname>
..<lastname>LastName</lastname>
.</query>
But it is suppose to look like: (and actually ‘millennium_8dea22d9e8b25d0f’ should be a variable as it could change)
.<query targetID='millennium_8dea22d9e8b25d0f'>
..<firstname></firstname>
..<lastname>LastName</lastname>
.</query>
Any ideas on how to get it to serialize this way, or any direction I should go?
Add a targetID property to your class, and mark it with the [XmlAttribute]
attribute.
Create a Web service yourself. Create a proxy. Then take cues from the generated proxy code.
精彩评论