473,387 Members | 1,493 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.

XmlNode - generation of WSDL problem

I am writing a web service that accepts and returns an XML message - I know
the issues behind this but want to be able to process the messages
generically using XSD / XSLT.

My problem occurs with the way the .NET framework appears to handle the
XmlNode, in particular the generation of the WSDL. The details follow:

I define the code behind method as

[WebMethod]
public XmlNode Operation(xmlNode request)

However when I look at the WSDL generated I see the following for the input
XML Message:

<element name="Operation">
<complexType>
<sequence>
<element minOccurs="0" maxOccurs="1" name="request">
<complexType mixed="true">
<sequence>
<any />
</sequence>
</complexType>
</element>
</sequence>
</element>

Which results in the XML in the SOAP:Body looking like like this when called
using the reference.cs generated interface:
<Operation xmlns="..">
<request>
.... I can place the XML I require here
</request>
</Operation>

So the .NET framework - or is it the WSDL - has inserted an extra node
<request> in the XML that I do not require.

Does anyone know how to define this so that THE COMPLETE XML DOCUMENT in the
SOAP:Body is handled by the XmlNode defined in the code behind without it
inserting its own nodes?

TFAH

Paul

Nov 23 '05 #1
1 2056
I have found a solution. Specify the following just above the [WebMethod]

[SoapDocumentMethod{ParameterStyle =
System.Web.Services.Protocols.SoapParameterStyle.B are)]

Finally make sure that the variable name for the parameter of the XmlNode on
the WebMethod is the same as the root node of your XML in the SOAP:Body. The
XML is now starting to look like what you require.

"PaulF" wrote:
I am writing a web service that accepts and returns an XML message - I know
the issues behind this but want to be able to process the messages
generically using XSD / XSLT.

My problem occurs with the way the .NET framework appears to handle the
XmlNode, in particular the generation of the WSDL. The details follow:

I define the code behind method as

[WebMethod]
public XmlNode Operation(xmlNode request)

However when I look at the WSDL generated I see the following for the input
XML Message:

<element name="Operation">
<complexType>
<sequence>
<element minOccurs="0" maxOccurs="1" name="request">
<complexType mixed="true">
<sequence>
<any />
</sequence>
</complexType>
</element>
</sequence>
</element>

Which results in the XML in the SOAP:Body looking like like this when called
using the reference.cs generated interface:
<Operation xmlns="..">
<request>
.... I can place the XML I require here
</request>
</Operation>

So the .NET framework - or is it the WSDL - has inserted an extra node
<request> in the XML that I do not require.

Does anyone know how to define this so that THE COMPLETE XML DOCUMENT in the
SOAP:Body is handled by the XmlNode defined in the code behind without it
inserting its own nodes?

TFAH

Paul

Nov 23 '05 #2

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

Similar topics

1
by: Mullin Yu | last post by:
i just know that i can write the struct at c#, and then asp.net will automatically generate the wsdl, but there're some limitations e.g. can't write the soap header, can't show all the structures...
0
by: Suresh Pasala | last post by:
Hello All, Iam using the ServiceDescription class and writing a wsdl file. Currently the way wsdl is generated is as follows. <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"...
1
by: Marc | last post by:
Hi! I'm working with a C# client that calls a php web service. I've created a wrapper to call the service using .NET wsdl tool (adding a web reference). The call to the server works fine, it...
1
by: PaulF | last post by:
I am writing a web service that accepts and returns an XML message - I know the issues behind this but want to be able to process the messages generically using XSD / XSLT. My problem occurs...
4
by: Henrik Gøttig | last post by:
Hi all Feeling a bit frustrated here. Maybe I did not find the correct info yet, that's why I am asking you. I have "developed" a .NET 2.0 WebService and generated (using wsdl.exe) the WSDL...
0
by: Kevin Burton | last post by:
I searched some of the documentation and this description of my problem came closest: The following original schema element definitions contain minOccurs or maxOccurs attributes: <xs:element...
0
by: Ashish | last post by:
Iam working on a project that would use web services to transfer business objects around. I worked a little bit with the new SchemaImporterExtension class to tweak the proxy generation, and Iam...
13
by: ScottM | last post by:
I have run into a problem generating the class file via the WSDL utility. I have a WSDL file that was generated by XMLSpy and is able to be read by the Java code utility, but I get the following...
3
by: John K | last post by:
I am trying to eliminate the capability of displaying the details of a web service by disabling WSDL generation in the web.config file. I have made the following changes to the web.config: ...
3
by: Thomas Guettler | last post by:
Hi, I looked for a solution to talk to a web service which offers its signature with a wsdl file. I googled for 'wsdl python' and found ZSI. This project uses code generation. That's...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...
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.