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

J

Jaime Stuardo

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

B Deepak

Use...

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

It may solve ur problem.
 
J

Jaime Stuardo

But with VB.NET I cannot use ref keyword to call a ByRef parameter. That is
only for C#

Jaime

B Deepak said:
Use...

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

It may solve ur problem.

Jaime Stuardo said:
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

B Deepak

Can u plse provide me the WSDL file for the webservice u r calling?

-Deepak
Jaime Stuardo said:
But with VB.NET I cannot use ref keyword to call a ByRef parameter. That
is only for C#

Jaime

B Deepak said:
Use...

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

It may solve ur problem.

Jaime Stuardo said:
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
 
J

Jaime Stuardo

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:eek:peration name="BuscarPareja">
<wsdl:input message="tns:BuscarParejaSoapIn" />
<wsdl:eek:utput message="tns:BuscarParejaSoapOut" />
</wsdl:eek:peration>
- <wsdl:eek:peration name="ValidaUsuario">
<wsdl:input message="tns:ValidaUsuarioSoapIn" />
<wsdl:eek:utput message="tns:ValidaUsuarioSoapOut" />
</wsdl:eek:peration>
</wsdl:portType>
- <wsdl:binding name="AlcahuetNetSoap" type="tns:AlcahuetNetSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
- <wsdl:eek:peration name="BuscarPareja">
<soap:eek:peration
soapAction="http://cursoaspnet1.com/webservices/BuscarPareja"
style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:eek:utput>
<soap:body use="literal" />
</wsdl:eek:utput>
</wsdl:eek:peration>
- <wsdl:eek:peration name="ValidaUsuario">
<soap:eek:peration
soapAction="http://cursoaspnet1.com/webservices/ValidaUsuario"
style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:eek:utput>
<soap:body use="literal" />
</wsdl:eek:utput>
</wsdl:eek:peration>
</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>


B Deepak said:
Can u plse provide me the WSDL file for the webservice u r calling?

-Deepak
Jaime Stuardo said:
But with VB.NET I cannot use ref keyword to call a ByRef parameter. That
is only for C#

Jaime

B Deepak said:
Use...

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

It may solve ur problem.

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

B Deepak

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

Jaime Stuardo said:
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:eek:peration name="BuscarPareja">
<wsdl:input message="tns:BuscarParejaSoapIn" />
<wsdl:eek:utput message="tns:BuscarParejaSoapOut" />
</wsdl:eek:peration>
- <wsdl:eek:peration name="ValidaUsuario">
<wsdl:input message="tns:ValidaUsuarioSoapIn" />
<wsdl:eek:utput message="tns:ValidaUsuarioSoapOut" />
</wsdl:eek:peration>
</wsdl:portType>
- <wsdl:binding name="AlcahuetNetSoap" type="tns:AlcahuetNetSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
- <wsdl:eek:peration name="BuscarPareja">
<soap:eek:peration
soapAction="http://cursoaspnet1.com/webservices/BuscarPareja"
style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:eek:utput>
<soap:body use="literal" />
</wsdl:eek:utput>
</wsdl:eek:peration>
- <wsdl:eek:peration name="ValidaUsuario">
<soap:eek:peration
soapAction="http://cursoaspnet1.com/webservices/ValidaUsuario"
style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:eek:utput>
<soap:body use="literal" />
</wsdl:eek:utput>
</wsdl:eek:peration>
</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>


B Deepak said:
Can u plse provide me the WSDL file for the webservice u r calling?

-Deepak
Jaime Stuardo said:
But with VB.NET I cannot use ref keyword to call a ByRef parameter. That
is only for C#

Jaime

Use...

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

It may solve ur problem.

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
 
J

Jaime Stuardo

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


B Deepak said:
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

Jaime Stuardo said:
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:eek:peration name="BuscarPareja">
<wsdl:input message="tns:BuscarParejaSoapIn" />
<wsdl:eek:utput message="tns:BuscarParejaSoapOut" />
</wsdl:eek:peration>
- <wsdl:eek:peration name="ValidaUsuario">
<wsdl:input message="tns:ValidaUsuarioSoapIn" />
<wsdl:eek:utput message="tns:ValidaUsuarioSoapOut" />
</wsdl:eek:peration>
</wsdl:portType>
- <wsdl:binding name="AlcahuetNetSoap" type="tns:AlcahuetNetSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
- <wsdl:eek:peration name="BuscarPareja">
<soap:eek:peration
soapAction="http://cursoaspnet1.com/webservices/BuscarPareja"
style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:eek:utput>
<soap:body use="literal" />
</wsdl:eek:utput>
</wsdl:eek:peration>
- <wsdl:eek:peration name="ValidaUsuario">
<soap:eek:peration
soapAction="http://cursoaspnet1.com/webservices/ValidaUsuario"
style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:eek:utput>
<soap:body use="literal" />
</wsdl:eek:utput>
</wsdl:eek:peration>
</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>


B Deepak said:
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#

Jaime

Use...

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

It may solve ur problem.

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

B Deepak

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
Jaime Stuardo said:
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


B Deepak said:
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

Jaime Stuardo said:
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:eek:peration name="BuscarPareja">
<wsdl:input message="tns:BuscarParejaSoapIn" />
<wsdl:eek:utput message="tns:BuscarParejaSoapOut" />
</wsdl:eek:peration>
- <wsdl:eek:peration name="ValidaUsuario">
<wsdl:input message="tns:ValidaUsuarioSoapIn" />
<wsdl:eek:utput message="tns:ValidaUsuarioSoapOut" />
</wsdl:eek:peration>
</wsdl:portType>
- <wsdl:binding name="AlcahuetNetSoap" type="tns:AlcahuetNetSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
- <wsdl:eek:peration name="BuscarPareja">
<soap:eek:peration
soapAction="http://cursoaspnet1.com/webservices/BuscarPareja"
style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:eek:utput>
<soap:body use="literal" />
</wsdl:eek:utput>
</wsdl:eek:peration>
- <wsdl:eek:peration name="ValidaUsuario">
<soap:eek:peration
soapAction="http://cursoaspnet1.com/webservices/ValidaUsuario"
style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:eek:utput>
<soap:body use="literal" />
</wsdl:eek:utput>
</wsdl:eek:peration>
</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?

-Deepak
But with VB.NET I cannot use ref keyword to call a ByRef parameter.
That is only for C#

Jaime

Use...

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

It may solve ur problem.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top