I'm using Visual Studio 2005/C# to build a web client. The web server
is something I've written in a different framework, which does not
support generating wsdl, so I have hand-built a wsdl file, then
created my proxy class by running wsdl.exe. The problem is that the
SOAP message that the client generates contains an empty namespace for
the parameters in my message, instead of the namespace I intended it
to have. I am guessing it is some sort of problem in my wsdl, could
any of you wsdl/.NET experts take a look and see if you can identify
what I have done wrong?
First of all, here is my wsdl file:
--------------START OF WSDL-------------------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitio ns xmlns:wsdl="htt p://schemas.xmlsoap .org/wsdl/"
xmlns:soap="htt p://schemas.xmlsoap .org/wsdl/soap/" xmlns:s="http://
www.w3.org/2001/XMLSchema" xmlns:http="htt p://schemas.xmlsoap .org/wsdl/
http/" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/"
xmlns:mime="htt p://schemas.xmlsoap .org/wsdl/mime/" xmlns:xtml="htt p://
www.foobar.com/schemas/common" xmlns:cnf="urn: com.foo.bar"
targetNamespace ="urn:com.foo.b ar">
<wsdl:types>
<s:schema elementFormDefa ult="qualified" targetNamespace ="http://
www.foobar.com/schemas/common">
<s:element name="TrxnID">
<s:simpleType >
<s:restrictio n base="s:string"/>
</s:simpleType>
</s:element>
<s:element name="src-sessionID">
<s:simpleType >
<s:restrictio n base="s:string"/>
</s:simpleType>
</s:element>
<s:element name="dst-sessionID">
<s:simpleType >
<s:restrictio n base="s:string"/>
</s:simpleType>
</s:element>
</s:schema>
<s:schema elementFormDefa ult="qualified"
targetNamespace ="urn:com.foo.b ar">
<s:simpleType name="tStatus">
<s:restrictio n base="s:string"/>
</s:simpleType>
<s:simpleType name="tPhoneNum ber">
<s:restrictio n base="s:string"/>
</s:simpleType>
</s:schema>
</wsdl:types>
<wsdl:message name="RequestHe ader">
<wsdl:part name="TrxnID" element="xtml:T rxnID"/>
<wsdl:part name="dst-sessionID" element="xtml:d st-sessionID"/>
</wsdl:message>
<wsdl:message name="ResponseH eader">
<wsdl:part name="TrxnID" element="xtml:T rxnID"/>
<wsdl:part name="src-sessionID" element="xtml:s rc-sessionID"/>
</wsdl:message>
<wsdl:message name="OutdialRe quest">
<wsdl:part name="callingNu mber" type="cnf:tPhon eNumber"/>
<wsdl:part name="calledNum ber" type="cnf:tPhon eNumber"/>
<wsdl:part name="passCode" type="s:string"/>
</wsdl:message>
<wsdl:message name="OutdialRe sponse">
<wsdl:part name="status" type="cnf:tStat us"/>
</wsdl:message>
<wsdl:portTyp e name="Conferenc ePort">
<wsdl:operati on name="OutdialOp eration">
<wsdl:input message="cnf:Ou tdialRequest"/>
<wsdl:output message="cnf:Ou tdialResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="Conferenc eSOAPBinding" type="cnf:Confe rencePort">
<soap:binding style="rpc" transport="http ://schemas.xmlsoap .org/soap/
http"/>
<wsdl:operati on name="OutdialOp eration">
<soap:operati on soapAction="urn :com.foo.bar"/>
<wsdl:input>
<soap:body use="literal" namespace="urn: com.foo.bar"
wsdl:required=" true"/>
<soap:header message="cnf:Re questHeader" part="TrxnID"
use="literal"/>
<soap:header message="cnf:Re questHeader" part="dst-sessionID"
use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal" namespace="urn: com.foo.bar"
wsdl:required=" true"/>
<soap:header message="cnf:Re sponseHeader" part="TrxnID"
use="literal"/>
<soap:header message="cnf:Re sponseHeader" part="src-sessionID"
use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Conferenc eService">
<wsdl:port name="Conferenc ing" binding="cnf:Co nferenceSOAPBin ding"/>
</wsdl:service>
</wsdl:definition s>
--------------END OF WSDL-------------------
and here is what the generated SOAP message looks like:
-------------START OF GENERATED SOAP REQUEST------------
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelop e xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema">
<soap:Header>
<TrxnID xmlns="http://www.foobar.com/schemas/common">1234</TrxnID>
</soap:Header>
<soap:Body>
<OutdialOperati on xmlns="urn:com. foo.bar">
<callingNumbe r xmlns="">781</callingNumber>
<calledNumber xmlns="">784</calledNumber>
<passCode xmlns="">1234</passCode>
</OutdialOperatio n>
</soap:Body>
</soap:Envelope>
-------------END OF GENERATED SOAP REQUEST--------------
The problem is that I wanted the parameters in my message, like
'callingNumber' , to be associated with the namespace
"urn:com.foo.ba r", but as you can see they are associated with a blank
namespace.
Any idea what I am doing wrong? It must be a problem with my wsdl,
right? Can anyone suggest how I modify that wsdl to correctly
indicate that the parameters in my request message above are
associated with that namespace? 7 5880
Can anyone help on this? I really don't understand why when I use
style=rpc I am getting namespaces at all in my request parameters, let
alone a blank namespace, i.e.:
<callingNumbe r xmlns="">
On Apr 3, 8:04 am, "beachdog" <dhor...@pactol us.comwrote:
Can anyone help on this? I really don't understand why when I use
style=rpc I am getting namespaces at all in my request parameters, let
alone a blank namespace, i.e.:
<callingNumbe r xmlns="">
I'm not sure of the answer to this, as I use document/literal, not
rpc. However, consider using elements for your parts instead of types.
Elements carry a namespace, but I'm not so sure about types.
John
On Apr 3, 5:27 pm, JohnWSaunders.. .@hotmail.com wrote:
I'm not sure of the answer to this, as I use document/literal, not
rpc. However, consider using elements for your parts instead of types.
Elements carry a namespace, but I'm not so sure about types.
If I try that, then wsdl.exe gives me an error. It looks like with
rpc/literal I can only have types in my parts that are used in a soap
body (??)
c:\temp>wsdl /language:CS conference5.wsd l
Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 2.0.50727.42]
Copyright (C) Microsoft Corporation. All rights reserved.
Warning: This web reference does not conform to WS-I Basic Profile
v1.1.
R2203: An rpc-literal binding in a DESCRIPTION MUST refer, in its
soapbind:body
element(s), only to wsdl:part element(s) that have been defined using
the type attribute.
- Part 'callingNumber' of message 'OutdialRequest ' from service
description with targetNamespace ='urn:com.pacto lus.conferencin g'.
- Part 'calledNumber' of message 'OutdialRequest ' from service
description with targetNamespace ='urn:com.pacto lus.conferencin g'.
- Part 'passCode' of message 'OutdialRequest ' from service
description with targetNamespace ='urn:com.pacto lus.conferencin g'.
For more details on the WS-I Basic Profile v1.1, see the specification
at http://www.ws-i.org/Profiles/BasicProfile-1.1.html.
Warning: one or more operations were skipped.
Warnings were encountered. Review generated source comments for more
details.
Writing file 'c:\temp\Confer enceService.cs' .
Is there any way I can step through the .net serialization code to try
to see why it is attaching a namespace? or any tracing I can turn on
at that level that might help?
"beachdog" <dh*****@pactol us.comwrote in message
news:11******** **************@ n76g2000hsh.goo glegroups.com.. .
Is there any way I can step through the .net serialization code to try
to see why it is attaching a namespace? or any tracing I can turn on
at that level that might help?
Stepping through wouldn't show you _why_ it's adding a namespace, it would
only show you _when_ it's adding the namespace.
The short and unsatisfying answer is that the namespace is being included
because .NET thinks it's necessary.
John
On Apr 4, 1:36 pm, "John Saunders" <john.saunder s at trizetto.com>
wrote:
The short and unsatisfying answer is that the namespace is being included
because .NET thinks it's necessary.
Well, that is a good point, actually. Something in my wsdl must be
causing it to think this is necessary. And so, I then ask myself:
what is the intent of blank namespace? And I think a blank namespace
causes the active namespace to revert to the default namespace, is
that correct? If so, then .NET believes that the elements in my
message belong to the default namespace. This at least does give me
some avenues for investigating my wsdl...
On Apr 5, 12:58 pm, "beachdog" <dhor...@pactol us.comwrote:
On Apr 4, 1:36 pm, "John Saunders" <john.saunder s at trizetto.com>
wrote:
The short and unsatisfying answer is that the namespace is being included
because .NET thinks it's necessary.
Well, that is a good point, actually. Something in my wsdl must be
causing it to think this is necessary. And so, I then ask myself:
what is the intent of blank namespace? And I think a blank namespace
causes the active namespace to revert to the default namespace, is
that correct? If so, then .NET believes that the elements in my
message belong to the default namespace. This at least does give me
some avenues for investigating my wsdl...
A postscript on this. I was never able to figure out why this was
occurring, but I changed my wsdl document to use style=document
instead of style=rpc and now I get the expected behavior. Since the
web service is able to handle the SOAP generated with document style,
that is good enough for me for now. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Matt D |
last post by:
I've got two web services that use the same data types and that
clients will have to consume. I read the msdn article on sharing types
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnservice/html/service07162002.asp)
but I don't want clients to have to add two web references and then
manually have to edit the proxy classes. After doing some searching I
found that putting references to multiple web services in a .disco...
|
by: Ryan Wade |
last post by:
I am very new to web services and I am creating a thin-client windows app
that will access it's data via web services whether on a remote web site of
on an intranet server. What are the best practices for creating web services
like this? I will create my own objects and pass them through the web
services(s). Should I use 1 web service with many functions or many web
services with few functions? If I use many web services do I have to add...
|
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?
|
by: William |
last post by:
I have a few questions. First, I have a java webservice, which was
developed using the Java Webserices Developer Pack 1.3. Here is the
wsdl for the service. (Note: That this service is not exposed
publicly.)
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.xxx.com/im/webservices/"
|
by: Richard Gregory |
last post by:
Hi,
I have the wsdl below, for an Axis web service, and when I select Add Web
Refernce in Visual Studio the proxy is missing a class representing the
returnedElementsType (see reference.cs below the wsdl). This complex type is
a collection of another complex type(elementType), and the Reference.cs has
an array of these rather than the single returnedElementsType. If If I want
to be able to obtain these elements from the SOAP response I...
| |
by: John |
last post by:
I have WSDL file with <wsdl:fault> element. When I use Websphere WSAD
to generate Java proxy classes from WSDL, I am able to see the custom
exception classes that correspond to the <wsdl:fault> element.
However, when I try to do the same thing using wsdl.exe or add web
references in Visual Studio .NET, looks like it doesn't generate any
custom exception classes
that correspond to <wsdl:fault> element in WSDL file.
My question is how...
|
by: krishnaraju |
last post by:
HI to all,
please help me.its urgent requirement.
my question is this is the wsdl file i got from our client.please see at bottom.
when iam trying to access that webmethods iam getting only byval params but i
didnt get byref params.please let me know how to get byref values from web methods.
please help me in this regard because its an urgent requirement.
------------------------wsdl...
|
by: pchaw |
last post by:
I try to develop a demo, which client in Perl will try to call the web services I wrote in C#. I've no knowledge in Perl, but as I refer to online forum, I try to follow their example but return no result.
I've installed ActivePerl in my Win XP and tested my perl with the code below and it's successful.
#!/bin/perl -w
|
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
|
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,...
|
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...
| |
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
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...
|
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 into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |