473,715 Members | 4,902 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Client code w/wsdl.exe

I use wsdl.exe to generate client code to call a web service. The actual web
service is generated with the BizTalk Web Services Publishing Wizard.

I'm not sure this is particular to the BizTalk code but the calls to web
methods pass parameters by ref so that I have to call it like:

XmlDocument doc = new XmlDocument();

doc.LoadXml(mes sage);

XmlNode node = doc.DocumentEle ment.ParentNode ;

ws.MyMethod(ref node);

I attempt to modify the generated client code so that the parameter is not
passed by ref and is instead returned as a response but I keep getting an
"object not referenced" error.

Is there a way to tell wsdl.exe to not generate a "ref" parameter?

Is the problem I describe just because this is calling a BizTalk web service
or have others seen this?

Mar 14 '07 #1
5 4978
"Nick K." <nk*****@msn.co mwrote in message
news:uS******** ******@TK2MSFTN GP04.phx.gbl...
>I use wsdl.exe to generate client code to call a web service. The actual
web service is generated with the BizTalk Web Services Publishing Wizard.

I'm not sure this is particular to the BizTalk code but the calls to web
methods pass parameters by ref so that I have to call it like:

XmlDocument doc = new XmlDocument();

doc.LoadXml(mes sage);

XmlNode node = doc.DocumentEle ment.ParentNode ;

ws.MyMethod(ref node);

I attempt to modify the generated client code so that the parameter is not
passed by ref and is instead returned as a response but I keep getting an
"object not referenced" error.

Is there a way to tell wsdl.exe to not generate a "ref" parameter?

Is the problem I describe just because this is calling a BizTalk web
service or have others seen this?
If WSDL.EXE is generating a "ref" parameter, then the chances are that it
needs to be a "ref" parameter.

Have you taken a look into the WSDL file to see what it says about this
parameter?

John
Mar 14 '07 #2
I'm not sure I see anything so I will just show the entire wsdl, hopefully
someone can find something that will show me what to change in the wsdl to
change so that I not pass the parameter by ref:

<?xml version="1.0" encoding="utf-8" ?>

- <wsdl:definitio ns xmlns:soap="htt p://schemas.xmlsoap .org/wsdl/soap/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/"
xmlns:mime="htt p://schemas.xmlsoap .org/wsdl/mime/"
xmlns:tns="http ://tempuri.org"
xmlns:s1="http://schemas.microso ft.com/BizTalk/2003/Any"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="h ttp://schemas.xmlsoap .org/wsdl/soap12/"
xmlns:http="htt p://schemas.xmlsoap .org/wsdl/http/"
targetNamespace ="http://tempuri.org"
xmlns:wsdl="htt p://schemas.xmlsoap .org/wsdl/">

<wsdl:documenta tion xmlns:wsdl="htt p://schemas.xmlsoap .org/wsdl/">BizTalk
assembly "MyMethod, Version=1.0.0.0 , Culture=neutral ,
PublicKeyToken= 54556428737eb89 f" published web service.</wsdl:documentat ion>

- <wsdl:types>

- <s:schema elementFormDefa ult="qualified"
targetNamespace ="http://tempuri.org">

<s:import namespace="http ://schemas.microso ft.com/BizTalk/2003/Any" />

- <s:element name="MyMethod" >

- <s:complexTyp e>

- <s:sequence>

<s:element minOccurs="0" maxOccurs="1" ref="s1:Root" />

</s:sequence>

</s:complexType>

</s:element>

- <s:element name="MyMethodR esponse">

- <s:complexTyp e>

- <s:sequence>

<s:element minOccurs="0" maxOccurs="1" ref="s1:Root" />

</s:sequence>

</s:complexType>

</s:element>

</s:schema>

- <s:schema elementFormDefa ult="qualified"
targetNamespace ="http://schemas.microso ft.com/BizTalk/2003/Any">

- <s:element name="Root">

- <s:complexTyp e mixed="true">

- <s:sequence>

<s:any />

</s:sequence>

</s:complexType>

</s:element>

</s:schema>

</wsdl:types>

- <wsdl:message name="MyMethodS oapIn">

<wsdl:part name="parameter s" element="tns:My Method" />

</wsdl:message>

- <wsdl:message name="MyMethodS oapOut">

<wsdl:part name="parameter s" element="tns:My MethodResponse" />

</wsdl:message>

- <wsdl:portTyp e name="Transport OrdersWSSoap">

- <wsdl:operati on name="MyMethod" >

<wsdl:input message="tns:My MethodSoapIn" />

