Unanswered Silverlight can't talk to WWS service

  • Tuesday, April 27, 2010 3:26 PM
     
      Has Code

    I created a WCF service using basicHttpBinding. And then I created a WinFormApp and SiverlightApp, both of which add references to the WCF service. Both the WinFormApp and SilverlightApp could talk to the WCF service successfully.

    Later, I converted the WCF service to WWS service using WWSAPI (I used the wsdl and xsd files generated in WinFormApp as input for wsutil.exe to generate the c/h files).  The WWS service could run sucessfully and the WinFromApp was still able to talk to it. However, the SilverlightApp could not talk to the WWS service.

    What is more, when I accessed the WWS service endpoint via IE, I got below errors. Could anyone give me some hints?

     

    <s:Envelop xmlns:s="http://schema.xmlsoap.org/soap/envelop/">
     <s:Body>
      <faultcode>s:Client</faultcode>
      <faultstring xml:lang="en-US">The server was unable to process the request due to an internal error</faultstring>
     </s:Body>
    </s:Envelop>
    Thank you very much!
    Bobby

All Replies

  • Tuesday, April 27, 2010 7:12 PM
     
     
    I suppose you are using service host. You can turn off minimal fault disclosure on the server for debugging purposes (check WS_SERVICE_PROPERTY_FAULT_DISCLOSURE property) - this should shed some light on the problem.

    My first guess it that the fault is caused by the user agent value (check WS_LISTENER_PROPERTY_DISALLOWED_USER_AGENT property). It this is not correct, check if your SOAP and Ws-Addressing version are correct.
  • Wednesday, April 28, 2010 1:28 AM
     
     

    Thank you Piotr.

    Yes. I used the service host in WWS service. And it is quite simple. It just creates and open an endpoint and implements some call back functions for client to call.

    My question is how to check the property like WS_SERVICE_PROPERTY_FAULT_DISCLOSURE and WS_LISTENER_PROPERTY_DISALLOWED_USER_AGENT?

     

    Thanks.


    Bobby
  • Wednesday, April 28, 2010 5:03 AM
     
      Has Code

    What is more, I have checked to make sure that SOAP 1.1 and  no Ws-Addressing is used in the my service because I use the generate BasicHttpBinding_IHelloService_CreateServiceEndpoint() to create the endpoint and WS_ENVELOPE_VERSION_SOAP_1_1, WS_ADDRESSING_VERSION_TRANSPORT are found in the policy descripiton.

    I turned on the WWS trace and got below trace log information. The first part of trace shows correctly when calling from WinFromApp. But the rest two calling from SilverlightApp and IE are both of errors.

    0x803d0000,The input data was not in the expected format or did not have the expected value.

    0x0,The HTTP verb was not 'POST'.

    What is the expected format/value?

     

    Microsoft (R) Windows Web Services API Trace Viewer Tool version 1.0
    Copyright (c) Microsoft Corporation 2009.
    All rights reserved.
    
    TimeStamp,ProcessID,ThreadID,Event,Operation,Error,Info
    129168980000313750,3940,3660,"enter","WsCreateError"
    129168980000313750,3940,3660,"exit","WsCreateError"
    129168980000313750,3940,3660,"enter","WsCreateHeap"
    129168980000313750,3940,3660,"exit","WsCreateHeap"
    129168980000313750,3940,3660,"enter","WsCreateServiceEndpointFromTemplate"
    129168980000313750,3940,3660,"exit","WsCreateServiceEndpointFromTemplate"
    129168980000313750,3940,3660,"enter","WsCreateServiceHost"
    129168980000313750,3940,3660,"exit","WsCreateServiceHost"
    129168980000313750,3940,3660,"enter","WsOpenServiceHost"
    129168980000313750,3940,3660,"io started","Receive"
    129168980000470000,3940,3660,"io started","Receive"
    129168980000470000,3940,3660,"exit","WsOpenServiceHost"
    129168980152032500,3940,140,"io started","Receive"
    129168980152032500,3940,140,"io completed","Send",0x0,223
    129168980152032500,3940,140,"received message   ","message# (1)",
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
     <s:Body>
      <SayHello xmlns="http://tempuri.org/">
       <strName>dfd</strName>
      </SayHello>
     </s:Body>
    </s:Envelope>
    129168980152032500,3940,140,"received message stop ","message# (1)"
    129168980152032500,3940,140,"sending message    ","message# (2)",
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
     <s:Body>
      <SayHelloResponse xmlns="http://tempuri.org/">
       <SayHelloResult>Hello dfd from WWS API in C/C++</SayHelloResult>
      </SayHelloResponse>
     </s:Body>
    </s:Envelope>
    129168980152032500,3940,140,"sending message stop ","message# (2)"
    129168980152032500,3940,140,"io completed","Receive",0x0,750
    129168980152032500,3940,1036,"io started","Receive"
    129168980152032500,3940,140,"io completed","Receive",0x0,165
    129168980152032500,3940,140,"io started","Receive"
    129168980152032500,3940,140,"io completed","Receive",0x0,0
    129168980152032500,3940,140,"received message start","message# (1)"
    129168980152032500,3940,140,"received message - bin","message# (1)",
    3C 73 3A 45 6E 76 65 6C 6F 70 65 20 78 6D 6C 6E 73 3A 73 3D 22 68 74 74 70 3A 2F 2F 73 63 68 65 6D 61 73 2E 78 6D 6C 73 6F 61 70 2E 6F 72 67 2F 73 6F 61 70 2F 65 6E 76 65 6C 6F 70 65 2F 22 3E 3C 73 3A 42 6F 64 79 3E 3C 53 61 79 48 65 6C 6C 6F 20 78 6D 6C 6E 73 3D 22 68 74 74 70 3A 2F 2F 74 65 6D 70 75 72 69 2E 6F 72 67 2F 22 3E 3C 73 74 72 4E 61 6D 65 3E 64 66 64 3C 2F 73 74 72 4E 61 6D 65 3E 3C 2F 53 61 79 48 65 6C 6C 6F 3E 3C 2F 73 3A 42 6F 64 79 3E 3C 2F 73 3A 45 6E 76 65 6C 6F 70 65 3E 
    129168980152032500,3940,140,"sending message start ","message# (2)"
    129168980152032500,3940,140,"sending message - bin ","message# (2)",
    3C 73 3A 45 6E 76 65 6C 6F 70 65 20 78 6D 6C 6E 73 3A 73 3D 22 68 74 74 70 3A 2F 2F 73 63 68 65 6D 61 73 2E 78 6D 6C 73 6F 61 70 2E 6F 72 67 2F 73 6F 61 70 2F 65 6E 76 65 6C 6F 70 65 2F 22 3E 3C 73 3A 42 6F 64 79 3E 3C 53 61 79 48 65 6C 6C 6F 52 65 73 70 6F 6E 73 65 20 78 6D 6C 6E 73 3D 22 68 74 74 70 3A 2F 2F 74 65 6D 70 75 72 69 2E 6F 72 67 2F 22 3E 3C 53 61 79 48 65 6C 6C 6F 52 65 73 75 6C 74 3E 48 65 6C 6C 6F 20 64 66 64 20 66 72 6F 6D 20 57 57 53 20 41 50 49 20 69 6E 20 43 2F 43 2B 2B 3C 2F 53 61 79 48 65 6C 6C 6F 52 65 73 75 6C 74 3E 3C 2F 53 61 79 48 65 6C 6C 6F 52 65 73 70 6F 6E 73 65 3E 3C 2F 73 3A 42 6F 64 79 3E 3C 2F 73 3A 45 6E 76 65 6C 6F 70 65 3E 
    129168980152032500,3940,140,"io started","Send"
    129168980152032500,3940,3168,"io completed","Send",0x0,147
    129168980152032500,3940,3168,"io started","Send"
    129168981865626250,3940,3144,"io started","Receive"
    129168981865626250,3940,1036,"io completed","Receive",0x0,955
    129168981865626250,3940,1036,"io started","Receive"
    129168981865626250,3940,1036,"io completed","Receive",0x0,167
    129168981865626250,3940,1036,"io started","Receive"
    129168981865626250,3940,1036,"io completed","Receive",0x0,0
    129168981865626250,3940,1036,"error","",0x803d0000,The input data was not in the expected format or did not have the expected value.
    129168981865626250,3940,1036,"error","",0x0,The incoming HTTP request contained user agent 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)' which has the d
    129168981865626250,3940,1036,"sending message start ","message# (3)"
    129168981865626250,3940,1036,"sending message - bin ","message# (3)",
    3C 73 3A 45 6E 76 65 6C 6F 70 65 20 78 6D 6C 6E 73 3A 73 3D 22 68 74 74 70 3A 2F 2F 73 63 68 65 6D 61 73 2E 78 6D 6C 73 6F 61 70 2E 6F 72 67 2F 73 6F 61 70 2F 65 6E 76 65 6C 6F 70 65 2F 22 3E 3C 73 3A 42 6F 64 79 3E 3C 73 3A 46 61 75 6C 74 3E 3C 66 61 75 6C 74 63 6F 64 65 3E 73 3A 43 6C 69 65 6E 74 3C 2F 66 61 75 6C 74 63 6F 64 65 3E 3C 66 61 75 6C 74 73 74 72 69 6E 67 20 78 6D 6C 3A 6C 61 6E 67 3D 22 65 6E 2D 55 53 22 3E 54 68 65 20 73 65 72 76 65 72 20 77 61 73 20 75 6E 61 62 6C 65 20 74 6F 20 70 72 6F 63 65 73 73 20 74 68 65 20 72 65 71 75 65 73 74 20 64 75 65 20 74 6F 20 61 6E 20 69 6E 74 65 72 6E 61 6C 20 65 72 72 6F 72 2E 3C 2F 66 61 75 6C 74 73 74 72 69 6E 67 3E 3C 2F 73 3A 46 61 75 6C 74 3E 3C 2F 73 3A 42 6F 64 79 3E 3C 2F 73 3A 45 6E 76 65 6C 6F 70 65 3E 
    129168981865626250,3940,1036,"io started","Send"
    129168981865626250,3940,1036,"io completed","Send",0x0,156
    129168981865626250,3940,1036,"io started","Send"
    129168981865626250,3940,344,"io completed","Send",0x0,258
    129168981865626250,3940,344,"sending message    ","message# (3)",
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
     <s:Body>
      <s:Fault>
       <faultcode>s:Client</faultcode>
       <faultstring xml:lang="en-US">The server was unable to process the request due to an internal error.</faultstring>
      </s:Fault>
     </s:Body>
    </s:Envelope>
    129168981865626250,3940,344,"sending message stop ","message# (3)"
    129168982963907500,3940,1036,"io completed","Receive",0x0,1013
    129168982963907500,3940,1036,"io started","Receive"
    129168982963907500,3940,1036,"io completed","Receive",0x0,0
    129168982963907500,3940,1036,"error","",0x803d0000,The input data was not in the expected format or did not have the expected value.
    129168982963907500,3940,1036,"error","",0x0,The HTTP verb was not 'POST'.
    129168982963907500,3940,1036,"sending message start ","message# (4)"
    129168982963907500,3940,1036,"sending message - bin ","message# (4)",
    3C 73 3A 45 6E 76 65 6C 6F 70 65 20 78 6D 6C 6E 73 3A 73 3D 22 68 74 74 70 3A 2F 2F 73 63 68 65 6D 61 73 2E 78 6D 6C 73 6F 61 70 2E 6F 72 67 2F 73 6F 61 70 2F 65 6E 76 65 6C 6F 70 65 2F 22 3E 3C 73 3A 42 6F 64 79 3E 3C 73 3A 46 61 75 6C 74 3E 3C 66 61 75 6C 74 63 6F 64 65 3E 73 3A 43 6C 69 65 6E 74 3C 2F 66 61 75 6C 74 63 6F 64 65 3E 3C 66 61 75 6C 74 73 74 72 69 6E 67 20 78 6D 6C 3A 6C 61 6E 67 3D 22 65 6E 2D 55 53 22 3E 54 68 65 20 73 65 72 76 65 72 20 77 61 73 20 75 6E 61 62 6C 65 20 74 6F 20 70 72 6F 63 65 73 73 20 74 68 65 20 72 65 71 75 65 73 74 20 64 75 65 20 74 6F 20 61 6E 20 69 6E 74 65 72 6E 61 6C 20 65 72 72 6F 72 2E 3C 2F 66 61 75 6C 74 73 74 72 69 6E 67 3E 3C 2F 73 3A 46 61 75 6C 74 3E 3C 2F 73 3A 42 6F 64 79 3E 3C 2F 73 3A 45 6E 76 65 6C 6F 70 65 3E 
    129168982963907500,3940,1036,"io started","Send"
    129168982963907500,3940,1036,"io started","Receive"
    129168982964063750,3940,3144,"io completed","Send",0x0,163
    129168982964063750,3940,3144,"io started","Send"
    129168982964063750,3940,1036,"io completed","Send",0x0,258
    129168982964063750,3940,1036,"sending message stop ","message# (4)"
    129168982964063750,3940,1036,"sending message    ","message# (4)",
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
     <s:Body>
      <s:Fault>
       <faultcode>s:Client</faultcode>
       <faultstring xml:lang="en-US">The server was unable to process the request due to an internal error.</faultstring>
      </s:Fault>
     </s:Body>
    </s:Envelope>
    
    Thanks.
    Bobby
  • Wednesday, April 28, 2010 4:44 PM
     
     

    What do you mean by checking properties? If you have not changed them, WWSAPI uses default value defined in the documentation. You should set them to value you need during the creation of service host.

     

    First error says that user agen has forbidden substring - WS_LISTENER_PROPERTY_DISALLOWED_USER_AGENT property should solve the problem here. Last error says that the client used different HTTP verb than POST. WWSAPI requires POST verb (as defined in SOAP spec)  - it seems that your client does not follow SOAP protocol.

  • Thursday, April 29, 2010 3:18 PM
     
     
    Thank you Piotr. Your suggestion is very helpful to me. Yes. By setting the WS_LISTENER_PROPERTY_DISALLOWED_USER_AGENT property, the first issue has been resolved. I will check our client to see why not POST is used for HTTP verb.
    Bobby
  • Monday, May 28, 2012 4:59 PM
     
     

    some copy'n'paste code to accept all user agents with empty disallowed-string:

    WS_DISALLOWED_USER_AGENT_SUBSTRINGS disallowedAgents;
    disallowedAgents.subStringCount= 0;
    disallowedAgents.subStrings = NULL;

    WS_LISTENER_PROPERTY listenerPropArray[1];
    listenerPropArray[0].id = WS_LISTENER_PROPERTY_DISALLOWED_USER_AGENT;
    listenerPropArray[0].value = &disallowedAgents;
    listenerPropArray[0].valueSize = sizeof(disallowedAgents);

    WS_LISTENER_PROPERTIES listenerProps;
    listenerProps.properties = listenerPropArray;
    listenerProps.propertyCount = WsCountOf(listenerPropArray);

    WS_SERVICE_ENDPOINT_PROPERTY endPointProps[1];
    endPointProps[0].id = WS_SERVICE_ENDPOINT_PROPERTY_LISTENER_PROPERTIES;
    endPointProps[0].value = &listenerProps;
    endPointProps[0].valueSize = sizeof(listenerProps);

    WS_SERVICE_ENDPOINT* endpoint = 0;
        HR(CalculatorBinding_CreateServiceEndpoint(0, // template value
                                                   &address,
                                                   &functions,
      0, 
                                                   endPointProps,
      1,
      heap,
                                                   &endpoint,
                                                   error));



    • Edited by helmonaut Monday, May 28, 2012 5:00 PM
    •