473,583 Members | 2,858 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WSDL.exe vs. "Add Web Reference"

I used WSDL.exe to generate a client side web proxy for a web service, called
the web service, got the results but an array returned by the web service is
not in the results.

However if I use "Add Web Reference" for the same service the same function
works appropriately.

Here is the client proxy generated from WSDL.exe

<System.Web.Ser vices.Protocols .SoapDocumentMe thodAttribute(" capeconnect:App Sec:AppSecPortT ype#getApplicat ionUsers",
RequestElementN ame:="getApplic ationUsersReque st",
RequestNamespac e:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
ResponseNamespa ce:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
Use:=System.Web .Services.Descr iption.SoapBind ingUse.Literal,
ParameterStyle: =System.Web.Ser vices.Protocols .SoapParameterS tyle.Wrapped)> _
Public Function getApplicationU sers() As
<System.Xml.Ser ialization.XmlA rrayAttribute(" users"),
System.Xml.Seri alization.XmlAr rayItemAttribut e("users", IsNullable:=fal se)>
user()
Dim results() As Object = Me.Invoke("getA pplicationUsers ", New
Object(-1) {})
Return CType(results(0 ), user())
End Function

Here is the client proxy from "Add Web Reference"

<System.Web.Ser vices.Protocols .SoapDocumentMe thodAttribute(" capeconnect:App Sec:AppSecPortT ype#getApplicat ionUsers",
RequestElementN ame:="getApplic ationUsersReque st",
RequestNamespac e:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
ResponseNamespa ce:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
Use:=System.Web .Services.Descr iption.SoapBind ingUse.Literal,
ParameterStyle: =System.Web.Ser vices.Protocols .SoapParameterS tyle.Wrapped)> _
Public Function getApplicationU sers() As
<System.Xml.Ser ialization.XmlE lementAttribute ("users")> user()
Dim results() As Object = Me.Invoke("getA pplicationUsers ", New
Object(-1) {})
Return CType(results(0 ),user())
End Function
What is the benefit of using WSDL.exe to generate the client compared to
"Add Web Reference".

Thanks, Mike L.
--
Mike Logan
Nov 23 '05 #1
5 10319
Hi,

Visual Studio actually call the WSDL.exe in the background when
setting a webreference. Essentially there is no difference. The only
different is that when using the command line yourself you have more
contorl over the options you rcan use.

Hope this helps,

Marvin Smit.

On Tue, 25 Oct 2005 11:38:14 -0700, "Mike Logan"
<Mi*******@comm unity.nospam> wrote:
I used WSDL.exe to generate a client side web proxy for a web service, called
the web service, got the results but an array returned by the web service is
not in the results.

However if I use "Add Web Reference" for the same service the same function
works appropriately.

Here is the client proxy generated from WSDL.exe

<System.Web.Se rvices.Protocol s.SoapDocumentM ethodAttribute( "capeconnect:Ap pSec:AppSecPort Type#getApplica tionUsers",
RequestElement Name:="getAppli cationUsersRequ est",
RequestNamespa ce:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
ResponseNamesp ace:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
Use:=System.We b.Services.Desc ription.SoapBin dingUse.Literal ,
ParameterStyle :=System.Web.Se rvices.Protocol s.SoapParameter Style.Wrapped)> _
Public Function getApplicationU sers() As
<System.Xml.Se rialization.Xml ArrayAttribute( "users"),
System.Xml.Ser ialization.XmlA rrayItemAttribu te("users", IsNullable:=fal se)>
user()
Dim results() As Object = Me.Invoke("getA pplicationUsers ", New
Object(-1) {})
Return CType(results(0 ), user())
End Function

Here is the client proxy from "Add Web Reference"

<System.Web.Se rvices.Protocol s.SoapDocumentM ethodAttribute( "capeconnect:Ap pSec:AppSecPort Type#getApplica tionUsers",
RequestElement Name:="getAppli cationUsersRequ est",
RequestNamespa ce:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
ResponseNamesp ace:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
Use:=System.We b.Services.Desc ription.SoapBin dingUse.Literal ,
ParameterStyle :=System.Web.Se rvices.Protocol s.SoapParameter Style.Wrapped)> _
Public Function getApplicationU sers() As
<System.Xml.Se rialization.Xml ElementAttribut e("users")> user()
Dim results() As Object = Me.Invoke("getA pplicationUsers ", New
Object(-1) {})
Return CType(results(0 ),user())
End Function
What is the benefit of using WSDL.exe to generate the client compared to
"Add Web Reference".