<wsdl:output message="tns:My MethodSoapOut" />

</wsdl:operation>

</wsdl:portType>

- <wsdl:binding name="Transport OrdersWSSoap"
type="tns:Trans portOrdersWSSoa p">

<soap:binding transport="http ://schemas.xmlsoap .org/soap/http" />

- <wsdl:operati on name="MyMethod" >

<soap:operati on soapAction="htt p://tempuri.org/WebService_MyMe thod/MyMethod"
style="document " />

- <wsdl:input>

<soap:body use="literal" />

</wsdl:input>

- <wsdl:output>

<soap:body use="literal" />

</wsdl:output>

</wsdl:operation>

</wsdl:binding>

- <wsdl:binding name="Transport OrdersWSSoap12"
type="tns:Trans portOrdersWSSoa p">

<soap12:bindi ng transport="http ://schemas.xmlsoap .org/soap/http" />

- <wsdl:operati on name="MyMethod" >

<soap12:operati on
soapAction="htt p://tempuri.org/WebService_MyMe thod/MyMethod"
style="document " />

- <wsdl:input>

<soap12:body use="literal" />

</wsdl:input>

- <wsdl:output>

<soap12:body use="literal" />

</wsdl:output>

</wsdl:operation>

</wsdl:binding>

- <wsdl:service name="Transport OrdersWS">

<wsdl:documenta tion xmlns:wsdl="htt p://schemas.xmlsoap .org/wsdl/">BizTalk
assembly "MyMethod, Version=1.0.0.0 , Culture=neutral ,
PublicKeyToken= 54556428737eb89 f" published web service.</wsdl:documentat ion>

- <wsdl:port name="Transport OrdersWSSoap"
binding="tns:Tr ansportOrdersWS Soap">

<soap:address
location="http://localhost/TransportOrders WS/TransportOrders WS.asmx" />

</wsdl:port>

- <wsdl:port name="Transport OrdersWSSoap12"
binding="tns:Tr ansportOrdersWS Soap12">

<soap12:addre ss
location="http://localhost/TransportOrders WS/TransportOrders WS.asmx" />

</wsdl:port>

</wsdl:service>

</wsdl:definition s>

"John Saunders" <john.saunder s at trizetto.comwro te in message
news:eW******** *****@TK2MSFTNG P05.phx.gbl...
"Nick K." <nk*****@msn.co mwrote in message
news:uS******** ******@TK2MSFTN GP04.phx.gbl...
>>I use wsdl.exe to generate client code to call a web service. The actual
web service is generated with the BizTalk Web Services Publishing Wizard.

I'm not sure this is particular to the BizTalk code but the calls to web
methods pass parameters by ref so that I have to call it like:

XmlDocument doc = new XmlDocument();

doc.LoadXml(me ssage);

XmlNode node = doc.DocumentEle ment.ParentNode ;

ws.MyMethod(re f node);

I attempt to modify the generated client code so that the parameter is
not passed by ref and is instead returned as a response but I keep
getting an "object not referenced" error.

Is there a way to tell wsdl.exe to not generate a "ref" parameter?

Is the problem I describe just because this is calling a BizTalk web
service or have others seen this?

If WSDL.EXE is generating a "ref" parameter, then the chances are that it
needs to be a "ref" parameter.

Have you taken a look into the WSDL file to see what it says about this
parameter?

John


Mar 14 '07 #3
"Nick K." <nk*****@msn.co mwrote in message
news:O2******** *****@TK2MSFTNG P02.phx.gbl...
I'm not sure I see anything so I will just show the entire wsdl, hopefully
someone can find something that will show me what to change in the wsdl to
change so that I not pass the parameter by ref:
You should not change the WSDL. It does not "belong" to you. It belongs to
BizTalk. It represents the contract that BizTalk is willing to enforce
between the world, and the BizTalk web service.

I looked at the WSDL (please don't paste from IE next time. The "-" signs
make it useless as an XML file). I suspect that the issue is that both the
input and output messages have a single part named "parameters ", and that
both "parameters " have the same type. It is saying that "parameters " are
input and then "parameters " are output, which in .NET terms is "ref".

In other words, the server side isn't broken. Is there some reason you don't
want to use "ref"?

John
Mar 14 '07 #4
The lead that gave me the requirements for the web services did not define a
ref parameter. This web service would be called by others that I have no
clue as to their development environment. Would "ref" pose a problem in
environments other than Microsoft?

