Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / October 2005

Tip: Looking for answers? Try searching our database.

"404: Not Found" error when calling a web method

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jaime Stuardo - 02 Oct 2005 17:05 GMT
Hi all....

I have a web service method that when I call, I get the error:

The request failed with HTTP status 404: Not Found.

Line 58:
<System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://cursoaspnet1.com/webservices/ValidaUsuario",
RequestNamespace:="http://cursoaspnet1.com/webservices/",
ResponseNamespace:="http://cursoaspnet1.com/webservices/",
Use:=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)>
_
Line 59:         Public Function ValidaUsuario(ByVal usuario As String,
ByVal pass As String, ByRef osigno As String) As Integer
Line 60:             Dim results() As Object = Me.Invoke("ValidaUsuario",
New Object() {usuario, pass, osigno})
Line 61:             osigno = CType(results(1),String)
Line 62:             Return CType(results(0),Integer)

The line with the Invoke call is colored in red.

This is the webmethod definition for that function:

[WebMethod]
public int ValidaUsuario(string usuario, string pass, ref string osigno)
{
   ...
}

And this is the call:

Dim oWs As Alcahuet.AlcahuetNet = New Alcahuet.AlcahuetNet
Dim iAcceso = oWs.ValidaUsuario(strUsr, strPass, resigno)

I have added the web reference with the name of Alcahuet and when I connect
to http://localhost/AlcahuetNet/Alcahuetnet.asmx I get a list of methods.

Any help to solve this will be greatly appreciated

Thanks
Jaime
B Deepak - 06 Oct 2005 07:26 GMT
Use...

Dim iAcceso = oWs.ValidaUsuario(strUsr, strPass, ref resigno)

It may solve ur problem.

> Hi all....
>
[quoted text clipped - 39 lines]
> Thanks
> Jaime
Jaime Stuardo - 06 Oct 2005 12:15 GMT
But with VB.NET I cannot use ref keyword to call a ByRef parameter. That is
only for C#

Jaime

> Use...
>
[quoted text clipped - 45 lines]
>> Thanks
>> Jaime
B Deepak - 06 Oct 2005 12:49 GMT
Can u plse provide me the WSDL file for the webservice u r calling?

-Deepak
> But with VB.NET I cannot use ref keyword to call a ByRef parameter. That
> is only for C#
[quoted text clipped - 50 lines]
>>> Thanks
>>> Jaime
Jaime Stuardo - 07 Oct 2005 01:02 GMT
there you are

 <?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://cursoaspnet1.com/webservices/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
targetNamespace="http://cursoaspnet1.com/webservices/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <s:schema elementFormDefault="qualified"
targetNamespace="http://cursoaspnet1.com/webservices/">
 <s:import namespace="http://www.w3.org/2001/XMLSchema" />
- <s:element name="BuscarPareja">
- <s:complexType>
- <s:sequence>
 <s:element minOccurs="0" maxOccurs="1" name="query" type="s:string" />
 </s:sequence>
 </s:complexType>
 </s:element>
- <s:element name="BuscarParejaResponse">
- <s:complexType>
- <s:sequence>
- <s:element minOccurs="0" maxOccurs="1" name="BuscarParejaResult">
- <s:complexType>
- <s:sequence>
 <s:element ref="s:schema" />
 <s:any />
 </s:sequence>
 </s:complexType>
 </s:element>
 </s:sequence>
 </s:complexType>
 </s:element>
- <s:element name="ValidaUsuario">
- <s:complexType>
- <s:sequence>
 <s:element minOccurs="0" maxOccurs="1" name="usuario" type="s:string" />
 <s:element minOccurs="0" maxOccurs="1" name="pass" type="s:string" />
 <s:element minOccurs="0" maxOccurs="1" name="osigno" type="s:string" />
 </s:sequence>
 </s:complexType>
 </s:element>
- <s:element name="ValidaUsuarioResponse">
- <s:complexType>
- <s:sequence>
 <s:element minOccurs="1" maxOccurs="1" name="ValidaUsuarioResult"
type="s:int" />
 <s:element minOccurs="0" maxOccurs="1" name="osigno" type="s:string" />
 </s:sequence>
 </s:complexType>
 </s:element>
 </s:schema>
 </wsdl:types>
- <wsdl:message name="BuscarParejaSoapIn">
 <wsdl:part name="parameters" element="tns:BuscarPareja" />
 </wsdl:message>
- <wsdl:message name="BuscarParejaSoapOut">
 <wsdl:part name="parameters" element="tns:BuscarParejaResponse" />
 </wsdl:message>
- <wsdl:message name="ValidaUsuarioSoapIn">
 <wsdl:part name="parameters" element="tns:ValidaUsuario" />
 </wsdl:message>
