|
Home > Archive > BizTalk Server General > July 2005 > How to consume a webservice generated with the wizard?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How to consume a webservice generated with the wizard?
|
|
| Luis Esteban Valencia 2005-07-25, 6:04 pm |
| Hello. I just make a webservice with the wizard based on an orchestration.
Its about chapter 10 of biztalk unleashed book.
It generated me this class-
And I am trying to consume the webservice with a page but It receives an RFP
document which I dont know to construct
private void Button1_Click(object sender, System.EventArgs e)
{
localhost. BiztalkExposeWebServices_BizTalk_Orchest
ration1_WS ws = new
ConsumirOWS.localhost. BiztalkExposeWebServices_BizTalk_Orchest
ration1_WS();
ws.Operation_1(
}
Class Generated by Biztalk webservies publishing wizard..
//--------------------------------------------------------------------------
----
// <autogenerated>
// This code was generated by a tool.
// Runtime Version: 1.1.4322.985
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
//--------------------------------------------------------------------------
----
// Generated by "Microsoft.BizTalk.WebServices, Version=3.0.1.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
// Product: Microsoft® BizTalk® Server 2004 3.0.4902.0
// File: Microsoft.BizTalk.WebServices.dll 3.0.4902.0
//
namespace BiztalkExposeWebServices
{
// service "BiztalkExposeWebServices.BizTalk_Orchestration1" port "WS"
[System.Web.Services.WebServiceBindingAttribute(Name="BiztalkExposeWebServic
es_BizTalk_Orchestration1_WS",
Namespace="http://que.orchestrations.webservices")]
[System.Web.Services.WebServiceAttribute(Name="BiztalkExposeWebServices_BizT
alk_Orchestration1_WS", Namespace="http://que.orchestrations.webservices",
Description="BizTalk assembly \"BiztalkExposeWebServices, Version=1.0.0.0,
Culture=neutral, Pub" +
"licKeyToken=649666eaf2ce86f8\" published web service.")]
public sealed class BiztalkExposeWebServices_BizTalk_Orchest
ration1_WS :
Microsoft.BizTalk.WebServices.ServerProxy.ServerProxy
{
// operation "Operation_1"
[System.Web.Services.WebMethodAttribute()]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://que.orche
strations.webservices/ BiztalkExposeWebServices_BizTalk_Orchest
rat" +
"ion1_WS/Operation_1", OneWay=false,
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Default)]
[return:
System.Xml.Serialization.XmlElementAttribute(Namespace="http://BiztalkExpose
WebServices.RFP", ElementName="RFP")]
public BiztalkExposeWebServices.XsdTypes1.RFP
Operation_1([System.Xml.Serialization.XmlElementAttribute(Namespace="http://
BiztalkExposeWebServices.RFP", ElementName="RFP")]
BiztalkExposeWebServices.XsdTypes1.RFP part)
{
System.Collections.ArrayList inHeaders = null;
System.Collections.ArrayList inoutHeaders = null;
System.Collections.ArrayList inoutHeaderResponses = null;
System.Collections.ArrayList outHeaderResponses = null;
System.Web.Services.Protocols.SoapUnknownHeader[] unknownHeaderResponses =
null;
// Parameter information
object[] invokeParams = new object[] {
part};
Microsoft.BizTalk.WebServices.ServerProxy.ParamInfo[] inParamInfos = new
Microsoft.BizTalk.WebServices.ServerProxy.ParamInfo[] {
new
Microsoft.BizTalk.WebServices.ServerProxy.ParamInfo(typeof(BiztalkExposeWebS
ervices.XsdTypes1.RFP), "part")};
Microsoft.BizTalk.WebServices.ServerProxy.ParamInfo[] outParamInfos = new
Microsoft.BizTalk.WebServices.ServerProxy.ParamInfo[] {
new
Microsoft.BizTalk.WebServices.ServerProxy.ParamInfo(typeof(BiztalkExposeWebS
ervices.XsdTypes1.RFP), "part")};
string bodyTypeAssemblyQualifiedName = "BiztalkExposeWebServices.RFP,
BiztalkExposeWebServices, Version=1.0.0.0, Culture=" +
"neutral, PublicKeyToken=649666eaf2ce86f8";
// BizTalk invocation
object[] invokeResults = this.Invoke("Operation_1", invokeParams,
inParamInfos, outParamInfos, 0, bodyTypeAssemblyQualifiedName, inHeaders,
inoutHeaders, out inoutHeaderResponses, out outHeaderResponses, null, null,
null, out unknownHeaderResponses, false, false);
BiztalkExposeWebServices.XsdTypes1.RFP returnValue =
((BiztalkExposeWebServices.XsdTypes1.RFP)(invokeResults[0]));
return returnValue;
}
}
}
| |
| Luis Esteban Valencia 2005-07-25, 6:04 pm |
| I thinn I gettting better but still a little problem. I didn realize that
the WS exposed me another object called RFP
private void Button1_Click(object sender, System.EventArgs e)
{
localhost. BiztalkExposeWebServices_BizTalk_Orchest
ration1_WS ws = new
ConsumirOWS.localhost. BiztalkExposeWebServices_BizTalk_Orchest
ration1_WS();
localhost.RFP rfpdoc = new localhost.RFP();
rfpdoc.Cost = Convert.ToDecimal(TextBox1.Text);
rfpdoc.Hours = Convert.ToDecimal(TextBox2.Text);
rfpdoc.ID = TextBox3.Text;
rfpdoc.Services = TextBox4.Text;
rfpdoc.Status = TextBox5.Text;
ws.Operation_1(rfpdoc); //There is the error
}
Error Says
c:\inetpub\wwwroot\ConsumirOWS\WebForm1.aspx.cs(64): Argumento '1': no se
puede convertir de 'ConsumirOWS.localhost.RFP' a 'ref
ConsumirOWS.localhost.RFP'
c:\inetpub\wwwroot\ConsumirOWS\WebForm1.aspx.cs(64): La mejor coincidencia
de método sobrecargado para
'ConsumirOWS.localhost. BiztalkExposeWebServices_BizTalk_Orchest
ration1_WS.Op
eration_1(ref ConsumirOWS.localhost.RFP)' tiene algunos argumentos no
válidos
"Luis Esteban Valencia" <levalencia@avansoft.com> escribió en el mensaje
news:eTlqcaTkFHA.2920@TK2MSFTNGP14.phx.gbl...
> Hello. I just make a webservice with the wizard based on an orchestration.
> Its about chapter 10 of biztalk unleashed book.
>
> It generated me this class-
>
> And I am trying to consume the webservice with a page but It receives an
RFP
> document which I dont know to construct
>
> private void Button1_Click(object sender, System.EventArgs e)
>
> {
>
> localhost. BiztalkExposeWebServices_BizTalk_Orchest
ration1_WS ws = new
>
ConsumirOWS.localhost. BiztalkExposeWebServices_BizTalk_Orchest
ration1_WS();
>
> ws.Operation_1(
>
> }
>
>
>
>
> Class Generated by Biztalk webservies publishing wizard..
>
//--------------------------------------------------------------------------
> ----
>
> // <autogenerated>
>
> // This code was generated by a tool.
>
> // Runtime Version: 1.1.4322.985
>
> //
>
> // Changes to this file may cause incorrect behavior and will be lost if
>
> // the code is regenerated.
>
> // </autogenerated>
>
>
//--------------------------------------------------------------------------
> ----
>
> // Generated by "Microsoft.BizTalk.WebServices, Version=3.0.1.0,
> Culture=neutral, PublicKeyToken=31bf3856ad364e35"
>
> // Product: Microsoft® BizTalk® Server 2004 3.0.4902.0
>
> // File: Microsoft.BizTalk.WebServices.dll 3.0.4902.0
>
> //
>
> namespace BiztalkExposeWebServices
>
> {
>
>
>
> // service "BiztalkExposeWebServices.BizTalk_Orchestration1" port "WS"
>
>
[System.Web.Services.WebServiceBindingAttribute(Name="BiztalkExposeWebServic
> es_BizTalk_Orchestration1_WS",
> Namespace="http://que.orchestrations.webservices")]
>
>
[System.Web.Services.WebServiceAttribute(Name=" BiztalkExposeWebServices_BizT
> alk_Orchestration1_WS", Namespace="http://que.orchestrations.webservices",
> Description="BizTalk assembly \"BiztalkExposeWebServices, Version=1.0.0.0,
> Culture=neutral, Pub" +
>
> "licKeyToken=649666eaf2ce86f8\" published web service.")]
>
> public sealed class BiztalkExposeWebServices_BizTalk_Orchest
ration1_WS :
> Microsoft.BizTalk.WebServices.ServerProxy.ServerProxy
>
> {
>
>
> // operation "Operation_1"
>
> [System.Web.Services.WebMethodAttribute()]
>
>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://que.orche
> strations.webservices/ BiztalkExposeWebServices_BizTalk_Orchest
rat" +
>
> "ion1_WS/Operation_1", OneWay=false,
> Use=System.Web.Services.Description.SoapBindingUse.Literal,
> ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Default)]
>
> [return:
>
System.Xml.Serialization.XmlElementAttribute(Namespace="http://BiztalkExpose
> WebServices.RFP", ElementName="RFP")]
>
> public BiztalkExposeWebServices.XsdTypes1.RFP
>
Operation_1([System.Xml.Serialization.XmlElementAttribute(Namespace="http://
> BiztalkExposeWebServices.RFP", ElementName="RFP")]
> BiztalkExposeWebServices.XsdTypes1.RFP part)
>
> {
>
> System.Collections.ArrayList inHeaders = null;
>
> System.Collections.ArrayList inoutHeaders = null;
>
> System.Collections.ArrayList inoutHeaderResponses = null;
>
> System.Collections.ArrayList outHeaderResponses = null;
>
> System.Web.Services.Protocols.SoapUnknownHeader[] unknownHeaderResponses =
> null;
>
> // Parameter information
>
> object[] invokeParams = new object[] {
>
> part};
>
> Microsoft.BizTalk.WebServices.ServerProxy.ParamInfo[] inParamInfos = new
> Microsoft.BizTalk.WebServices.ServerProxy.ParamInfo[] {
>
> new
>
Microsoft.BizTalk.WebServices.ServerProxy. ParamInfo(typeof(BiztalkExposeWebS[vbcol
=seagreen]
> ervices.XsdTypes1.RFP), "part")};
>
> Microsoft.BizTalk.WebServices.ServerProxy.ParamInfo[] outParamInfos = new
> Microsoft.BizTalk.WebServices.ServerProxy.ParamInfo[] {
>
> new
>[/vbcol]
Microsoft.BizTalk.WebServices.ServerProxy. ParamInfo(typeof(BiztalkExposeWebS[vbcol
=seagreen]
> ervices.XsdTypes1.RFP), "part")};
>
> string bodyTypeAssemblyQualifiedName = "BiztalkExposeWebServices.RFP,
> BiztalkExposeWebServices, Version=1.0.0.0, Culture=" +
>
> "neutral, PublicKeyToken=649666eaf2ce86f8";
>
> // BizTalk invocation
>
> object[] invokeResults = this.Invoke("Operation_1", invokeParams,
> inParamInfos, outParamInfos, 0, bodyTypeAssemblyQualifiedName, inHeaders,
> inoutHeaders, out inoutHeaderResponses, out outHeaderResponses, null,[/vbcol]
null,
> null, out unknownHeaderResponses, false, false);
>
> BiztalkExposeWebServices.XsdTypes1.RFP returnValue =
> ((BiztalkExposeWebServices.XsdTypes1.RFP)(invokeResults[0]));
>
> return returnValue;
>
> }
>
> }
>
> }
>
>
| |
| Michel Prévost 2005-07-25, 6:04 pm |
| Try:
ws.Operation_1(ref rfpdoc);
"Luis Esteban Valencia" <levalencia@avansoft.com> wrote in message
news:uglJedTkFHA.2152@TK2MSFTNGP14.phx.gbl...
>I thinn I gettting better but still a little problem. I didn realize that
> the WS exposed me another object called RFP
>
> private void Button1_Click(object sender, System.EventArgs e)
>
> {
>
> localhost. BiztalkExposeWebServices_BizTalk_Orchest
ration1_WS ws = new
> ConsumirOWS.localhost. BiztalkExposeWebServices_BizTalk_Orchest
ration1_WS();
>
>
> localhost.RFP rfpdoc = new localhost.RFP();
>
> rfpdoc.Cost = Convert.ToDecimal(TextBox1.Text);
>
> rfpdoc.Hours = Convert.ToDecimal(TextBox2.Text);
>
> rfpdoc.ID = TextBox3.Text;
>
> rfpdoc.Services = TextBox4.Text;
>
> rfpdoc.Status = TextBox5.Text;
>
> ws.Operation_1(rfpdoc); //There is the error
>
>
>
>
> }
>
>
>
> Error Says
>
> c:\inetpub\wwwroot\ConsumirOWS\WebForm1.aspx.cs(64): Argumento '1': no se
> puede convertir de 'ConsumirOWS.localhost.RFP' a 'ref
> ConsumirOWS.localhost.RFP'
>
>
> c:\inetpub\wwwroot\ConsumirOWS\WebForm1.aspx.cs(64): La mejor coincidencia
> de método sobrecargado para
> 'ConsumirOWS.localhost. BiztalkExposeWebServices_BizTalk_Orchest
ration1_WS.Op
> eration_1(ref ConsumirOWS.localhost.RFP)' tiene algunos argumentos no
> válidos
>
>
> "Luis Esteban Valencia" <levalencia@avansoft.com> escribió en el mensaje
> news:eTlqcaTkFHA.2920@TK2MSFTNGP14.phx.gbl...
> RFP
> ConsumirOWS.localhost. BiztalkExposeWebServices_BizTalk_Orchest
ration1_WS();
> //--------------------------------------------------------------------------
> //--------------------------------------------------------------------------
> [System.Web.Services.WebServiceBindingAttribute(Name="BiztalkExposeWebServic
> [System.Web.Services.WebServiceAttribute(Name="BiztalkExposeWebServices_BizT
> [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://que.orche
> System.Xml.Serialization.XmlElementAttribute(Namespace="http://BiztalkExpose
> Operation_1([System.Xml.Serialization.XmlElementAttribute(Namespace="http://
> Microsoft.BizTalk.WebServices.ServerProxy.ParamInfo(typeof(BiztalkExposeWebS
> Microsoft.BizTalk.WebServices.ServerProxy.ParamInfo(typeof(BiztalkExposeWebS
> null,
>
>
| |
| Emmanuel Issaly 2005-07-26, 7:56 am |
| afaik, you simply have to make a normal client app which uses a web
reference to the asmx that is generated. the wrapper code you show isn't
here to be modified in a normal use.
then, i might be wrong :-)
"Luis Esteban Valencia" <levalencia@avansoft.com> a écrit dans le message de
news: eTlqcaTkFHA.2920@TK2MSFTNGP14.phx.gbl...
> Hello. I just make a webservice with the wizard based on an orchestration.
> Its about chapter 10 of biztalk unleashed book.
>
> It generated me this class-
>
> And I am trying to consume the webservice with a page but It receives an
> RFP
> document which I dont know to construct
>
> private void Button1_Click(object sender, System.EventArgs e)
>
> {
>
> localhost. BiztalkExposeWebServices_BizTalk_Orchest
ration1_WS ws = new
> ConsumirOWS.localhost. BiztalkExposeWebServices_BizTalk_Orchest
ration1_WS();
>
> ws.Operation_1(
>
> }
>
>
>
>
> Class Generated by Biztalk webservies publishing wizard..
> //--------------------------------------------------------------------------
> ----
>
> // <autogenerated>
>
> // This code was generated by a tool.
>
> // Runtime Version: 1.1.4322.985
>
> //
>
> // Changes to this file may cause incorrect behavior and will be lost if
>
> // the code is regenerated.
>
> // </autogenerated>
>
> //--------------------------------------------------------------------------
> ----
>
> // Generated by "Microsoft.BizTalk.WebServices, Version=3.0.1.0,
> Culture=neutral, PublicKeyToken=31bf3856ad364e35"
>
> // Product: Microsoft® BizTalk® Server 2004 3.0.4902.0
>
> // File: Microsoft.BizTalk.WebServices.dll 3.0.4902.0
>
> //
>
> namespace BiztalkExposeWebServices
>
> {
>
>
>
> // service "BiztalkExposeWebServices.BizTalk_Orchestration1" port "WS"
>
> [System.Web.Services.WebServiceBindingAttribute(Name="BiztalkExposeWebServic
> es_BizTalk_Orchestration1_WS",
> Namespace="http://que.orchestrations.webservices")]
>
> [System.Web.Services.WebServiceAttribute(Name="BiztalkExposeWebServices_BizT
> alk_Orchestration1_WS", Namespace="http://que.orchestrations.webservices",
> Description="BizTalk assembly \"BiztalkExposeWebServices, Version=1.0.0.0,
> Culture=neutral, Pub" +
>
> "licKeyToken=649666eaf2ce86f8\" published web service.")]
>
> public sealed class BiztalkExposeWebServices_BizTalk_Orchest
ration1_WS :
> Microsoft.BizTalk.WebServices.ServerProxy.ServerProxy
>
> {
>
>
> // operation "Operation_1"
>
> [System.Web.Services.WebMethodAttribute()]
>
> [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://que.orche
> strations.webservices/ BiztalkExposeWebServices_BizTalk_Orchest
rat" +
>
> "ion1_WS/Operation_1", OneWay=false,
> Use=System.Web.Services.Description.SoapBindingUse.Literal,
> ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Default)]
>
> [return:
> System.Xml.Serialization.XmlElementAttribute(Namespace="http://BiztalkExpose
> WebServices.RFP", ElementName="RFP")]
>
> public BiztalkExposeWebServices.XsdTypes1.RFP
> Operation_1([System.Xml.Serialization.XmlElementAttribute(Namespace="http://
> BiztalkExposeWebServices.RFP", ElementName="RFP")]
> BiztalkExposeWebServices.XsdTypes1.RFP part)
>
> {
>
> System.Collections.ArrayList inHeaders = null;
>
> System.Collections.ArrayList inoutHeaders = null;
>
> System.Collections.ArrayList inoutHeaderResponses = null;
>
> System.Collections.ArrayList outHeaderResponses = null;
>
> System.Web.Services.Protocols.SoapUnknownHeader[] unknownHeaderResponses =
> null;
>
> // Parameter information
>
> object[] invokeParams = new object[] {
>
> part};
>
> Microsoft.BizTalk.WebServices.ServerProxy.ParamInfo[] inParamInfos = new
> Microsoft.BizTalk.WebServices.ServerProxy.ParamInfo[] {
>
> new
> Microsoft.BizTalk.WebServices.ServerProxy.ParamInfo(typeof(BiztalkExposeWebS
> ervices.XsdTypes1.RFP), "part")};
>
> Microsoft.BizTalk.WebServices.ServerProxy.ParamInfo[] outParamInfos = new
> Microsoft.BizTalk.WebServices.ServerProxy.ParamInfo[] {
>
> new
> Microsoft.BizTalk.WebServices.ServerProxy.ParamInfo(typeof(BiztalkExposeWebS
> ervices.XsdTypes1.RFP), "part")};
>
> string bodyTypeAssemblyQualifiedName = "BiztalkExposeWebServices.RFP,
> BiztalkExposeWebServices, Version=1.0.0.0, Culture=" +
>
> "neutral, PublicKeyToken=649666eaf2ce86f8";
>
> // BizTalk invocation
>
> object[] invokeResults = this.Invoke("Operation_1", invokeParams,
> inParamInfos, outParamInfos, 0, bodyTypeAssemblyQualifiedName, inHeaders,
> inoutHeaders, out inoutHeaderResponses, out outHeaderResponses, null,
> null,
> null, out unknownHeaderResponses, false, false);
>
> BiztalkExposeWebServices.XsdTypes1.RFP returnValue =
> ((BiztalkExposeWebServices.XsdTypes1.RFP)(invokeResults[0]));
>
> return returnValue;
>
> }
>
> }
>
> }
>
>
|
|
|
|
|