Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / February 2005

Tip: Looking for answers? Try searching our database.

Modifying WSDL Response Element

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 21 Feb 2005 23:34 GMT
I have a web service being consume by a new client. The WebMethod they are
calling is called Process.

So in the WSDL I have has 2 elements, Process and ProcessResponse.

<s:schema elementFormDefault="qualified"
targetNamespace="http://www.test.com/">
 <s:import namespace="http://www.test.com/" />
<s:element name="Process">
 <s:complexType>
  <s:sequence>
   <s:element minOccurs="0" maxOccurs="1" ref="s1:TPVRequest" />
  </s:sequence>
 </s:complexType>
</s:element>
<s:element name="ProcessResponse">
 <s:complexType>
  <s:sequence>
   <s:element minOccurs="0" maxOccurs="1" ref="s1:ProcessResult" />
  </s:sequence>
 </s:complexType>
</s:element>
</s:schema>

My client wants the result of ProcessResponse, "ProcessResult" to be named
something else.

Inside my webservice how do I dictate what the result element is going to be
names?

I hope this makes sense to you guys :)

Thanks a lot in advance,

Mike
erymuzuan - 22 Feb 2005 00:17 GMT
You can save the generated wsdl, then change it accordingly, I would
recommend using XMLSpy or other WSDL authoring tool, then regenerate the
server stub using wsdl.exe /server, You'll have to disable the wsdl auto
generation, add "remove" the documentation in web.config

regards
erymuzuan mustapa

> I have a web service being consume by a new client. The WebMethod they are
> calling is called Process.
[quoted text clipped - 31 lines]
>
> Mike
Dino Chiesa [Microsoft] - 22 Feb 2005 05:42 GMT
you can do all of that. but it is not required.
There are attributes that you can attach to your existing Webmethod and
webservice.

example: this sets the element name and namespace of both the request and
response .

   [SoapDocumentMethod
    ("",
     RequestElementName="RequestElement",
     ResponseElementName="ResponseElement",
     RequestNamespace="urn:MyRequestNamespace"
     ResponseNamespace= "urn:MyResponseNamespace",
     Use=System.Web.Services.Description.SoapBindingUse.Literal,
     ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]

check the msdn doc on the SoapDocumentMethodAttribute
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemwebservicesprotoco
lssoapdocumentmethodattributeclasstopic.asp


-Dino

> You can save the generated wsdl, then change it accordingly, I would
> recommend using XMLSpy or other WSDL authoring tool, then regenerate the
[quoted text clipped - 39 lines]
>>
>> Mike
erymuzuan - 22 Feb 2005 05:49 GMT
My recommendation is using WSDL 1st approach. but this may be out of
reach to certain people especially beginners to Web Services. So working
this mickey mouse way may help them to understand the process of
creating a lasting and good web services. especially the relationship
between schemas, messages and port types.

regards
erymuzuan mustap

> you can do all of that. but it is not required.
> There are attributes that you can attach to your existing Webmethod and
[quoted text clipped - 60 lines]
>>>
>>>Mike
Dino Chiesa [Microsoft] - 22 Feb 2005 20:05 GMT
Yes, I agree that "WSDL First" is preferred for interoperability.
In this case, the SoapDocumentAttribute may be sufficient to do the job.  We
are talking only about the response element here.

Either way works.  The "WSDL First" approach is a bit of an uphill struggle
with the current set of tools.  For example wsdl.exe /server generates an
abstract class.  You might think to just inherit from this class and then
provide your concrete implementation, but this will not work, because the
.NET webservices runtime depends on the attributes being attached to the
class itself.  The .NET runtime will not interrogate and utilize the
attributes on the generated class, if you inherit from it.  So in effect you
must cut-and-paste all the attributes from the generated type into your
derived type.  Or, alternatively, modify the generated file to remove the
"abstract" and provide implementations directly.

In short, you have to "fight the tools" in order to practice WSDL first,
today.   So for this reason I recommend it for people who are comfortable
doing so, where interop is a key priority.

If it is just the substitution of one element name for another, then the use
of an inline attribute should be fine. And simpler.

-Dino

> My recommendation is using WSDL 1st approach. but this may be out of reach
> to certain people especially beginners to Web Services. So working this
[quoted text clipped - 70 lines]
>>>>
>>>>Mike

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.