Interop question for WCF Gurus

Discussion in 'ASP .Net Web Services' started by Reg, Aug 29, 2007.

  1. Reg

    Reg Guest

    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_ENVELOPE_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
     
    Reg, Aug 29, 2007
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex
    Replies:
    6
    Views:
    2,304
    John Saunders
    Aug 26, 2003
  2. George Copeland

    Question for Java Gurus

    George Copeland, May 17, 2004, in forum: Java
    Replies:
    44
    Views:
    1,452
    P.Hill
    May 25, 2004
  3. Dirk McCormick
    Replies:
    2
    Views:
    571
  4. Sean Berry
    Replies:
    5
    Views:
    422
    Cameron Laird
    Feb 27, 2004
  5. Simon
    Replies:
    0
    Views:
    1,259
    Simon
    Oct 13, 2009
  6. Cindy Lee
    Replies:
    1
    Views:
    3,086
    Mr. Arnold
    Mar 19, 2010
  7. JR

    Question about methodology for Gurus

    JR, Dec 10, 2003, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    288
    Dino Chiesa [Microsoft]
    Dec 11, 2003
  8. sonic_soul
    Replies:
    1
    Views:
    408
    David
    Oct 26, 2004
Loading...