473,387 Members | 3,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Add Service Reference: Generated code misses parameters

Hi,

I've been trying like a madman to make my WSDL work with .net, but it
seems I am out of luck. Whenever I add a service reference to Visual
C#, the code gets generated fine, however all operations miss their
parameters, which is very weird. I have stripped down the WSDL to an
example of a singe simple function. Before I post all the WSDL, here
is what I tried. I loaded the WSDL using the "add service reference"
function. I got code like this:
[System.Diagnostics.DebuggerStepThroughAttribute()]

[System.CodeDom.Compiler.GeneratedCodeAttribute("Sy stem.ServiceModel",
"3.0.0.0")]
public partial class simpleServicePortTypeClient :
System.ServiceModel.ClientBase<SimpleTest.HelloSer vice.simpleServicePortType>,
SimpleTest.HelloService.simpleServicePortType {

...
public void hello() {
base.Channel.hello();
}
...
}
I would have expected something like

public HelloOutput hello(String username, String password,
String foo, String bar) {
}

or maybe

public HelloOutput hello(HelloInput helloInput) {
}

I got no error messages whatsoever, neither did svcutil place some
comments into the generated code stating some problem. I also tried the
svcutil.exe command line, which yields the exact same result.

Here is the WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<!--simple Service Interface: v1.5, 01.09.2008-->
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="http://service.simple.example.com"
xmlns:ns="http://service.simple.example.com"
xmlns:ns1="http://shared.simple.example.com"
targetNamespace="http://service.simple.example.com">
<wsdl:import namespace="http://service.simple.example.com"
location="simple-service-types.xsd"/>
<wsdl:types>
<xs:schema targetNamespace="http://service.simple.example.com"
elementFormDefault="qualified">
<xs:element name="hello" type="tns:HelloInput"/>
<xs:element name="helloResponse" type="tns:HelloOutput"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="HelloIn">
<wsdl:part name="parameters" element="tns:hello"/>
</wsdl:message>
<wsdl:message name="HelloOut">
<wsdl:part name="parameters" element="tns:helloResponse"/>
</wsdl:message>
<wsdl:portType name="simpleServicePortType">
<wsdl:operation name="hello">
<wsdl:input message="tns:HelloIn"/>
<wsdl:output message="tns:HelloOut"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="simpleServiceBinding" type="tns:simpleServicePortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="hello">
<soap:operation
soapAction="http://service.simple.example.com/beginTimeBasedSession"
style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="simpleService">
<wsdl:port name="simpleServicePort" binding="tns:simpleServiceBinding">
<soap:address
location="http://simple.example.com/services/simpleService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
As you might have noticed, I tried to implement document/literal
wrapped style here, so the function Hello uses two elements "hello" and
"helloResponse" for their in- and output messages. I also reference two
XSD files, one with Hello-Specific types and one with generic types:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:shared="http://shared.simple.example.com"
xmlns:service="http://service.simple.example.com"
targetNamespace="http://service.simple.example.com"
elementFormDefault="qualified" attributeFormDefault="qualified">
<!--simple-Service-Types: v1.5, 01.09.2008-->
<xs:import namespace="http://shared.simple.example.com"
schemaLocation="simple-shared-types.xsd"/>

<xs:complexType name="HelloInput">
<xs:complexContent>
<xs:extension base="shared:UserBasedInput"/>
</xs:complexContent>
</xs:complexType>

<xs:complexType name="HelloOutput">
<xs:complexContent>
<xs:extension base="shared:GenericOutput"/>
</xs:complexContent>
</xs:complexType>
</xs:schema>
And:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:shared="http://shared.simple.example.com"
targetNamespace="http://shared.simple.example.com"
elementFormDefault="qualified" attributeFormDefault="qualified">
<!--Generic Complex Types-->
<xs:complexType name="GenericInput">
<xs:annotation>
<xs:documentation>Generic abstract input type for all kinds of
requests</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="foo" type="xs:string" nillable="true"/>
<xs:element name="bar" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="GenericOutput">
<xs:annotation>
<xs:documentation>Generic abstract output type for all kinds of
requests</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="returncode" type="xs:string" nillable="true"/>
<xs:element name="message" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="UserBasedInput">
<xs:annotation>
<xs:documentation>Generic abstract input type for all kinds of
requests requiring a user.</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="shared:GenericInput">
<xs:sequence>
<xs:element name="username" type="xs:string"
nillable="true"/>
<xs:element name="password" type="xs:string"
nillable="true"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>

Sorry for the somewhat lengthly post, however this was the shortest
example that produced the behaviour. Any ideas on what I am doing wrong
would be greatly appreciated.
Thank you and best regards,
Jan

Sep 1 '08 #1
0 2808

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

Similar topics

3
by: Marty McDonald | last post by:
Using Visual Studio.Net... I have two classes, one derives from the other. My web service accepts the base class as input, it returns the derived class as the return value. When I set a web...
12
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded...
3
by: Andy | last post by:
If I use Visual Studio.Net 2003 to generate "web references" for clients using either sproxy.exe (for C++) client or wsdl.exe (for C#) clients, the web service endpoint gets "baked" into the...
3
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : ...
2
by: BluNuit | last post by:
I have a simple c# app that calls a Java (AXIS) web service to perform some operations. The call works fine (the java code fires and the operations are executed), but the response is always null. ...
10
by: amazon | last post by:
Our vender provided us a web service: 1xyztest.xsd file... ------------------------------------ postEvent PostEventRequest ------------------------------------- authetication authentication...
0
by: Al Santino | last post by:
Hello, I'm writing a service using VS2005 and C#. I've found that only the objects used as parameters in WebMethods get exported to proxy dlls and the Service Description. My service clients can...
0
by: vpal61 | last post by:
Hello, I have an Excel/VBA web service client with SOAP Toolkit, consuming Apache Tomcat webservice, which is working fine. Now I am trying to migrate to .NET, and build client in VS2005 with...
5
by: cj | last post by:
Back some time ago I was playing with a little app in VB 2005 that used a google web service to get search results. I was rebuilding this app in 2008 today. I added the web service...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.