473,406 Members | 2,356 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,406 software developers and data experts.

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(message);

XmlNode node = doc.DocumentElement.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 4958
"Nick K." <nk*****@msn.comwrote in message
news:uS**************@TK2MSFTNGP04.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(message);

XmlNode node = doc.DocumentElement.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:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="http://tempuri.org"
xmlns:s1="http://schemas.microsoft.com/BizTalk/2003/Any"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
targetNamespace="http://tempuri.org"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">

<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">BizTalk
assembly "MyMethod, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=54556428737eb89f" published web service.</wsdl:documentation>

- <wsdl:types>

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

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

- <s:element name="MyMethod">

- <s:complexType>

- <s:sequence>

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

</s:sequence>

</s:complexType>

</s:element>

- <s:element name="MyMethodResponse">

- <s:complexType>

- <s:sequence>

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

</s:sequence>

</s:complexType>

</s:element>

</s:schema>

- <s:schema elementFormDefault="qualified"
targetNamespace="http://schemas.microsoft.com/BizTalk/2003/Any">

- <s:element name="Root">

- <s:complexType mixed="true">

- <s:sequence>

<s:any />

</s:sequence>

</s:complexType>

</s:element>

</s:schema>

</wsdl:types>

- <wsdl:message name="MyMethodSoapIn">

<wsdl:part name="parameters" element="tns:MyMethod" />

</wsdl:message>

- <wsdl:message name="MyMethodSoapOut">

<wsdl:part name="parameters" element="tns:MyMethodResponse" />

</wsdl:message>

- <wsdl:portType name="TransportOrdersWSSoap">

- <wsdl:operation name="MyMethod">

<wsdl:input message="tns:MyMethodSoapIn" />

<wsdl:output message="tns:MyMethodSoapOut" />

</wsdl:operation>

</wsdl:portType>

- <wsdl:binding name="TransportOrdersWSSoap"
type="tns:TransportOrdersWSSoap">

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

- <wsdl:operation name="MyMethod">

<soap:operation soapAction="http://tempuri.org/WebService_MyMethod/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="TransportOrdersWSSoap12"
type="tns:TransportOrdersWSSoap">

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

- <wsdl:operation name="MyMethod">

<soap12:operation
soapAction="http://tempuri.org/WebService_MyMethod/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="TransportOrdersWS">

<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">BizTalk
assembly "MyMethod, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=54556428737eb89f" published web service.</wsdl:documentation>

- <wsdl:port name="TransportOrdersWSSoap"
binding="tns:TransportOrdersWSSoap">

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

</wsdl:port>

- <wsdl:port name="TransportOrdersWSSoap12"
binding="tns:TransportOrdersWSSoap12">

<soap12:address
location="http://localhost/TransportOrdersWS/TransportOrdersWS.asmx" />

</wsdl:port>

</wsdl:service>

</wsdl:definitions>

"John Saunders" <john.saunders at trizetto.comwrote in message
news:eW*************@TK2MSFTNGP05.phx.gbl...
"Nick K." <nk*****@msn.comwrote in message
news:uS**************@TK2MSFTNGP04.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(message);

XmlNode node = doc.DocumentElement.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 #3
"Nick K." <nk*****@msn.comwrote in message
news:O2*************@TK2MSFTNGP02.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.saunders at trizetto.comwrote in message
news:e6**************@TK2MSFTNGP03.phx.gbl...
"Nick K." <nk*****@msn.comwrote in message
news:O2*************@TK2MSFTNGP02.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.comwrote in message
news:uk**************@TK2MSFTNGP03.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
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...
7
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...
0
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...
7
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...
1
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...
0
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...
0
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...
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...
4
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...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.