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

WebService - XML

How do I change my webservice (ws.asmx.vb), so it can "understand"
when I send the below soap-xml to it ??

If I submit a normal html-form with input a+b, it works well. I know
how to send the soap-xml, but not how to get the webservice to work
with it.

TIA
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Add xmlns="abcdefg">
<a>10</a>
<b>20</b>
</Add>
</soap:Body>
</soap:Envelope>
ws.asmx.vb
--
Imports System.Web.Services

<WebService(Namespace:="http://tempuri.org")> _
Public Class Service1
Inherits WebService

<WebMethod()> _
Public Function Add(ByVal a As Integer, ByVal b As Integer) As
Integer
Return a + b
End Function
--
Nov 19 '05 #1
9 1687
author wrote:
How do I change my webservice (ws.asmx.vb), so it can "understand"
when I send the below soap-xml to it ??

If I submit a normal html-form with input a+b, it works well. I know
how to send the soap-xml, but not how to get the webservice to work
with it.

TIA
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Add xmlns="abcdefg">
<a>10</a>
<b>20</b>
</Add>
</soap:Body>
</soap:Envelope>
ws.asmx.vb
--
Imports System.Web.Services

<WebService(Namespace:="http://tempuri.org")> _
Public Class Service1
Inherits WebService

<WebMethod()> _
Public Function Add(ByVal a As Integer, ByVal b As Integer) As
Integer
Return a + b
End Function
--

You dont call ws.asmx.vb, you call ws.asmx
The .vb is the pre-compiled code.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Nov 19 '05 #2
> You dont call ws.asmx.vb, you call ws.asmx
The .vb is the pre-compiled code.


Yes I know, but I just show you the code of the vb-file.

Nov 19 '05 #3
author wrote:
You dont call ws.asmx.vb, you call ws.asmx
The .vb is the pre-compiled code.

Yes I know, but I just show you the code of the vb-file.


Oh ok, sorry... misunderstood.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Nov 19 '05 #4
MVP Scott Mitchell provides all the details you'll need to find your answer
here

http://aspnet.4guysfromrolla.com/articles/100803-1.aspx
--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"author" <no**@available.com> wrote in message
news:ur********************************@4ax.com...
How do I change my webservice (ws.asmx.vb), so it can "understand"
when I send the below soap-xml to it ??

If I submit a normal html-form with input a+b, it works well. I know
how to send the soap-xml, but not how to get the webservice to work
with it.

TIA
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Add xmlns="abcdefg">
<a>10</a>
<b>20</b>
</Add>
</soap:Body>
</soap:Envelope>
ws.asmx.vb
--
Imports System.Web.Services

<WebService(Namespace:="http://tempuri.org")> _
Public Class Service1
Inherits WebService

<WebMethod()> _
Public Function Add(ByVal a As Integer, ByVal b As Integer) As
Integer
Return a + b
End Function
--

Nov 19 '05 #5
> MVP Scott Mitchell provides all the details you'll need to find your answer
here

http://aspnet.4guysfromrolla.com/articles/100803-1.aspx


Thx for the link.. but I couldn't find any useful code there ?? - is
it that difficult to give me some source code here, or a direct link
to some ?? - that would help me a lot, thx.

Isn't a very simple webservice I have, I thought it would be easy
stuff for your expert ;)

Nov 19 '05 #6
Well its been a while since I did any soap! I think you might be looking for
the wrong thing.

I dont recall that you need to construct an actual soap envelope using xml
in asp.net as you would in asp for example. If I remember correctly, when
you set the proxy to the remote web service via the wsdl and have already
disabled get and post in the web.config for the web service - by default it
will use SOAP packaging to construct the request. You dont have to send the
XML envelope constructed as you are, just call the methods in the remote web
service through the proxy as you would call local methods and the package
will be constructed for you, delivered and the response returned.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"author" <no**@available.com> wrote in message
news:dr********************************@4ax.com...
MVP Scott Mitchell provides all the details you'll need to find your
answer
here

http://aspnet.4guysfromrolla.com/articles/100803-1.aspx


Thx for the link.. but I couldn't find any useful code there ?? - is
it that difficult to give me some source code here, or a direct link
to some ?? - that would help me a lot, thx.

Isn't a very simple webservice I have, I thought it would be easy
stuff for your expert ;)