Thanks, Mike L.

Nov 23 '05 #2
Hi Mike,

As Marvin has mentioned, the VS.NET IDE actually also use the wsdl.exe or
the same code to generate the clientside proxy but may use some default
setting for some of the wsdl.exe's optional parameters. Is the problem also
occuring on other webmethod?

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: Marvin Smit <ma*********@gm ail.com>
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
Subject: Re: WSDL.exe vs. "Add Web Reference"
Date: Wed, 26 Oct 2005 09:05:33 +0200
Message-ID: <2k************ *************** *****@4ax.com>
References: <38************ *************** *******@microso ft.com>
X-Newsreader: Forte Free Agent 3.0/32.763
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Complaints-To: ab***@chello.nl
Organization: chello.nl
Lines: 58
NNTP-Posting-Host: 62.194.138.116 (62.194.138.116 )
NNTP-Posting-Date: Wed, 26 Oct 2005 09:03:37 +0200
X-Trace: d3f40435f2a499b 672fd104598
Path:
TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!ne wsfeed00.sul.t-online.de!t-onli
ne.de!83.128.0. 12.MISMATCH!new s-out2.kabelfoon. nl!newsfeed.kab elfoon.nl!xind
i.nntp.kabelfoo n.nl!216.196.11 0.149.MISMATCH! border2.nntp.am s.giganews.com! n
ntp.giganews.co m!amsnews11.che llo.com!amsnews 14.chello.com!n ews.chello.nl.P O
STED!not-for-mail
microsoft.publi c.dotnet.framew ork.webservices :8359
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.webservices

Hi,

Visual Studio actually call the WSDL.exe in the background when
setting a webreference. Essentially there is no difference. The only
different is that when using the command line yourself you have more
contorl over the options you rcan use.

Hope this helps,

Marvin Smit.

On Tue, 25 Oct 2005 11:38:14 -0700, "Mike Logan"
<Mi*******@comm unity.nospam> wrote:
I used WSDL.exe to generate a client side web proxy for a web service, calledthe web service, got the results but an array returned by the web service isnot in the results.

However if I use "Add Web Reference" for the same service the same functionworks appropriately.

Here is the client proxy generated from WSDL.exe

<System.Web.Se rvices.Protocol s.SoapDocumentM ethodAttribute( "capeconnect:Ap p Sec:AppSecPortT ype#getApplicat ionUsers",RequestElement Name:="getAppli cationUsersRequ est",
RequestNamespa ce:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
ResponseNamesp ace:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
Use:=System.We b.Services.Desc ription.SoapBin dingUse.Literal ,
ParameterStyle :=System.Web.Se rvices.Protocol s.SoapParameter Style.Wrapped)> _ Public Function getApplicationU sers() As
<System.Xml.Se rialization.Xml ArrayAttribute( "users"),
System.Xml.Ser ialization.XmlA rrayItemAttribu te("users", IsNullable:=fal se)>user()
Dim results() As Object = Me.Invoke("getA pplicationUsers ", New
Object(-1) {})
Return CType(results(0 ), user())
End Function

Here is the client proxy from "Add Web Reference"

<System.Web.Se rvices.Protocol s.SoapDocumentM ethodAttribute( "capeconnect:Ap p Sec:AppSecPortT ype#getApplicat ionUsers",RequestElement Name:="getAppli cationUsersRequ est",
RequestNamespa ce:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
ResponseNamesp ace:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
Use:=System.We b.Services.Desc ription.SoapBin dingUse.Literal ,
ParameterStyle :=System.Web.Se rvices.Protocol s.SoapParameter Style.Wrapped)> _ Public Function getApplicationU sers() As
<System.Xml.Se rialization.Xml ElementAttribut e("users")> user()
Dim results() As Object = Me.Invoke("getA pplicationUsers ", New
Object(-1) {})
Return CType(results(0 ),user())
End Function
What is the benefit of using WSDL.exe to generate the client compared to
"Add Web Reference".

Thanks, Mike L.


Nov 23 '05 #3
This problem doesn't occur on a method that doesn't return an array of
"complexTyp es". I have several other methods that return different types of
complexTypes, and those methods also work in either scenario.

For example this complexType (user):

