C# app consuming webservice : error 400 Bad Request

G

Guest

Hello,

I'm developing a CF application which consumes an existing delphi webservice.
Via the Visual Studio I have made a web reference to the wsdl file and
generated the web service code for the client via the studio.
Now when I try to call one of the webservice functions I get an error 400
Bad Request.

Anyone have ideas where it could have gone wrong?

Following is a piece of the generated code


Code:

[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:SoapServerIntf-ISoapServer#GetItemStoc",
RequestNamespace="urn:SoapServerIntf-ISoapServer",
ResponseNamespace="urn:SoapServerIntf-ISoapServer")]
[return: System.Xml.Serialization.SoapElementAttribute("return")]
public int GetItemStoc(string Item) {
object[] results = this.Invoke("GetItemStoc", new object[] {
Item});
return ((int)(results[0]));
}

/// <remarks/>
public System.IAsyncResult BeginGetItemStoc(string Item,
System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetItemStoc", new object[] {
Item}, callback, asyncState);
}

/// <remarks/>
public int EndGetItemStoc(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((int)(results[0]));




Here is where I get the error


Code:

private void btnStoc_Click(object sender, System.EventArgs e)
{
try
{
ISoapServerservice srvcSoap = new ISoapServerservice();

int nAntwoord;

nAntwoord = srvcSoap.GetItemStoc("120013300H00");
MessageBox.Show(nAntwoord.ToString());
}
catch(Exception a)
{
// Error handling mechanism
//
System.Windows.Forms.Cursor.Current =
System.Windows.Forms.Cursors.Default;
MessageBox.Show(a.Message, "MES");
}

}

Thanx in advance for any help in the right direction
 
A

Angel J. Hernández M.

Hi there...did you check the url you're trying to access? if so... is it
valid? it's the web service reference (proxy) updated? is the aspnet worker
process running?

Regards,
 
G

Guest

yes all those things are valid...

but I found the problem myself, a hard reset of the pda and everything
suddenly worked flawles...

thanks for the reply though ;)

Angel J. Hernández M. said:
Hi there...did you check the url you're trying to access? if so... is it
valid? it's the web service reference (proxy) updated? is the aspnet worker
process running?

Regards,


--
Angel J. Hernández M.
MCP - MCAD - MCSD - MCDBA
http://groups.msn.com/desarrolladoresmiranda



Jahwe said:
Hello,

I'm developing a CF application which consumes an existing delphi
webservice.
Via the Visual Studio I have made a web reference to the wsdl file and
generated the web service code for the client via the studio.
Now when I try to call one of the webservice functions I get an error 400
Bad Request.

Anyone have ideas where it could have gone wrong?

Following is a piece of the generated code


Code:

[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:SoapServerIntf-ISoapServer#GetItemStoc",
RequestNamespace="urn:SoapServerIntf-ISoapServer",
ResponseNamespace="urn:SoapServerIntf-ISoapServer")]
[return: System.Xml.Serialization.SoapElementAttribute("return")]
public int GetItemStoc(string Item) {
object[] results = this.Invoke("GetItemStoc", new object[] {
Item});
return ((int)(results[0]));
}

/// <remarks/>
public System.IAsyncResult BeginGetItemStoc(string Item,
System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetItemStoc", new object[] {
Item}, callback, asyncState);
}

/// <remarks/>
public int EndGetItemStoc(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((int)(results[0]));




Here is where I get the error


Code:

private void btnStoc_Click(object sender, System.EventArgs e)
{
try
{
ISoapServerservice srvcSoap = new ISoapServerservice();

int nAntwoord;

nAntwoord = srvcSoap.GetItemStoc("120013300H00");
MessageBox.Show(nAntwoord.ToString());
}
catch(Exception a)
{
// Error handling mechanism
//
System.Windows.Forms.Cursor.Current =
System.Windows.Forms.Cursors.Default;
MessageBox.Show(a.Message, "MES");
}

}

Thanx in advance for any help in the right direction
 
Top