You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by "Cholakyan, Marina" <Ma...@xerox.com> on 2007/03/22 23:42:48 UTC

RE: .NET 2.0 and Ofbiz (SOAP) Web Service Connectivity=Solution

Hi, 
Thanks for quick responses!

I found a quick solution, since I am newbie in the whole SOAP, WSDL, Web
Services stuff probably not the best solution, but here it is...

When I used WSE in .NET 2.0 and tried to add Web Reference (where you
specify the Web Service url) and Visual Studio generates the
proxy/client code for the service invocation and sets the message style
to Document for Web service method. It goes something like this

...
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("",
           RequestNamespace = "http://www.ofbiz.org/service/",
           ResponseNamespace = "http://www.ofbiz.org/service/",
           Use = System.Web.Services.Description.SoapBindingUse.Literal,
           ParameterStyle =
System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public String yourServiceName(String arg)
{
     object[] result = this.Invoke("yourServiceName ", new object[0]
{arg});
     return (string)result[0];
}
...

Since it is hard to realize what is ofbiz's WSDL SOAP message is
formatted in (RPC or Document) style. I just in case tried to use RPC
and it worked so I replace the code above with.

...
[SoapRpcMethod()]
public String yourServiceName(String arg)
{
     object[] result = this.Invoke("yourServiceName ", new object[0]
{arg});
     return (string)result[0];
}
...

So I didn't use Visual Studio's auto generated proxy and Web Reference,
I just wrote my own client, which is not different from auto generated
code except the changes above. 

Marina