469,928 Members | 1,691 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,928 developers. It's quick & easy.

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 2995
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Shashank Date | last post: by
8 posts views Thread by Rob Edwards | last post: by
7 posts views Thread by Biao | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.