- <wsdl:message name="ValidaUsuarioSoapOut">
 <wsdl:part name="parameters" element="tns:ValidaUsuarioResponse" />
 </wsdl:message>
- <wsdl:portType name="AlcahuetNetSoap">
- <wsdl:operation name="BuscarPareja">
 <wsdl:input message="tns:BuscarParejaSoapIn" />
 <wsdl:output message="tns:BuscarParejaSoapOut" />
 </wsdl:operation>
- <wsdl:operation name="ValidaUsuario">
 <wsdl:input message="tns:ValidaUsuarioSoapIn" />
 <wsdl:output message="tns:ValidaUsuarioSoapOut" />
 </wsdl:operation>
 </wsdl:portType>
- <wsdl:binding name="AlcahuetNetSoap" type="tns:AlcahuetNetSoap">
 <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
- <wsdl:operation name="BuscarPareja">
 <soap:operation
soapAction="http://cursoaspnet1.com/webservices/BuscarPareja"
style="document" />
- <wsdl:input>
 <soap:body use="literal" />
 </wsdl:input>
- <wsdl:output>
 <soap:body use="literal" />
 </wsdl:output>
 </wsdl:operation>
- <wsdl:operation name="ValidaUsuario">
 <soap:operation
soapAction="http://cursoaspnet1.com/webservices/ValidaUsuario"
style="document" />
- <wsdl:input>
 <soap:body use="literal" />
 </wsdl:input>
- <wsdl:output>
 <soap:body use="literal" />
 </wsdl:output>
 </wsdl:operation>
 </wsdl:binding>
- <wsdl:service name="AlcahuetNet">
 <documentation xmlns="http://schemas.xmlsoap.org/wsdl/" />
- <wsdl:port name="AlcahuetNetSoap" binding="tns:AlcahuetNetSoap">
 <soap:address location="http://localhost/AlcahuetNet/AlcahuetNet.asmx" />
 </wsdl:port>
 </wsdl:service>
 </wsdl:definitions>

> Can u plse provide me the WSDL file for the webservice u r calling?
>
[quoted text clipped - 54 lines]
>>>> Thanks
>>>> Jaime
B Deepak - 07 Oct 2005 06:05 GMT
Can u invoke the web method call from IE but not from ur VB code? If yes
then it may be the problem with ur proxy settings. It may help u...
http://www.dotnet247.com/247reference/msgs/2/12659.aspx

Regards,
Deepak

> there you are
>
[quoted text clipped - 167 lines]
>>>>> Thanks
>>>>> Jaime
Jaime Stuardo - 07 Oct 2005 12:33 GMT
I cannot test it because when I see the method SOAP definition, using this
URL, http://localhost/AlcahuetNet/alcahuetnet.asmx?op=ValidaUsuario, at Test
area, this message is displayed:

"The test form is only available for methods with primitive types or arrays
of primitive types as parameters."

That's strange too, since the definition has string types, this way:

<ValidaUsuario xmlns="http://cursoaspnet1.com/webservices/">
     <usuario>string</usuario>
     <pass>string</pass>
     <osigno>string</osigno>
   </ValidaUsuario>

Maybe I would have to program the web service from scratch using the wizard
and then copy and paste each method bodies. Fortunately they are only 2.

The fact is that I downloaded this code as part of a tutorial. When I have
programmed web services using the wizard, I haven't had any problems on
invocation (using and not using primitive types).

One particularity with this web service is that all code is contained in the
ASMX file. The web services generated by the wizard contain a ASMX file with
only 1 line, and a the corresponding code behind, for example, ASMX.CS.
Maybe this is the problem, but according to the tutorial say, the webservice
should work.

Thanks
Jaime

> Can u invoke the web method call from IE but not from ur VB code? If yes
> then it may be the problem with ur proxy settings. It may help u...
[quoted text clipped - 175 lines]
>>>>>> Thanks
>>>>>> Jaime
B Deepak - 09 Oct 2005 12:26 GMT
You can not use ref keyword in parameter list which u r passing it into the
web method. Becoz when I tried it by passing parameter with ref keyword and
running it through IE, i was not able to invoke the method. Than means, web
service method does support only primitive datatypes but not datatypes with
keywords.
if u delete ref keyword frm parameter list, everything should work fine.
Please try it once..

Regards,
Deepak
>I cannot test it because when I see the method SOAP definition, using this
>URL, http://localhost/AlcahuetNet/alcahuetnet.asmx?op=ValidaUsuario, at
[quoted text clipped - 208 lines]
>>>>>>> Thanks
>>>>>>> Jaime

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.