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/21 23:53:07 UTC
.NET 2.0 and Ofbiz (SOAP) Web Service Connectivity
Hello,
I am trying to figure out how to use OFBiz web services through SOAP
using C# (.NET 2.0 Visual Studio 2005). I was wondering if this is a
know issue? Any kind of direction on how I can fix this will be great?
There are several things I tried to do unsuccessfully. I created a
simple Ofbiz Service that takes three string arguments and return one
string.
1) When I try to add Web Reference using WSE 3.0 to my .NET project, the
auto generated proxy has the following error
// CODEGEN: The operation binding 'addWorkflowStep' from namespace
'http://www.ofbiz.org/service/' was ignored. Specifying a type for
use=literal messages is not supported.
and it doesn't contain the code for the actual web service invocation
2) I tried to modify the WSDL (on the local file system) and added the
Web Reference using the Modified wsdl, first I got the following error
when I tried to contact the service
System.Web.Services.Protocols.SoapException: Possible SOAP version
mismatch: Envelope namespace http://schemas.xmlsoap.org/wsdl/ was
unexpected. Expecting http://schemas.xmlsoap.org/soap/envelope/.
at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapCl
ientMessage message, WebResponse response, Stream responseStream,
Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at SimpleConsoleClient.WF.addWorkflowStep.CalladdWorkflowStep(String
id, String applicationId) in
C:\DocumentsandSettings\FPAdmin\Desktop\SRX0703
07601425_Maria\SimpleConsoleClient\SimpleConsoleClient\Web
References\WF\Reference.cs:line 79
at SimpleConsoleClient.Program.Display() in C:\Documents and
Settings\FPAdmin\Desktop\SRX070307601425_Maria\SimpleConsoleClient\Simpl
eConsoleClient\Program.cs:line 62
at SimpleConsoleClient.Program.DoWork(Trap action) in C:\Documents
and
Settings\FPAdmin\Desktop\SRX070307601425_Maria\SimpleConsoleClient\Simpl
eConsoleClient\Program.cs:line 20
3) Modifying the proxy and the wsdl file some more I was able to call
ofbiz service, (I tracked the packages and was able to see the request
and the response), but I was not able to read the response back. I am
keep getting object array of one element that is null.
POST http://storm.wcpub.es.xerox.com:8080/webtools/control/SOAPService
HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client
Protocol 2.0.50727.42)
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://schemas.xmlsoap.org/soap/http"
Host: storm.wcpub.es.xerox.com:8080
Content-Length: 392
Expect: 100-continue
Proxy-Connection: Keep-Alive
HTTP/1.1 100 Continue
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><addWorkflowStep
xmlns="http://www.ofbiz.org/service/"><id>10000</id><applicationId>blah<
/applicationId><domainId>foo</domainId></addWorkflowStep></soap:Body></s
oap:Envelope>HTTP/1.0 200 OK
Proxy-Connection: Keep-Alive
Connection: Keep-Alive
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Content-Length: 629
Date: Wed, 21 Mar 2007 22:16:17 GMT
Set-Cookie: JSESSIONID=2CD21B90923A7153982DE1A28ADFFD08.jvm1;
Path=/webtools
Set-Cookie: OFBiz.Visitor=10306; Expires=Thu, 20-Mar-2008 22:16:18 GMT;
Path=/
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:addWorkflowStepResponse
xmlns:ns1="http://www.ofbiz.org/service/">
<workflowStepId xsi:type="soapenc:string"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">10016</workflo
wStepId>
<responseMessage xsi:type="soapenc:string"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">success</respo
nseMessage>
</ns1:addWorkflowStepResponse>
</soapenv:Body>
</soapenv:Envelope>
4) I used my project to connect to Axis service and it works fine I am
getting a response back and I am able to read it.
5) I also tried to contact ofbiz service thru java eclipse project, also
not successfully.
Thanks a lot,
Marina
Re: .NET 2.0 and Ofbiz (SOAP) Web Service Connectivity
Posted by Jacques Le Roux <ja...@les7arts.com>.
Please have a look at http://tinyurl.com/yqsqro
Jacques
I am trying to figure out how to use OFBiz web services through SOAP
using C# (.NET 2.0 Visual Studio 2005). I was wondering if this is a
know issue? Any kind of direction on how I can fix this will be great?
There are several things I tried to do unsuccessfully. I created a
simple Ofbiz Service that takes three string arguments and return one
string.
1) When I try to add Web Reference using WSE 3.0 to my .NET project, the
auto generated proxy has the following error
// CODEGEN: The operation binding 'addWorkflowStep' from namespace
'http://www.ofbiz.org/service/' was ignored. Specifying a type for
use=literal messages is not supported.
and it doesn't contain the code for the actual web service invocation
2) I tried to modify the WSDL (on the local file system) and added the
Web Reference using the Modified wsdl, first I got the following error
when I tried to contact the service
System.Web.Services.Protocols.SoapException: Possible SOAP version
mismatch: Envelope namespace http://schemas.xmlsoap.org/wsdl/ was
unexpected. Expecting http://schemas.xmlsoap.org/soap/envelope/.
at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapCl
ientMessage message, WebResponse response, Stream responseStream,
Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at SimpleConsoleClient.WF.addWorkflowStep.CalladdWorkflowStep(String
id, String applicationId) in
C:\DocumentsandSettings\FPAdmin\Desktop\SRX0703
07601425_Maria\SimpleConsoleClient\SimpleConsoleClient\Web
References\WF\Reference.cs:line 79
at SimpleConsoleClient.Program.Display() in C:\Documents and
Settings\FPAdmin\Desktop\SRX070307601425_Maria\SimpleConsoleClient\Simpl
eConsoleClient\Program.cs:line 62
at SimpleConsoleClient.Program.DoWork(Trap action) in C:\Documents
and
Settings\FPAdmin\Desktop\SRX070307601425_Maria\SimpleConsoleClient\Simpl
eConsoleClient\Program.cs:line 20
3) Modifying the proxy and the wsdl file some more I was able to call
ofbiz service, (I tracked the packages and was able to see the request
and the response), but I was not able to read the response back. I am
keep getting object array of one element that is null.
POST http://storm.wcpub.es.xerox.com:8080/webtools/control/SOAPService
HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client
Protocol 2.0.50727.42)
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://schemas.xmlsoap.org/soap/http"
Host: storm.wcpub.es.xerox.com:8080
Content-Length: 392
Expect: 100-continue
Proxy-Connection: Keep-Alive
HTTP/1.1 100 Continue
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><addWorkflowStep
xmlns="http://www.ofbiz.org/service/"><id>10000</id><applicationId>blah<
/applicationId><domainId>foo</domainId></addWorkflowStep></soap:Body></s
oap:Envelope>HTTP/1.0 200 OK
Proxy-Connection: Keep-Alive
Connection: Keep-Alive
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Content-Length: 629
Date: Wed, 21 Mar 2007 22:16:17 GMT
Set-Cookie: JSESSIONID=2CD21B90923A7153982DE1A28ADFFD08.jvm1;
Path=/webtools
Set-Cookie: OFBiz.Visitor=10306; Expires=Thu, 20-Mar-2008 22:16:18 GMT;
Path=/
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:addWorkflowStepResponse
xmlns:ns1="http://www.ofbiz.org/service/">
<workflowStepId xsi:type="soapenc:string"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">10016</workflo
wStepId>
<responseMessage xsi:type="soapenc:string"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">success</respo
nseMessage>
</ns1:addWorkflowStepResponse>
</soapenv:Body>
</soapenv:Envelope>
4) I used my project to connect to Axis service and it works fine I am
getting a response back and I am able to read it.
5) I also tried to contact ofbiz service thru java eclipse project, also
not successfully.
Thanks a lot,
Marina
Re: .NET 2.0 and Ofbiz (SOAP) Web Service Connectivity
Posted by Shi Jinghai <sh...@langhua.cn>.
Hi Marina,
> There are several things I tried to do unsuccessfully. I created a
> simple Ofbiz Service that takes three string arguments and return one
> string.
>
Perhaps the existing http service can do the same thing?
https://localhost:8443/webtools/control/availableServices?constraint=engine_name@http
There is a testHttp service as an example in OFBiz:
http://localhost:8080/webtools/control/httpService
Regards,
Shi Jinghai/Beijing Langhua Ltd.