473,322 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Interop question for WCF Gurus

Reg
Hello,

I have a WCF Web Service using wsHttpDualBinding because I need a callback
to Java client.

I read Mr. A.Gupta's blog that if WCF Service uses wsHttpDualBinding for
interop working is not guaranteed.

I also tried to config wsHttpDualBinding in WCF Service Config file as
follows:

<bindings>
<customBinding>
<binding name="Binding1">
<reliableSession />
<compositeDuplex />
<oneWay />
<textMessageEncoding
messageVersion="Soap12WSAddressing10"
writeEncoding="utf-8" />
<httpTransport authenticationScheme="Anonymous"
bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
proxyAuthenticationScheme="Anonymous"
realm=""
useDefaultWebProxy="true" />
</binding>
</customBinding>
</bindings>
A C# Client works without problems.

But when using Axis client which is a Java Standalone application following
code:

class ClientUtil
{
public static OMElement getOMElement()
{
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace(
"http://ws.apache.org/axis2/xsd", "ns1");
OMElement method = fac.createOMElement("Hello", omNs);
OMElement value = fac.createOMElement("Hello", omNs);
value.setText("Hello");
method.addChild(value);
return method;
}
}

public class Client
{
private static EndpointReference targetEPR = new EndpointReference

("http://localhost:8000/ServiceMetadata/DuplexService");

public static void main(java.lang.String args[])
{
ServiceClient sender = null;
try {
OMElement payload = ClientUtil.getOMElement();
Options options = new Options();
options.setTo(targetEPR);
options.setTransportInProtocol(Constants.TRANSPORT _HTTP);
options.setUseSeparateListener(true);
options.setSoapVersionURI(SOAP12Constants.SOAP_ENV ELOPE_NAMESPACE_URI);
//Callback to handle the response
Callback callback = new Callback() {
public void onComplete(AsyncResult result)
{
System.out.println(result.getResponseEnvelope());
}

public void onError(Exception e)
{
e.printStackTrace();
}
};

//Non-Blocking Invocation
sender = new ServiceClient();
sender.engageModule(Constants.MODULE_ADDRESSING);
sender.setOptions(options);
sender.sendReceiveNonBlocking(payload, callback);
//Wait till the callback receives the response.
while (!callback.isComplete()) {
Thread.sleep(1000);
}
//Need to close the Client Side Listener.
}
catch (Exception axisFault)
{
axisFault.printStackTrace();
}

}

a Timeout error occurs. I have Addressing library in Axis part so that can't
be a issue.

Axis client hangs in while (!callback.isComplete()) loop and Timeout error
occurs.

Can anyone point what could be the problem? I need a callback feature so,
thats why I'm using wsHttpDualBinding.

Thanks


Aug 29 '07 #1
1 3138
You might find this discussion and example of some help. Maybe not, but take
a look:
http://dotnetaddict.dotnetdevelopers...alarmclock.htm
--
Charlie
"Reg" wrote:
Hello,

I have a WCF Web Service using wsHttpDualBinding because I need a callback
to Java client.

I read Mr. A.Gupta's blog that if WCF Service uses wsHttpDualBinding for
interop working is not guaranteed.

I also tried to config wsHttpDualBinding in WCF Service Config file as
follows:

<bindings>
<customBinding>
<binding name="Binding1">
<reliableSession />
<compositeDuplex />
<oneWay />
<textMessageEncoding
messageVersion="Soap12WSAddressing10"
writeEncoding="utf-8" />
<httpTransport authenticationScheme="Anonymous"
bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
proxyAuthenticationScheme="Anonymous"
realm=""
useDefaultWebProxy="true" />
</binding>
</customBinding>
</bindings>
A C# Client works without problems.

But when using Axis client which is a Java Standalone application following
code:

class ClientUtil
{
public static OMElement getOMElement()
{
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace(
"http://ws.apache.org/axis2/xsd", "ns1");
OMElement method = fac.createOMElement("Hello", omNs);
OMElement value = fac.createOMElement("Hello", omNs);
value.setText("Hello");
method.addChild(value);
return method;
}
}

public class Client
{
private static EndpointReference targetEPR = new EndpointReference

("http://localhost:8000/ServiceMetadata/DuplexService");

public static void main(java.lang.String args[])
{
ServiceClient sender = null;
try {
OMElement payload = ClientUtil.getOMElement();
Options options = new Options();
options.setTo(targetEPR);
options.setTransportInProtocol(Constants.TRANSPORT _HTTP);
options.setUseSeparateListener(true);
options.setSoapVersionURI(SOAP12Constants.SOAP_ENV ELOPE_NAMESPACE_URI);
//Callback to handle the response
Callback callback = new Callback() {
public void onComplete(AsyncResult result)
{
System.out.println(result.getResponseEnvelope());
}

public void onError(Exception e)
{
e.printStackTrace();
}
};

//Non-Blocking Invocation
sender = new ServiceClient();
sender.engageModule(Constants.MODULE_ADDRESSING);
sender.setOptions(options);
sender.sendReceiveNonBlocking(payload, callback);
//Wait till the callback receives the response.
while (!callback.isComplete()) {
Thread.sleep(1000);
}
//Need to close the Client Side Listener.
}
catch (Exception axisFault)
{
axisFault.printStackTrace();
}

}

a Timeout error occurs. I have Addressing library in Axis part so that can't
be a issue.

Axis client hangs in while (!callback.isComplete()) loop and Timeout error
occurs.

Can anyone point what could be the problem? I need a callback feature so,
thats why I'm using wsHttpDualBinding.

Thanks


Aug 29 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Shashank Date | last post by:
/* C# Gurus, I am trying to use interop marshalling to call SetCommTimeouts win32 API. But I keep getting the "Object reference not set to an instance of an object" error. Can anybody help...
8
by: Rob Edwards | last post by:
When trying to add the Microsoft CDO for Exchange Management Library (aka CDOEXM.dll) I receive the following message: "A reference to 'Microsoft CDO for Exchange Management Library' could not be...
17
by: Aaron | last post by:
I've got a doozie of a problem! I and others have been trying to figure this out for too long and I've come to the conclusion that I should probably look for some support.. Ok, I have a COM...
7
by: Biao | last post by:
I have a web service writen by .NET: public string Greetings(string names) { string gs = new string; for (int i = 0; i < gs.Length; i++) gs = string.Format("Hello, {0}", names);
6
by: Vijay | last post by:
Hi, I am faced with the following common managed/unmanaged C++ interop problem: - I have a .NET form that acts as a front end GUI to a processing engine in the background. The processing...
2
by: JC | last post by:
Anybody knows what problem has this code? I think, in the Garbage Collector? You know the Solution? The program in the test's case, whit 350 contacts, run OK before number 86. The error is a...
2
by: Philip Daniels | last post by:
I am doing some work with a client API via COM interop. I have reached the situation where after this call to their API: object someObj = con.Peek(1); "someObj" contains some type of COM...
0
by: Kaysetoaster | last post by:
Hi Gurus I wrote a "Active X" UserControl DLL in VB.NET and placed it on a iis 6 webserver. I embeded it with the object tag and the communication to functions and propertys in the vb.net...
2
by: Brad Isaac | last post by:
Hi, I have a working app that uses interop.outlook.dll to export items to Outlook calendar. I downloaded the Primary Interop Assemblies for Office 2k7 today and still cannot get a working...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.