Nov 19 '05 #7
> I think you might be looking for the wrong thing.
I dont recall that you need to construct an actual soap envelope


Some external application, without my control is sending soap-xml, so
it have to been in that way.

Nov 19 '05 #8
It looks then that the external application might not be sending enough
information to make your webservice tick - have you disabled get and post
yet in your webservice config to see if it accepts the envelope?

Here is an example of a full xml soap envelope destned for a .NET
webservice, for a simple hello world example.

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle=
"http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Header>
<MyHeader xmlns="http://www.alfredbr.com/">
<MyName xsi:type="xsd:string">Alfred</MyName>
</MyHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<namesp1:HelloWorld2 xmlns:namesp1="http://www.alfredbr.com/"/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Its quite different to that which you are recieving - you might therefore
have to modify your service, or get them to modify their request. From your
example, your a and b types are not defined so the webservice might simply
reject them as not being wsdl 1.1 compliant.

There is a utility at http://www.gotdotnet.com/team/tools/web_svc/ that
allows you to create and debug soap traffic to see why yours wont work.
I've not tried it, but it requires no code from what I gather, so its
probably a great test utility to work out where your problem is.

As I said, I've not done any soap request from none .NET clients for quite
some time so I dont have an easy answer for you, I hope that helps anyway.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"author" <no**@available.com> wrote in message
news:m2********************************@4ax.com...
I think you might be looking for the wrong thing.
I dont recall that you need to construct an actual soap envelope


Some external application, without my control is sending soap-xml, so
it have to been in that way.

Nov 19 '05 #9
Well.. I'm confused, I don't know what is up and down ;)

Right now I just try to show the xml (the one you gave me) after
submit to the service, but I get "The remote server returned an error:
(500) Internal Server Error" all the time.

If I hit the asmx-file direct in a browser I get the webinterface. If
I submit the xml there, it seems to work fine.

So maybe it's my submit of soap-xml who don't work. But I use the same
method, as I do with other external application where I submit
soap-xml, and that works fine.
ws.asmx.vb
--
Imports System.Web.Services
Imports System.IO
Imports System.Xml

<WebService(Namespace:="http://tempuri.org")> _
Public Class Service1
Inherits WebService

<WebMethod()> _
Public Function test(ByVal strxml As String)
Dim reader
reader = New XmlTextReader(New StringReader(strxml))

Return strxml
End Function
End Class
--

Nov 19 '05 #10

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

Similar topics

8
by: DraguVaso | last post by:
Hi, I'm new to WebServices, and I'm doing some tests (with a small VB.NET-application) to know the performance-difference between a WebService and the 'normal'-way of getting data (just...
6
by: Davie | last post by:
I want to authorise a user of a web service by using the AuthHeaderValue for some reason I keep getting a null reference exception when I try to run the following code: It seems to work fine on a...
1
by: Nalaka | last post by:
Hi, I am testing with Visual studio 2005, web projects. Situation: I have one solution with two web projects, created as file system projects. (I am tesing using the built in server, not IIS)...
2
by: Miguel | last post by:
Hi, I'm developing an application in C# with Windows Forms for my company that is similar to the MSN Messenger. This application uses a webservice for registering users, etc... and as 2...
7
by: Alessandro Benedetti | last post by:
Hi. I'm calling two methods of a .NET Webservice (A) from another Webservice (B). The A Webservice is made like this: public class WSA: System.Web.Services.WebService { private int X = 0;
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...
5
by: AliR | last post by:
Hi Everyone, I have a Visual C++ MFC program, and I am trying to use a webservice written in C#. When I add the webservice to my project using Add Web Reference the sproxy compiler complains...
5
by: | last post by:
Hi, How long do webservice objects live for? In particular, if i have static variables filled with data from a static constructor in a webservice, how long will that data persist? thxs
0
by: =?Utf-8?B?TWFuaQ==?= | last post by:
Hi All, Problem in deploying my WebService developed using Asp.net WebServices 2005. I have designed simple WebService using Asp.net Webservices 2.0 , The webservice look this , using System;...
4
by: =?Utf-8?B?QmlsbEF0V29yaw==?= | last post by:
Hi, We recently converted a 1.1 project to 2.0 and this included a webservice which accepted XML for one of the parameters. Since converting to 2.0 I am getting the following message: --- A...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
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
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
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,...
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...

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.