Thanks for your help.
Here's a little more information.
In all I have a been provided with six sets of WSDL /XSD files. In some
cases I have to create a consumer and in others I have to create the web
service itself. The consumers are a mix of VB .Net and VB 6 applications.
Producing the consumers doesn't appear to be a problem (..there is a small
of issue around passing complex types through the SOAP toolkit in VB6 ...
but that's not my main concern at the moment)
I have used a combination of WSDL.Exe and XSD.EXE to produce the web service
classes however I am not sure how to prove that the resulting XML conforms
to the specified schema(s).
Also, in order to have the methods recognised as webmethods I have had to
remove the SOAP header inf that was generated by WSDL
Example - WSDL.Exe produces the following excerpt
<System.Web.Services.Protocols.SoapHeaderAttribute("channelHeader",
Direction:=System.Web.Services.Protocols.SoapHeaderDirection.InOut), _
System.Web.Services.Protocols.SoapHeaderAttribute("coHeader",
Direction:=System.Web.Services.Protocols.SoapHeaderDirection.InOut), _
System.Web.Services.Protocols.SoapHeaderAttribute("userHeader",
Direction:=System.Web.Services.Protocols.SoapHeaderDirection.InOut), _
System.Web.Services.Protocols.SoapDocumentMethodAttribute("NewCTFApplic
ationResponse1",
Use:=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Bare)> _
Public Function
NewCTFApplicationResponse1(<System.Xml.Serialization.XmlElementAttribute([Na
mespace]:="http://capita.co.uk/clps/1.0.07/")> ByVal
NewCTFApplicationResponseInput1 As NewCTFApplicationResponseInput1) As
<System.Xml.Serialization.XmlElementAttribute("NewCTFApplicationResponseOutp
ut1", [Namespace]:="http://capita.co.uk/clps/1.0.07/")>
NewCTFApplicationResponseOutput1
Dim results() As Object = Me.Invoke("NewCTFApplicationResponse1",
New Object() {NewCTFApplicationResponseInput1})
Return CType(results(0), NewCTFApplicationResponseOutput1)
End Function
In order to get the method recognised as a web method (and to return a
result) I changed the above to : -
<System.Web.Services.WebService(Namespace:="http://capita.co.uk/clps/NewCTFA
pplicationResponse1")> _
Public Class NewCTFApplicationResponse1
Inherits System.Web.Services.WebService
Public coHeader As coHeaderType
Public userHeader As userHeaderType
Public channelHeader As channelHeaderType
<WebMethod()> _
Public Function
NewCTFApplicationResponse1(<System.Xml.Serialization.XmlElementAttribute([Na
mespace]:="http://capita.co.uk/clps/1.0.07/")> ByVal oResponseInput As
NewCTFApplicationResponseInput1) As
<System.Xml.Serialization.XmlElementAttribute("NewCTFApplicationResponseOutp
ut1", [Namespace]:="http://capita.co.uk/clps/1.0.07/")>
NewCTFApplicationResponseOutput1
Dim oReturn As New NewCTFApplicationResponseOutput1
oReturn.result = "Hello"
Return oReturn
End Function
Thereby removing the SOAP header
Again, thank you for your help.
Gary Dunne
> the XSD.exe tool can be used to help map between .NET classes and XML files.
> (This is called XML Serialization). The XSD.exe tool can read a W3C XML
[quoted text clipped - 56 lines]
> >
> > Gary
Hmmm.,
First,
in your example you show what WSDL.exe has produced.
This appears to be an excerpt from a client-side proxy class.
With the modifications you described, you are trying to convert that
client-side proxy class into a server-side webservice. Is that right?
If you want to generate a service from a WSDL file, why are you not using
the /server switch on the wsdl.exe command ?
wsdl.exe <file> - generates a client-side proxy
wsdl.exe /server <file> - generates a server-side skeleton (Actually an
abstract class)
You will still need to modify the code that is generated using the /server
switch. But it consists of modifications to make the class concrete, not
abstract. In other words, remove the abstract qualifier on the class, and
provide concrete implementations for each of the methods.
I do not recommend using the abstract class as generated from the tool. The
reason is that all of the attributes (which may be many) on the class and
its methods do not apply to subclasses. So you would have to cut-n-paste
all that code, which is error prone. Why do it? Just modify the abstract
class directly.
Does this help?
-D
> Thanks for your help.
>
[quoted text clipped - 19 lines]
> System.Web.Services.Protocols.SoapHeaderAttribute("userHeader",
> Direction:=System.Web.Services.Protocols.SoapHeaderDirection.InOut), _
System.Web.Services.Protocols.SoapDocumentMethodAttribute("NewCTFApplic
> ationResponse1",
> Use:=System.Web.Services.Description.SoapBindingUse.Literal,
> ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Bare)> _
> Public Function
NewCTFApplicationResponse1(<System.Xml.Serialization.XmlElementAttribute([Na
> mespace]:="http://capita.co.uk/clps/1.0.07/")> ByVal
> NewCTFApplicationResponseInput1 As NewCTFApplicationResponseInput1) As
<System.Xml.Serialization.XmlElementAttribute("NewCTFApplicationResponseOutp
> ut1", [Namespace]:="http://capita.co.uk/clps/1.0.07/")>
> NewCTFApplicationResponseOutput1
[quoted text clipped - 5 lines]
> In order to get the method recognised as a web method (and to return a
> result) I changed the above to : -
<System.Web.Services.WebService(Namespace:="http://capita.co.uk/clps/NewCTFA
> pplicationResponse1")> _
> Public Class NewCTFApplicationResponse1
[quoted text clipped - 8 lines]
> <WebMethod()> _
> Public Function
NewCTFApplicationResponse1(<System.Xml.Serialization.XmlElementAttribute([Na
> mespace]:="http://capita.co.uk/clps/1.0.07/")> ByVal oResponseInput As
> NewCTFApplicationResponseInput1) As
<System.Xml.Serialization.XmlElementAttribute("NewCTFApplicationResponseOutp
> ut1", [Namespace]:="http://capita.co.uk/clps/1.0.07/")>
> NewCTFApplicationResponseOutput1
[quoted text clipped - 72 lines]
> > >
> > > Gary
Gary Dunne - 29 Jul 2004 18:34 GMT
I hadn't spotted the Server switch. .... after some tweaking it works
perfectly now.
Thanks for your help .......... saved me a lot of stress and effort :-)
Gary Dunne
> Hmmm.,
> First,
[quoted text clipped - 55 lines]
> > ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Bare)> _
> > Public Function
NewCTFApplicationResponse1(<System.Xml.Serialization.XmlElementAttribute([Na
> > mespace]:="http://capita.co.uk/clps/1.0.07/")> ByVal
> > NewCTFApplicationResponseInput1 As NewCTFApplicationResponseInput1) As
<System.Xml.Serialization.XmlElementAttribute("NewCTFApplicationResponseOutp
> > ut1", [Namespace]:="http://capita.co.uk/clps/1.0.07/")>
> > NewCTFApplicationResponseOutput1
[quoted text clipped - 5 lines]
> > In order to get the method recognised as a web method (and to return a
> > result) I changed the above to : -
<System.Web.Services.WebService(Namespace:="http://capita.co.uk/clps/NewCTFA
> > pplicationResponse1")> _
> > Public Class NewCTFApplicationResponse1
[quoted text clipped - 8 lines]
> > <WebMethod()> _
> > Public Function
NewCTFApplicationResponse1(<System.Xml.Serialization.XmlElementAttribute([Na
> > mespace]:="http://capita.co.uk/clps/1.0.07/")> ByVal oResponseInput As
> > NewCTFApplicationResponseInput1) As
<System.Xml.Serialization.XmlElementAttribute("NewCTFApplicationResponseOutp
> > ut1", [Namespace]:="http://capita.co.uk/clps/1.0.07/")>
> > NewCTFApplicationResponseOutput1
[quoted text clipped - 83 lines]
> > > >
> > > > Gary