"John Saunders" <john.saunder s at trizetto.comwro te in message
news:e6******** ******@TK2MSFTN GP03.phx.gbl...
"Nick K." <nk*****@msn.co mwrote in message
news:O2******** *****@TK2MSFTNG P02.phx.gbl...
>I'm not sure I see anything so I will just show the entire wsdl,
hopefully someone can find something that will show me what to change in
the wsdl to change so that I not pass the parameter by ref:

You should not change the WSDL. It does not "belong" to you. It belongs to
BizTalk. It represents the contract that BizTalk is willing to enforce
between the world, and the BizTalk web service.

I looked at the WSDL (please don't paste from IE next time. The "-" signs
make it useless as an XML file). I suspect that the issue is that both the
input and output messages have a single part named "parameters ", and that
both "parameters " have the same type. It is saying that "parameters " are
input and then "parameters " are output, which in .NET terms is "ref".

In other words, the server side isn't broken. Is there some reason you
don't want to use "ref"?

John


Mar 14 '07 #5
"Nick K." <nk*****@msn.co mwrote in message
news:uk******** ******@TK2MSFTN GP03.phx.gbl...
The lead that gave me the requirements for the web services did not define
a ref parameter. This web service would be called by others that I have no
clue as to their development environment. Would "ref" pose a problem in
environments other than Microsoft?
No, "ref" won't cause a problem because there is no "ref" in the WSDL. Only
an operation with both input and output parameters having the same name and
type.

John
Mar 15 '07 #6

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

Similar topics

2
4215
by: Burak | last post by:
Hello, I have a web service that has a two user defined public classes. For sake of brevity, I'll write them as follows Public Class Service1 Public Class Class1 Public x as integer End Class
7
4983
by: Christian Wilhelm | last post by:
Hi! I'm trying to call a Java WebService out of a .net Client. There are two Methods, one Method requires one Parameter of type Parameter, the other Method requires one Parameter of type Parameter. I can call the first Method without Problems, the Parameter can be deserialized by the WebService. But if I want to call the second Method and give it an Array of Parameters, then the following exception is thrown by the WebService:...
0
2639
by: jennifer.perkins | last post by:
I've seen a couple posts by people having similar problems, but the suggested solutions I've tried so far haven't worked. I'm using a SOAP client in VB.Net (constructed by wsdl.exe) and the third party web service it's consuming is served by Axis. The request messages my client sends are processed fine by the server, and the SOAP response is making its way to my client - but when .Net finishes processing the message I end up with an...
7
2923
by: Nalaka | last post by:
Hi, I created a sinple web service that returns a dataSet. Then I created a client program that uses this web service (that returns the Dataset). My question is, how did the client figure out to create a "DataSet" as the return type from the webservice?
1
2861
by: louis_la_brocante | last post by:
Dear all, I am having trouble generating a client proxy for a webservice whose methods return a "complex" type. The type is complex in that it is a class whose members are a mix of primitive types and of more elaborate classes implementing IXmlSerializable. The resulting WSDL file for the webservice has two separate schemas in its <types> sections, and the client proxy (generated with wsdl.exe) is missing the definitions of the...
0
4530
by: karazy | last post by:
I have been reading all the forums and understand whats going wrong but am not sure how to fix it. I have written a basic doc/literal web service. But when it is called by a .net client it will return NULL. I used proxytrace to check the data that goes back and forward. I can see my request and response. See below at the bottom. I believe that this error occurs because of a problem .Net has in reading my doc/literal WSDL. Or my Axis...
0
2415
by: kencana | last post by:
hi All, I got problem in passing data (more than one) from soap client to the soap server. but if i only passing one data at a time, it works successfully.. The following is the error message i get when i pass more than one data: "SoapFault exception: looks like we got no XML document in C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\phpviewersample\clienttry2.php:24 Stack trace: #0 : SoapClient->__call('getMap', Array) #1...
0
1797
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 VSTO in C#. The problem is that all array types as returned by client are empty (simple types are OK). Any help very appreciated. Thanks, Vadim
4
12050
by: gcharbon | last post by:
Hi community, I have a problem with a Soap client written in php. I have a local server (coded in c and a client in c too, it works fine), but i want to test client in php, and i have an error (I'm not sure to understand it...) : SoapFault exception: Method 'ns1:getMetadataRequest' not implemented: method name or namespace not recognized in beta_2/soap.php:26 Stack trace: #0 /root/src/rxtxws/beta_2/soap.php(26):...
0
8718
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9340
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9196
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9047
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7973
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4738
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3175
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2539
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2118
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.