473,320 Members | 1,926 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,320 software developers and data experts.

Why does my web services client generate SOAP with blank namespace?

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:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://
www.w3.org/2001/XMLSchema" 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:xtml="http://
www.foobar.com/schemas/common" xmlns:cnf="urn:com.foo.bar"
targetNamespace="urn:com.foo.bar">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://
www.foobar.com/schemas/common">
<s:element name="TrxnID">
<s:simpleType>
<s:restriction base="s:string"/>
</s:simpleType>
</s:element>
<s:element name="src-sessionID">
<s:simpleType>
<s:restriction base="s:string"/>
</s:simpleType>
</s:element>
<s:element name="dst-sessionID">
<s:simpleType>
<s:restriction base="s:string"/>
</s:simpleType>
</s:element>
</s:schema>
<s:schema elementFormDefault="qualified"
targetNamespace="urn:com.foo.bar">
<s:simpleType name="tStatus">
<s:restriction base="s:string"/>
</s:simpleType>
<s:simpleType name="tPhoneNumber">
<s:restriction base="s:string"/>
</s:simpleType>
</s:schema>
</wsdl:types>
<wsdl:message name="RequestHeader">
<wsdl:part name="TrxnID" element="xtml:TrxnID"/>
<wsdl:part name="dst-sessionID" element="xtml:dst-sessionID"/>
</wsdl:message>
<wsdl:message name="ResponseHeader">
<wsdl:part name="TrxnID" element="xtml:TrxnID"/>
<wsdl:part name="src-sessionID" element="xtml:src-sessionID"/>
</wsdl:message>
<wsdl:message name="OutdialRequest">
<wsdl:part name="callingNumber" type="cnf:tPhoneNumber"/>
<wsdl:part name="calledNumber" type="cnf:tPhoneNumber"/>
<wsdl:part name="passCode" type="s:string"/>
</wsdl:message>
<wsdl:message name="OutdialResponse">
<wsdl:part name="status" type="cnf:tStatus"/>
</wsdl:message>
<wsdl:portType name="ConferencePort">
<wsdl:operation name="OutdialOperation">
<wsdl:input message="cnf:OutdialRequest"/>
<wsdl:output message="cnf:OutdialResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ConferenceSOAPBinding" type="cnf:ConferencePort">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/
http"/>
<wsdl:operation name="OutdialOperation">
<soap:operation soapAction="urn:com.foo.bar"/>
<wsdl:input>
<soap:body use="literal" namespace="urn:com.foo.bar"
wsdl:required="true"/>
<soap:header message="cnf:RequestHeader" part="TrxnID"
use="literal"/>
<soap:header message="cnf:RequestHeader" 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:ResponseHeader" part="TrxnID"
use="literal"/>
<soap:header message="cnf:ResponseHeader" part="src-sessionID"
use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ConferenceService">
<wsdl:port name="Conferencing" binding="cnf:ConferenceSOAPBinding"/>
</wsdl:service>
</wsdl:definitions>
--------------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:Envelope xmlns:soap="http://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>
<OutdialOperation xmlns="urn:com.foo.bar">
<callingNumber xmlns="">781</callingNumber>
<calledNumber xmlns="">784</calledNumber>
<passCode xmlns="">1234</passCode>
</OutdialOperation>
</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.bar", 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?

Mar 27 '07 #1
7 5844

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.:

<callingNumber xmlns="">

Apr 3 '07 #2
On Apr 3, 8:04 am, "beachdog" <dhor...@pactolus.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.:

<callingNumber 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

Apr 3 '07 #3
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.wsdl
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.pactolus.conferencing'.
- Part 'calledNumber' of message 'OutdialRequest' from service
description with targetNamespace='urn:com.pactolus.conferencing'.
- Part 'passCode' of message 'OutdialRequest' from service
description with targetNamespace='urn:com.pactolus.conferencing'.

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\ConferenceService.cs'.
Apr 3 '07 #4
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?

Apr 3 '07 #5
"beachdog" <dh*****@pactolus.comwrote in message
news:11**********************@n76g2000hsh.googlegr oups.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
Apr 4 '07 #6
On Apr 4, 1:36 pm, "John Saunders" <john.saunders 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...

Apr 5 '07 #7
On Apr 5, 12:58 pm, "beachdog" <dhor...@pactolus.comwrote:
On Apr 4, 1:36 pm, "John Saunders" <john.saunders 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.

Apr 21 '07 #8

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

Similar topics

3
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...
4
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...
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: 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...
0
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...
4
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>...
0
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...
1
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...
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.