<xs:complexTy pe name="user">
<xs:sequence>
<xs:element name="userid" type="xs:int" />
<xs:element name="firstname " type="xs:string " />
<xs:element name="middlenam e" type="xs:string " />
<xs:element name="lastname" type="xs:string " />
<xs:element name="suffix" type="xs:string " />
</xs:sequence>
</xs:complexType>

Is made into a class by WSDL, like this:

Public Class user

Public userid As Integer
Public firstname As String
Public middlename As String
ublic lastname As String
Public suffix As String

End Class

The resulting method for returning an array of these was listed in my first
post. I am trying to use the "contract first" method for design of the web
service. I created an XSD with all my types and messages (one incoming and
one outgoing) for each operation. I them created a WSDL using the XSD. The
difference was that I ran WSDL.exe on a real WSDL, and "Add Web Reference"
ran it on a "asmx?WSDL" reference. I generated the "server stubs" using
WSDL.exe i.e.

wsdl.exe /server /out:Server.vb /l:VB AppSec.WSDL AppSec.XSD

Then I placed this file in an "Empty Web Project", added a Web Service, made
the new Web Service class inherit the "Server" stub class, override the
methods, and that was it.

Enough rambling for me. If I do all these steps correctly the client should
turn out the same each way. What I am saying for these scenarios

- A server stub is generated from a WSDL (real one), and the client is also
generated from a WSDL (real one).
- A server stub is generated from a WSDL (real one), and the client is
generated via "Add Web Reference".

The client should be the same in each scenario, correct?

Well that question makes me wonder if the WSDL file is different from the
ASMX?WSDL

I did a quick comparison of these two:

- In my real WSDL each message was post fixed with "Request" (for incoming
messages, and "Response" (for outgoing messages). In the ASMX?WSDL version
all messages were posted fixed with "SoapIn" and "SoapOut" respectively.
- In my original WSDL, the schema was defined in an XSD file. In the
ASMX?WSDL version the schema was embedded.

Other than that no real difference. OK, what is the difference in the
outgoing message of the operation that returns an array of the "user"
complexType.

In my XSD here is the relevant parts.

The outgoing message:

<xs:element name="getApplic ationUsersRespo nse">
<xs:complexType >
<xs:sequence>
<xs:element name="users" type="userList" />
</xs:sequence>
</xs:complexType>
</xs:element>

complexType userList:

<xs:complexTy pe name="userList" >
<xs:sequence>
<xs:element name="users" type="user" maxOccurs="unbo unded" minOccurs="0" />
</xs:sequence>
</xs:complexType>

However in the ASMX?WSDL the outgoing message is defined as this:

<s:element name="getApplic ationUsersRespo nse">
<s:complexTyp e>
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbo unded" name="users"
type="s0:user" />
</s:sequence>
</s:complexType>
</s:element>

I guess this is the difference?? Should my XSD be like the ASMX?WSDL
version of "getApplication UsersResponse"? I will do some testing but if
anyone can shed any light that would be appreciated.

Also, is there a guide on controling the output of the ASMX?WSDL somewhere?

Thanks for the help Marvin and Steven.
Thanks,
--
Mike Logan
"Steven Cheng[MSFT]" wrote:
Hi Mike,

As Marvin has mentioned, the VS.NET IDE actually also use the wsdl.exe or
the same code to generate the clientside proxy but may use some default
setting for some of the wsdl.exe's optional parameters. Is the problem also
occuring on other webmethod?

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: Marvin Smit <ma*********@gm ail.com>
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
Subject: Re: WSDL.exe vs. "Add Web Reference"
Date: Wed, 26 Oct 2005 09:05:33 +0200
Message-ID: <2k************ *************** *****@4ax.com>
References: <38************ *************** *******@microso ft.com>
X-Newsreader: Forte Free Agent 3.0/32.763
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Complaints-To: ab***@chello.nl
Organization: chello.nl
Lines: 58
NNTP-Posting-Host: 62.194.138.116 (62.194.138.116 )
NNTP-Posting-Date: Wed, 26 Oct 2005 09:03:37 +0200
X-Trace: d3f40435f2a499b 672fd104598
Path:
TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!ne wsfeed00.sul.t-online.de!t-onli
ne.de!83.128.0. 12.MISMATCH!new s-out2.kabelfoon. nl!newsfeed.kab elfoon.nl!xind
i.nntp.kabelfoo n.nl!216.196.11 0.149.MISMATCH! border2.nntp.am s.giganews.com! n
ntp.giganews.co m!amsnews11.che llo.com!amsnews 14.chello.com!n ews.chello.nl.P O
STED!not-for-mail
Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.webservices :8359
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.webservices

Hi,

Visual Studio actually call the WSDL.exe in the background when
setting a webreference. Essentially there is no difference. The only
different is that when using the command line yourself you have more
contorl over the options you rcan use.

Hope this helps,

Marvin Smit.

On Tue, 25 Oct 2005 11:38:14 -0700, "Mike Logan"
<Mi*******@comm unity.nospam> wrote:
I used WSDL.exe to generate a client side web proxy for a web service,

called
the web service, got the results but an array returned by the web service

is
not in the results.

However if I use "Add Web Reference" for the same service the same

function
works appropriately.

Here is the client proxy generated from WSDL.exe

<System.Web.Se rvices.Protocol s.SoapDocumentM ethodAttribute( "capeconnect:Ap p

Sec:AppSecPortT ype#getApplicat ionUsers",
RequestElement Name:="getAppli cationUsersRequ est",
RequestNamespa ce:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
ResponseNamesp ace:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
Use:=System.We b.Services.Desc ription.SoapBin dingUse.Literal ,
ParameterStyle :=System.Web.Se rvices.Protocol s.SoapParameter Style.Wrapped)>

_
Public Function getApplicationU sers() As
<System.Xml.Se rialization.Xml ArrayAttribute( "users"),
System.Xml.Ser ialization.XmlA rrayItemAttribu te("users",

IsNullable:=fal se)>
user()
Dim results() As Object = Me.Invoke("getA pplicationUsers ", New
Object(-1) {})
Return CType(results(0 ), user())
End Function

Here is the client proxy from "Add Web Reference"

<System.Web.Se rvices.Protocol s.SoapDocumentM ethodAttribute( "capeconnect:Ap p

Sec:AppSecPortT ype#getApplicat ionUsers",
RequestElement Name:="getAppli cationUsersRequ est",
RequestNamespa ce:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
ResponseNamesp ace:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
Use:=System.We b.Services.Desc ription.SoapBin dingUse.Literal ,
ParameterStyle :=System.Web.Se rvices.Protocol s.SoapParameter Style.Wrapped)>

_
Public Function getApplicationU sers() As
<System.Xml.Se rialization.Xml ElementAttribut e("users")> user()
Dim results() As Object = Me.Invoke("getA pplicationUsers ", New
Object(-1) {})
Return CType(results(0 ),user())
End Function
What is the benefit of using WSDL.exe to generate the client compared to
"Add Web Reference".

Thanks, Mike L

Nov 23 '05 #4
That was it. Chaning my outgoing message in the XSD from this:

<xs:element name="getApplic ationUsersRespo nse">
<xs:complexType >
<xs:sequence>
<xs:element name="users" type="userList" />
</xs:sequence>
</xs:complexType>
</xs:element>

To this:

<xs:complexTy pe name="userList" >
<xs:sequence>
<xs:element name="users" type="user" maxOccurs="unbo unded" minOccurs="0" />
</xs:sequence>
</xs:complexType>

and the now the client works correctly....!

--
Mike Logan
"Mike Logan" wrote:
This problem doesn't occur on a method that doesn't return an array of
"complexTyp es". I have several other methods that return different types of
complexTypes, and those methods also work in either scenario.

For example this complexType (user):

<xs:complexTy pe name="user">
<xs:sequence>
<xs:element name="userid" type="xs:int" />
<xs:element name="firstname " type="xs:string " />
<xs:element name="middlenam e" type="xs:string " />
<xs:element name="lastname" type="xs:string " />
<xs:element name="suffix" type="xs:string " />
</xs:sequence>
</xs:complexType>

Is made into a class by WSDL, like this:

Public Class user

Public userid As Integer
Public firstname As String
Public middlename As String
ublic lastname As String
Public suffix As String

End Class

The resulting method for returning an array of these was listed in my first
post. I am trying to use the "contract first" method for design of the web
service. I created an XSD with all my types and messages (one incoming and
one outgoing) for each operation. I them created a WSDL using the XSD. The
difference was that I ran WSDL.exe on a real WSDL, and "Add Web Reference"
ran it on a "asmx?WSDL" reference. I generated the "server stubs" using
WSDL.exe i.e.

wsdl.exe /server /out:Server.vb /l:VB AppSec.WSDL AppSec.XSD

Then I placed this file in an "Empty Web Project", added a Web Service, made
the new Web Service class inherit the "Server" stub class, override the
methods, and that was it.

Enough rambling for me. If I do all these steps correctly the client should
turn out the same each way. What I am saying for these scenarios

- A server stub is generated from a WSDL (real one), and the client is also
generated from a WSDL (real one).
- A server stub is generated from a WSDL (real one), and the client is
generated via "Add Web Reference".

The client should be the same in each scenario, correct?

Well that question makes me wonder if the WSDL file is different from the
ASMX?WSDL

I did a quick comparison of these two:

- In my real WSDL each message was post fixed with "Request" (for incoming
messages, and "Response" (for outgoing messages). In the ASMX?WSDL version
all messages were posted fixed with "SoapIn" and "SoapOut" respectively.
- In my original WSDL, the schema was defined in an XSD file. In the
ASMX?WSDL version the schema was embedded.

Other than that no real difference. OK, what is the difference in the
outgoing message of the operation that returns an array of the "user"
complexType.

In my XSD here is the relevant parts.

The outgoing message:

<xs:element name="getApplic ationUsersRespo nse">
<xs:complexType >
<xs:sequence>
<xs:element name="users" type="userList" />
</xs:sequence>
</xs:complexType>
</xs:element>

complexType userList:

<xs:complexTy pe name="userList" >
<xs:sequence>
<xs:element name="users" type="user" maxOccurs="unbo unded" minOccurs="0" />
</xs:sequence>
</xs:complexType>

However in the ASMX?WSDL the outgoing message is defined as this:

<s:element name="getApplic ationUsersRespo nse">
<s:complexTyp e>
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbo unded" name="users"
type="s0:user" />
</s:sequence>
</s:complexType>
</s:element>

I guess this is the difference?? Should my XSD be like the ASMX?WSDL
version of "getApplication UsersResponse"? I will do some testing but if
anyone can shed any light that would be appreciated.

Also, is there a guide on controling the output of the ASMX?WSDL somewhere?

Thanks for the help Marvin and Steven.
Thanks,
--
Mike Logan
"Steven Cheng[MSFT]" wrote:
Hi Mike,

As Marvin has mentioned, the VS.NET IDE actually also use the wsdl.exe or
the same code to generate the clientside proxy but may use some default
setting for some of the wsdl.exe's optional parameters. Is the problem also
occuring on other webmethod?

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: Marvin Smit <ma*********@gm ail.com>
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
Subject: Re: WSDL.exe vs. "Add Web Reference"
Date: Wed, 26 Oct 2005 09:05:33 +0200
Message-ID: <2k************ *************** *****@4ax.com>
References: <38************ *************** *******@microso ft.com>
X-Newsreader: Forte Free Agent 3.0/32.763
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Complaints-To: ab***@chello.nl
Organization: chello.nl
Lines: 58
NNTP-Posting-Host: 62.194.138.116 (62.194.138.116 )
NNTP-Posting-Date: Wed, 26 Oct 2005 09:03:37 +0200
X-Trace: d3f40435f2a499b 672fd104598
Path:
TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!ne wsfeed00.sul.t-online.de!t-onli
ne.de!83.128.0. 12.MISMATCH!new s-out2.kabelfoon. nl!newsfeed.kab elfoon.nl!xind
i.nntp.kabelfoo n.nl!216.196.11 0.149.MISMATCH! border2.nntp.am s.giganews.com! n
ntp.giganews.co m!amsnews11.che llo.com!amsnews 14.chello.com!n ews.chello.nl.P O
STED!not-for-mail
Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.webservices :8359
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.webservices

Hi,

Visual Studio actually call the WSDL.exe in the background when
setting a webreference. Essentially there is no difference. The only
different is that when using the command line yourself you have more
contorl over the options you rcan use.

Hope this helps,

Marvin Smit.

On Tue, 25 Oct 2005 11:38:14 -0700, "Mike Logan"
<Mi*******@comm unity.nospam> wrote:
I used WSDL.exe to generate a client side web proxy for a web service,

called
the web service, got the results but an array returned by the web service

is
not in the results.

However if I use "Add Web Reference" for the same service the same

function
works appropriately.

Here is the client proxy generated from WSDL.exe

<System.Web.Se rvices.Protocol s.SoapDocumentM ethodAttribute( "capeconnect:Ap p

Sec:AppSecPortT ype#getApplicat ionUsers",
RequestElement Name:="getAppli cationUsersRequ est",
RequestNamespa ce:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
ResponseNamesp ace:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
Use:=System.We b.Services.Desc ription.SoapBin dingUse.Literal ,
ParameterStyle :=System.Web.Se rvices.Protocol s.SoapParameter Style.Wrapped)>

_
Public Function getApplicationU sers() As
<System.Xml.Se rialization.Xml ArrayAttribute( "users"),
System.Xml.Ser ialization.XmlA rrayItemAttribu te("users",

IsNullable:=fal se)>
user()
Dim results() As Object = Me.Invoke("getA pplicationUsers ", New
Object(-1) {})
Return CType(results(0 ), user())
End Function

Here is the client proxy from "Add Web Reference"

<System.Web.Se rvices.Protocol s.SoapDocumentM ethodAttribute( "capeconnect:Ap p

Sec:AppSecPortT ype#getApplicat ionUsers",
RequestElement Name:="getAppli cationUsersRequ est",
RequestNamespa ce:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
ResponseNamesp ace:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
Use:=System.We b.Services.Desc ription.SoapBin dingUse.Literal ,
ParameterStyle :=System.Web.Se rvices.Protocol s.SoapParameter Style.Wrapped)>

_
Public Function getApplicationU sers() As
<System.Xml.Se rialization.Xml ElementAttribut e("users")> user()
Dim results() As Object = Me.Invoke("getA pplicationUsers ", New
Object(-1) {})
Return CType(results(0 ),user())
End Function
What is the benefit of using WSDL.exe to generate the client compared to
"Add Web Reference".

Thanks, Mike L

Nov 23 '05 #5
Thanks for your further followup Mike,

Glad that you're got it working now. If there're any further questions
later, please feel free to post here.

Thanks & Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
Thread-Topic: WSDL.exe vs. "Add Web Reference"
thread-index: AcXaKz/FNXE+LT1tQcGN5c GeXMBAnQ==
X-WBNR-Posting-Host: 165.176.240.10
From: "=?Utf-8?B?TWlrZSBMb2d hbg==?=" <Mi*******@comm unity.nospam>
References: <38************ *************** *******@microso ft.com>
<2k************ *************** *****@4ax.com>
<f$************ **@TK2MSFTNGXA0 1.phx.gbl>
<D9************ *************** *******@microso ft.com>
Subject: Re: WSDL.exe vs. "Add Web Reference"
Date: Wed, 26 Oct 2005 05:46:13 -0700
Lines: 249
Message-ID: <8E************ *************** *******@microso ft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA02.phx.gbl!T K2MSFTNGXA03.ph x.gbl
microsoft.publi c.dotnet.framew ork.webservices :8362
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.webservices

That was it. Chaning my outgoing message in the XSD from this:

<xs:element name="getApplic ationUsersRespo nse">
<xs:complexType >
<xs:sequence>
<xs:element name="users" type="userList" />
</xs:sequence>
</xs:complexType>
</xs:element>

To this:

<xs:complexTy pe name="userList" >
<xs:sequence>
<xs:element name="users" type="user" maxOccurs="unbo unded" minOccurs="0"
/>
</xs:sequence>
</xs:complexType>

and the now the client works correctly....!

--
Mike Logan
"Mike Logan" wrote:
This problem doesn't occur on a method that doesn't return an array of
"complexTyp es". I have several other methods that return different types of complexTypes, and those methods also work in either scenario.

For example this complexType (user):

<xs:complexTy pe name="user">
<xs:sequence>
<xs:element name="userid" type="xs:int" />
<xs:element name="firstname " type="xs:string " />
<xs:element name="middlenam e" type="xs:string " />
<xs:element name="lastname" type="xs:string " />
<xs:element name="suffix" type="xs:string " />
</xs:sequence>
</xs:complexType>

Is made into a class by WSDL, like this:

Public Class user

Public userid As Integer
Public firstname As String
Public middlename As String
ublic lastname As String
Public suffix As String

End Class

The resulting method for returning an array of these was listed in my first post. I am trying to use the "contract first" method for design of the web service. I created an XSD with all my types and messages (one incoming and one outgoing) for each operation. I them created a WSDL using the XSD. The difference was that I ran WSDL.exe on a real WSDL, and "Add Web Reference" ran it on a "asmx?WSDL" reference. I generated the "server stubs" using
WSDL.exe i.e.

wsdl.exe /server /out:Server.vb /l:VB AppSec.WSDL AppSec.XSD

Then I placed this file in an "Empty Web Project", added a Web Service, made the new Web Service class inherit the "Server" stub class, override the
methods, and that was it.

Enough rambling for me. If I do all these steps correctly the client should turn out the same each way. What I am saying for these scenarios

- A server stub is generated from a WSDL (real one), and the client is also generated from a WSDL (real one).
- A server stub is generated from a WSDL (real one), and the client is
generated via "Add Web Reference".

The client should be the same in each scenario, correct?

Well that question makes me wonder if the WSDL file is different from the
ASMX?WSDL

I did a quick comparison of these two:

- In my real WSDL each message was post fixed with "Request" (for incoming messages, and "Response" (for outgoing messages). In the ASMX?WSDL version all messages were posted fixed with "SoapIn" and "SoapOut" respectively.
- In my original WSDL, the schema was defined in an XSD file. In the
ASMX?WSDL version the schema was embedded.

Other than that no real difference. OK, what is the difference in the
outgoing message of the operation that returns an array of the "user"
complexType.

In my XSD here is the relevant parts.

The outgoing message:

<xs:element name="getApplic ationUsersRespo nse">
<xs:complexType >
<xs:sequence>
<xs:element name="users" type="userList" />
</xs:sequence>
</xs:complexType>
</xs:element>

complexType userList:

<xs:complexTy pe name="userList" >
<xs:sequence>
<xs:element name="users" type="user" maxOccurs="unbo unded" minOccurs="0" /> </xs:sequence>
</xs:complexType>

However in the ASMX?WSDL the outgoing message is defined as this:

<s:element name="getApplic ationUsersRespo nse">
<s:complexTyp e>
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbo unded" name="users"
type="s0:user" />
</s:sequence>
</s:complexType>
</s:element>

I guess this is the difference?? Should my XSD be like the ASMX?WSDL
version of "getApplication UsersResponse"? I will do some testing but if
anyone can shed any light that would be appreciated.

Also, is there a guide on controling the output of the ASMX?WSDL somewhere?
Thanks for the help Marvin and Steven.
Thanks,
--
Mike Logan
"Steven Cheng[MSFT]" wrote:
Hi Mike,

As Marvin has mentioned, the VS.NET IDE actually also use the wsdl.exe or the same code to generate the clientside proxy but may use some default
setting for some of the wsdl.exe's optional parameters. Is the problem also occuring on other webmethod?

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: Marvin Smit <ma*********@gm ail.com>
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
Subject: Re: WSDL.exe vs. "Add Web Reference"
Date: Wed, 26 Oct 2005 09:05:33 +0200
Message-ID: <2k************ *************** *****@4ax.com>
References: <38************ *************** *******@microso ft.com>
X-Newsreader: Forte Free Agent 3.0/32.763
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Complaints-To: ab***@chello.nl
Organization: chello.nl
Lines: 58
NNTP-Posting-Host: 62.194.138.116 (62.194.138.116 )
NNTP-Posting-Date: Wed, 26 Oct 2005 09:03:37 +0200
X-Trace: d3f40435f2a499b 672fd104598
Path:
TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!ne wsfeed00.sul.t-online.de!t-onli ne.de!83.128.0. 12.MISMATCH!new s-out2.kabelfoon. nl!newsfeed.kab elfoon.nl!xind i.nntp.kabelfoo n.nl!216.196.11 0.149.MISMATCH! border2.nntp.am s.giganews.com! n ntp.giganews.co m!amsnews11.che llo.com!amsnews 14.chello.com!n ews.chello.nl.P O STED!not-for-mail
Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.webservices :8359
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.webservices

Hi,

Visual Studio actually call the WSDL.exe in the background when
setting a webreference. Essentially there is no difference. The only
different is that when using the command line yourself you have more
contorl over the options you rcan use.

Hope this helps,

Marvin Smit.

On Tue, 25 Oct 2005 11:38:14 -0700, "Mike Logan"
<Mi*******@comm unity.nospam> wrote:
I used WSDL.exe to generate a client side web proxy for a web service,

called
the web service, got the results but an array returned by the web service
is
not in the results.

However if I use "Add Web Reference" for the same service the same

function
works appropriately.

Here is the client proxy generated from WSDL.exe

<System.Web.Se rvices.Protocol s.SoapDocumentM ethodAttribute( "capeconnect:Ap p
Sec:AppSecPortT ype#getApplicat ionUsers",
RequestElement Name:="getAppli cationUsersRequ est",
RequestNamespa ce:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
ResponseNamesp ace:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
Use:=System.We b.Services.Desc ription.SoapBin dingUse.Literal ,

ParameterStyle :=System.Web.Se rvices.Protocol s.SoapParameter Style.Wrapped)>
_
Public Function getApplicationU sers() As
<System.Xml.Se rialization.Xml ArrayAttribute( "users"),
System.Xml.Ser ialization.XmlA rrayItemAttribu te("users",

IsNullable:=fal se)>
user()
Dim results() As Object = Me.Invoke("getA pplicationUsers ", New
Object(-1) {})
Return CType(results(0 ), user())
End Function

Here is the client proxy from "Add Web Reference"

<System.Web.Se rvices.Protocol s.SoapDocumentM ethodAttribute( "capeconnect:Ap p
Sec:AppSecPortT ype#getApplicat ionUsers",
RequestElement Name:="getAppli cationUsersRequ est",
RequestNamespa ce:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
ResponseNamesp ace:="http://www.vita.virgin ia.gov/xml/xsd/AppSec1.xsd",
Use:=System.We b.Services.Desc ription.SoapBin dingUse.Literal ,

ParameterStyle :=System.Web.Se rvices.Protocol s.SoapParameter Style.Wrapped)>
_
Public Function getApplicationU sers() As
<System.Xml.Se rialization.Xml ElementAttribut e("users")> user()
Dim results() As Object = Me.Invoke("getA pplicationUsers ",

NewObject(-1) {})
Return CType(results(0 ),user())
End Function
What is the benefit of using WSDL.exe to generate the client compared to"Add Web Reference".

Thanks, Mike L


Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1600
by: Brad Quinn | last post by:
Is there a way to add an assembly to the .NET tab of the "Add Reference" dialog?
10
5070
by: msnews.microsoft.com | last post by:
Hi, How do I add a reference in VC++.NET? In VB.NET and VC#.NET, there's an option in "Project" menu called "Add Reference". This will add a .NET DLL reference to the current project. After I add a reference, I can start using the class in the DLL as follows: Imports <TheNamespace>
5
2191
by: Trevor Andrew | last post by:
Hi There I am having some difficulty referencing Web Services. I am using Visual Studio .NET 2003, with the .NET Framework 1.1, and trying to write a VB.NET Windows Application that consumes an external Web Service When I endeavour to use the "Add Web Reference" and select a URL which I know returns a WSDL file, I get prompted with the...
3
1727
by: Samuel R. Neff | last post by:
I just started having a problem with the Add Reference dialog not displaying in VS.NET 2003. Whenever I click Add Reference the dialog doesn't display. I've tried several different projects and solutions and rebooted the computer. No error message, just no dialog. Add Web Reference brings up a dialog, just Add Reference doesn't. If I...
1
2161
by: SrDhUS | last post by:
I get the following error when I try to add a web reference using Web Reference Dialog (VS .Net 2003) Error "The proxy settings on this computer are not configured correctly for web discovery." MSDN says: "The proxy settings on this computer are not configured correctly for Web discovery.
5
2948
by: Matthew.DelVecchio | last post by:
hello, i am working w/ a partner company's webservice, which they wrote in java. using a provided webservice.wsdl file, i am able to compile it into a proxy class, webservice.dll. i can add this assembly reference to my test ASP.NET C# test project and use it no problem. problem -- our production ASP.NET project uses strongly-named
1
2074
by: PJSimon | last post by:
In regards to this MSDN article: http://support.microsoft.com/default.aspx?scid=kb;en-us;306149 .... how do I add the registry key? I got confused on three points: 1) I do not have a key named ".NETFramework" under the "Microsoft" key. Should I just create it? 2) I don't know what to add to the "MyAssemblies" folder.
2
7562
by: Ottavio | last post by:
Hello, I'm having some problems with the authentication during a web service call I know I have to add the "Authorization: Basic xxxxxxxx" in the http header (not soap header) but I can't find a way to add it. I've tryed to use ethereal to watch what I'm sending and I can see all the header...
2
2988
by: =?Utf-8?B?b3VyaQ==?= | last post by:
Hi, I am creating a new 'windows application' project in studio 2003. then I am trying to add a web reference to that project. I tried to reference douzen different wsdl urls, including google, amazon and others and whenever I press the 'go' button, right after the interface to that service starts to appear on the right side of this dialog...
0
7888
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7811
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8159
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6571
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5689
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5366
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3811
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3836
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1416
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.