0

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 from 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?

2 Answers 2

1

Add a targetID property to your class, and mark it with the [XmlAttribute] attribute.

Sign up to request clarification or add additional context in comments.

Comments

0

Create a Web service yourself. Create a proxy. Then take cues from the generated proxy code.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.